Jump to content
  • Advertisement
Sign in to follow this  
jnmanyaga

Placing the Mesh on the ground

This topic is 4727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!