Jump to content
  • Advertisement
Sign in to follow this  
homer_3

Where is the origin of a loaded model?

This topic is 3725 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

If I load in a model in the .X file format and put it in the world at X,Y,Z, where is the origin point on the model. Does it depend? Is that info in the .X file somewhere? For example, in a 2D world, when a graphic is placed and you put it at X,Y, the top left corner of the graphic is placed at X,Y. How does this work in a 3D world since there are multiple top left corners?

Share this post


Link to post
Share on other sites
Advertisement
Im not a user of .x, but I would guess the orgin of the model is (0,0,0) of the objects local space, which could be under the models feet, the middle of a soccer ball, it depends on how/where the model was constructed in the program, what the object is, and what its used for. I get the sense you didnt make the model or have it made a certain way, so it depends on where the creator placed it.
Human characters usually have the orgin under their feet, so when you translate for movement, it would slide along the ground, you would also animate, making it look like its walking, thats the idea. Depends on what the model actually is, humans walk/run mostly, so under the feet makes sense.

Share this post


Link to post
Share on other sites
It depends on how the object is centered in your modeler.
If you have a cube that has its left-top-front vertex set to (-50, 50, 50) and it's right-bottom-back vertex to (50, -50, -50) then the center of the cube would be at (0, 0, 0).
But if you place the first point mentioned at (-100, 100, 100) then the one in the back would be placed at (0, 0, 0). The real center of the cube would then be at (-50, 50, 50). Your D3Dapp though would assume (0, 0, 0) is the center and rotate the cube around that point.

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!