5

Is there any simple algorithm like Voronoi diagram to divide any rectangular plane to triangles, eventually, using # of pre-defined points.

To be honest, I have to write a very simple fragment shader like this.

Theoretically, this Voronoii shader could be 'upgraded' by Delaunay triangulation but wanna find the more elegant solution.

VVK
  • 435
  • 2
  • 27

2 Answers2

1

The first thing that comes to my mind is to create n random points (with specific seed) to fill a cylinder volume. The triangle points will be intersection of lines between those points and plane going through the axis of cylinder. The animation would be simply done by rotating the plane ...

I see it something like this:

cylinder

So the neighboring points should be interconnected with each other. Forming tetrahedrons that fills the volume of the cylinder. So create uniform tetrahedron grid and add random noise to the points position (with specific seed).

This whole task is very similar to rendering cross section of 4D mesh see:

As the 4D simplex is also tetrahedron. The only diference is you are in 3D and cutting by 3D plane.

Spektre
  • 49,595
  • 11
  • 110
  • 380
  • I have reverse-engineered this lovely example https://www.shadertoy.com/view/MdfBzl – VVK Jul 30 '17 at 14:55
0

You can reverse-engineer this example shadertoy.com/view/MdfBzl like I did. Thanks to mattz.

VVK
  • 435
  • 2
  • 27