# Placing the Mesh on the ground

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

## 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 on other sites
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 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 on other sites
Or or or or or, in the 3D modelling application, make sure you put the feet on the XZ-plane (ground).

##### Share on other sites
Quote:
 Original post by Pipo DeClownOr 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.

##### Share on other sites
Don't rotate your model? (only around the Y-axis)

Yar, you win. ;)

##### Share on other sites
Quote:
 Original post by sirobYar, 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..

1. 1
2. 2
Rutin
20
3. 3
khawk
16
4. 4
A4L
14
5. 5

• 11
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633755
• Total Posts
3013706
×