Draw polygon in runtime

Hello,

I have a list of points and i would like to draw a polygon in runtime using these coords. So far, I used a spline, and i have my polygon but i would like to give it a height (some sort of volume) and fill the surfaces with a color. Is there a simple way to do this?
Thanks in advance

Look into how Procedural Mesh works, have a quick look at:

for the most fundamental ideas. YT is full of videos now that you have a keyword.

Thank you, I’ve juqt looked into that, but I don’t see where I can define a height or volume ? and how can i possibly define the triangles if i don’t know how many elements are in each array

There’s no such thing here. You build all surfaces out of triangles. There’s no extrusion.

You first learn how to make a triangle, then 2 triangles - that’s a quad. Connect quads to make a more intricate surface. 6 quads connected right makes a box. That’s your volume whose height is determined by where the coords of the vertices are.

You generally end up with small functions capable of building surface pieces which you then stack together in more and more elaborate fashion. You make meshes section by section, in loops, often feeding them data recursively.

If you start digging around Google, you’ll run into libraries / data tables showing how to create entire primitives. These are engine agnostic as the techniques are decades old.


UE5 has modelling tools, perhaps this process can be simplified using those. And there for sure are plugins, making the whole thing a little bit faster.