Sign in to follow this  
jnmanyaga

Placing the Mesh on the ground

Recommended Posts

jnmanyaga    122
I Need help on placing the mesh on the right ground/height in a mesh also implmented using a big mesh; What I meant is if i want to place the mesh at coordinate (x,y,z) then i just translate the object's world matrix at that coordinate, but my problem is placing it perfectly (like the feet or the base of the character must touch on the ground ). It somelike the point XYZ sometimes meant the center of the mesh. SO the result of the translation half of the body is bellow the scene mesh. You guys have any suggestion on how to do this?

Share this post


Link to post
Share on other sites
chaoticseedx    122
Im thinking if you know the exact measurement from the pivot point(middle of his body) to the feet you could say something like:

Hero.x = Terrain.x
Hero.y = Terrain.y + 10 (distance from pivot point)
Hero.z = Terrain.z

This is how i have done it!! or you can move the pivot point down to his feet, but im not sure how you would do that unless your using an .x mesh then in that case in the 3d prog just move the pivot to the ground at his feet!!!
:)

Hope that helps.....

`Chaoticseed

Share this post


Link to post
Share on other sites
sirob    1181
The easiest way to find out how big your mesh is would be to calculate it's bounding box. Once you have that, you can get a value indicating how far below the (0, 0, 0) point the mesh extends. Once you have that, you just offset your mesh by that amount.


Hope this helps. :)

Share this post


Link to post
Share on other sites
sirob    1181
Quote:
Original post by Pipo DeClown
Or or or or or, in the 3D modelling application, make sure you put the feet on the XZ-plane (ground).


Though, keep in mind this might cause your model's rotation axis to move.

Your turn ;).

Share this post


Link to post
Share on other sites
Pipo DeClown    804
Quote:
Original post by sirob
Yar, you win. ;)


Well.. It would suck for example when you're using physics to move dead bodies. And there are other situations where full rotation are needed, but if you're making a simple low-poly low-detail graphics game..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this