Ultimate Tricky Mesh Question of the Week

Blitz3D Forums/Blitz3D Programming/Ultimate Tricky Mesh Question of the Week

a) i'll be able to keep track of all the sliced off meshes (especially as I'll have to clip each operation twice to get each half separately)
As I understand it, you won't need the sliced off sections: as it stands, the code clips a copy of a mesh - the original mesh remains unaltered.

Having said that, as you need to perform more than one clip on a mesh, I'd optimize the code so that it actually clips the mesh passed in - this'll allow you to remove the initial code that copies the mesh. Instead, make a copy of the mesh yourself, before performing all the required clips on it.

A further optimization would be to use a proxy mesh, as I mentioned in my last post. This would mean the initial mesh to clip would be a single triangle, instead of many, as used in your main meshes.

There should be other optimizations to be had, too. For example, as these are basically 2D meshes, a constant can be used for the vertex coords of the unused dimension.

b) it will be fast enough... even with really simple meshes (~ 20 -30 tris), i wonder if it will be able to do as many as 100 or 200 clips per frame? seems like it would be asking a lot to do that and still achieve 60fps.
Well, I guess only testing will tell. :) However, I think it should be fast enough, given the optimizations I mention above. As I see it, you only need to do 3 clips when 2 meshes intersect; 6 clips when 3 intersect, etc. Also, some of those clips may actually 'miss', improving the speed of the operation.