Draw an irregular shape

Hi!

I’ve a little super question :slight_smile:

In playcanvas editor we can add
a plane. It’s great.

But doing an interesting application and create a script to add irregular shape in playcanvas scene.

Somebody can give me and advice?

Thanks a lot!!!

Have a look here perhaps - you can use Mesh API to add verticies / triangles to create a mesh.
http://playcanvas.github.io/#graphics/mesh-generation.html

A common approach is to use 3D modelling appications, like Blender, to create custom models. You can then simply import them (drag-and-drop) to your Editor. You should consider Playcanvas Editor as a scene management, rather than a 3D modelling environment.

Mesh API, referred by @mvaligursky, is a very convenient way to generate a custom dynamic mesh during run-time, which would be hard to do beforehand. For example, I use it to create mesh lines, which allows the lines to be dynamically changed in length, depending on the game context.

Thanks a lot!

Ohh! You are right… You helped me a lot!

Of course when I asked at forum I didn’t think to read a out pc.Mesh :slightly_smiling_face:

Thanks!

In fact, my application is rendering geometric and irregular shapes in run-time depending external data. My editor is practically empty.

Now I’m rendering lines but I will follow your advice for my next step.

Thanks @LeXXik and @mvaligursky for your time with me.

2 Likes