To blow stuff up real good, it would be interesting to have a function that bisects a mesh along some random plane, leaving you with two meshes. Then you can do it again on each half, etc. In conjunction with particles this could enliven those explosions with unique chunks of stuff flying around.
Is there a function out there already? I couldn't find one.
an example in partial pseudocode:
Of course triangles have to by moved as well.
The problem is the exposed area of both meshes; if the object is hollow (like a car or tank, for example) then a copymesh()/flipmesh() could be the easiest solution. If it is a rock, however, you have to create new triangles between assorted existing vertices, which I don't want to do if it's been done already.
Hence my question here today.
Thanks in advance.
Is there a function out there already? I couldn't find one.
an example in partial pseudocode:
function bisectmesh(oldmesh) origpitch#=entitypitch(oldmesh) origyaw#=entityyaw(oldmesh) origroll#=entityroll(oldmesh) ;The above is so we can move it back when we're done my#=entityy(oldmesh); rotateentity(oldmesh,rnd(360),rnd(360),rnd(360)) newmesh=CreateMesh() for each vertex: if VertexY(...) < my# then move this vertex to the new mesh next ... end function
Of course triangles have to by moved as well.
The problem is the exposed area of both meshes; if the object is hollow (like a car or tank, for example) then a copymesh()/flipmesh() could be the easiest solution. If it is a rock, however, you have to create new triangles between assorted existing vertices, which I don't want to do if it's been done already.
Hence my question here today.
Thanks in advance.