正在加载视频...

视频加载失败

With DynamicMesh coming to Roblox, I thought now would be a great time to explain something I remade recently :D Mesh Splitting! #Roblox #RobloxDev Thread🧵

43,288 次观看 • 3 年前 •via X (Twitter)

12 条评论

Dino 的头像
Dino3 年前

Triangles are usually the building blocks of meshes. So to begin, I needed to figure out how to split a single triangle. Here was a simple procedure I quickly drew out, the red line indicates a cut.

Dino 的头像
Dino3 年前

A triangle is made of three line segments. Iterating through the edges and using some algebra, we can calculate the two points that intersect a plane cut!

Dino 的头像
Dino3 年前

With the two intersections, the triangle can be split into three smaller triangles as shown in the previous diagram.

Dino 的头像
Dino3 年前

Separating the two polygons will give us a split triangle! Onwards to the third dimension.

Dino 的头像
Dino3 年前

Here I constructed a cube made of triangles. Using the same math as before, we can figure out which triangle to split, colored in blue. Yellow and red indicate non-intersecting triangles on two sides of the plane, which will be grouped later.

Dino 的头像
Dino3 年前

Calculating the intersections of the intersecting triangles like before we can separate the mesh into two groups. Looks like its all coming together!

Dino 的头像
Dino3 年前

I then filled in the mesh using Wedges since DynamicMesh hasn't been released yet. You may have already noticed, but the interior is hollow. We can't be having that :(

Dino 的头像
Dino3 年前

So to cover it up, we can use the points we calculated to find the intersection of the mesh on the plane cut.

Dino 的头像
Dino3 年前

Constructing a vertex graph, we can traverse a single cycle to fill in this polygon intersection. Why does it look so satisfying? 😋

Dino 的头像
Dino3 年前

Wrapping it all together with a touch of welding and physics.. tada! Mesh splitting!

Dino 的头像
Dino3 年前

Bonus clips: Cutting an eggdog??

Dino 的头像
Dino3 年前

How about cutting a sphere brick, slowed down?

相关视频