# Where is the origin of a loaded model?

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

## 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 on other sites
0,0,0 in your 3D modeling software should be the origin for the model.

##### Share on other sites
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 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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634087
• Total Posts
3015444
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!