Skip to main content
gamedev.net
🔒 Locked

Translation question

Started by middy Nov 17, 2004 at 2:32 PM 1 replies 500+ views
Original Post
middy
middy
Well I have several objects from one coordinate system I want to display in another coordinate system. With same relative distance to a reference point. Said in another way. I have objects in the world coordinate system, that I want to display in another coordinate system. The reference point and the objects are all in world coordinates. Pseudo code: PushMatrix(); //draw reference point at (0,0,0) loadIdentity() draw(); for all relative points draw with relative distance and direction to reference point, but in some other scale. PopMatrix(); But how do I do this. How do I translate the objects to my little local coordinate system
wendigo23
wendigo23
You have object a (transform A in world space) and object b (transform B in world space). a's transform relative to b is B^-1 * A.
middy
middy
I am not too sure I get you.

But let me try this.


TranslateTo(A);
draw(A);
matrix model = getModelViewMatrix();


vector b' = transform(model,B)
TranslateTo(b');
draw(b);

Something like this?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.