About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
Transformation a point to an object's frame of reference
Author Message
IzumiRaito Offline
Member

Post: #1
Transformation a point to an object's frame of reference
Hello i need to transform one object (let's call it A) position from global frame of reference to another object's (let's call it B) frame of reference.
Is Vec newPos = A->pos() / B->matrix() the right way?
A->pos()* ~B->matrix() seems to have similar results
02-08-2011 06:12 PM
Find all posts by this user Quote this message in a reply
Solimo Offline
Member

Post: #2
RE: Transformation a point to an object's frame of reference
I have similar problem. Im not sure about certain thing. What matrix contained in every object transforms. Local to Global, Global to Local. Local to Global with scaling, Global to Local with scaling.

If We want transform object B into local space of object A (forward of A is Z axis and A is in (0,0,0)) should i go like this?

Vec localB= B->pos();
localB -= A->pos();
localB= localB.mul(~A->matrix());
02-08-2011 07:19 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Transformation a point to an object's frame of reference
(02-08-2011 06:12 PM)IzumiRaito Wrote:  Hello i need to transform one object (let's call it A) position from global frame of reference to another object's (let's call it B) frame of reference.
Is Vec newPos = A->pos() / B->matrix() the right way?
A->pos()* ~B->matrix() seems to have similar results

yeah, that's the same thing
02-08-2011 08:36 PM
Find all posts by this user Quote this message in a reply
IzumiRaito Offline
Member

Post: #4
RE: Transformation a point to an object's frame of reference
And considering that the object is derived from Game::Obj, what is the scale?
02-08-2011 08:54 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Transformation a point to an object's frame of reference
That depends on the class of the object. You need to check comments on matrix method for different classes. For most classes scale of matrix method should be normalized
02-09-2011 08:40 AM
Find all posts by this user Quote this message in a reply
Post Reply