Grouping Vertices

   2166   2   1
User Avatar
Member
51 posts
Joined: July 2005
Offline
I'm trying to programmatically create groups from a large mesh, that contain 65536 vertices each, to bring them into Unity for terrain creation.

We have a Python script that can create groups by boudning box, but can't detect how many vertices are within itself so it could divide the box into multiple.

Anybody have a suggestion or a different approach we should take?
User Avatar
Member
1799 posts
Joined: Oct. 2010
Offline
how evenly broken up is your terrain mesh? I assume if you are trying to partition by boxes that your terrain mesh is pretty even?

if your mesh is all tris, it may actually be easier to figure out how many triangles you would have per partition, and divide by primitives (as you will have unshared points with identical positions in order to partition your terrain without gaps). Then you can build an iterative partition system using a foreach with a feedback loop which starts from a seed position, traces the closest primitives from that position, groups them, eliminates them from the next iteration, then the seed position moves to a new position closest to the start seed position

This would only be necessary though if you need your partitions to be EXACTLY 65536 vertices if you could get away with some give or take, and your triangulation is even, you could simply calculate the total area of a partition, and use a grid to create an attribute to transfer to each triangle. You could also break up evenly, then simply remesh each partition to total 65536 (using a remesh SOP). The latter approaches would be faster as they have more potential for multithreading, but wont be as precise on the vertex count as an iterative build up approach
-G
User Avatar
Member
51 posts
Joined: July 2005
Offline
Hey Gianni,

thanks for the reply, actually the terrain is very uneven, the reason we're going with boxes right now is because I haven't been able to figure out another elegant way of doing it (it's been a very long time since I actually did some serious work in Houdini myself ;-) ).

We do have some leeway with vert count as long as they go over 65536, I can be below that. The reason we're trying to create the groups, is when you bring in a mesh into Unity that has more then 65536 verts, Unity will break that mesh up and we lose control over how it is broken up.

I hope that makes sense.

cheers

Andre
  • Quick Links