IzumiRaito
Member
|
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 |
|
Solimo
Member
|
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 |
|
Esenthel
Administrator
|
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 |
|
IzumiRaito
Member
|
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 |
|
Esenthel
Administrator
|
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 |
|