If I have a mesh, how can I take the very bottom-most polygon and use that to set the rest of the mesh to the ground? Just like if I take a player model and put his feet on the ground.
A trick I’ve used in the past is to take the bounding box for the mesh, find the min Y value, and use that to adjust the position of the character.
If you need to get fancy you can:
- Loop over the triangles in the mesh
- Calculate the centroid and normal for each triangle
- Take the lowest centroid in the Y axis, use this to position the character.
- Use the associated normal to rotate the character.