Hi! Long time no see! ![]()
I’m back with my latest project. I’ve been working on a function that can generate a polygon at runtime using only three 3D points (x, y, z).
Here how it work:
In DelightX, there’s a block type called Frustum4, which can be used to create an isosceles triangle. By combining four isosceles triangles, we can reconstruct any arbitrary triangle (and therefore build polygons).
The main challenge was calculating the correct position, size, and rotation for each isosceles triangle. To solve this, I calculate the triangle’s altitude (the perpendicular from a vertex to the opposite edge), along with several edge midpoints and other geometric relationships. From these calculations, I can determine the exact transform for each of the four isosceles triangles, allowing them to perfectly reconstruct the original triangle, as shown in the image.
This technique can be used in many different kinds of projects, such as generating smooth terrain when combined with Perlin noise, creating soft-body physics, procedural meshes, and much more. I hope you enjoy this project, and I’d love to see what you create with it. Feel free to remix it and share your results!

