Sign in to follow this  
WaveMax

Object position relative to another object

Recommended Posts

Hello to all, maybe it's a silly question, but looking through the forum I wasn't able to find an answer. I'm using managed DirectX 9 and I simply draw some boxes (Mesh->Box()) Now... I want to be able to obtain (and set) the position of a some objects relative to another object... The main object is a box called Page, other boxes are smaller and must be collocated inside the Page. How can I specify some axis relative so I can get the position (possibly in mm) of the objects inside the page? Sorry for my english...

Share this post


Link to post
Share on other sites
You're using a world matrix for the position/rotation of every object. Now if you want to have an object relative to another, concatenate the world transform matrix for that object with its parent. With matrices this is just a multiplication.

Take in account that the order of multiplication with matrices does matter!

Share this post


Link to post
Share on other sites
Thank you for you reply.
My problem is not matrix multiplication, but how can I set the origin of the Page object?

I want it to be in a particular place, I'm going to have a large number of pages (60-100).

And I'd also like to have some grid on it...

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