Original Post
Hi,
I understand the differrence between points and vectors, and each one in local and world space.
I also thought i had all the math. But i have a some situations where i dont really understand the results.
Lets say we have an object in (5,0,0) (world position). Lets name it "Player"
And we have another one in (10,5,2) (world position). Lets name it "Enemy".
And we want to transform Enemy into its respective points and vectors of world and local/object space of Player.
No rotation and no scale.
So its easy, and we get this results:
Local Point ( 5, 5, 2)
Global Point (15, 5 , 2)
Local Vector (10, 5, 2)
global ( 10, 5, 2 ).
I think so far no problems. I understand the logic.
Now we rotate our player 90 degrees around Y-axis. And want to get the same.
So, the rotation of 90 degrees gives us (0,0,-5). (player * rotationAroundYmatrix) and (2,5,-10) (enemy * rotAroundYMatrix)
So now we get something like this:
Local Point ( -2,5,5)
Global Point ( 7,5,-10)
Local Vector (-2, 5, 10 )
Global Vector (2,5, -10)
My question is. Why?
1.- How do we decide the signs? For example, I now that (10,5,2) becomes (2,5,-10) when rotate by 90 degrees.
So we use that numbers to get the results.
For example, we can use ( 2,5,-10) + (5,0,0) to get the global point (7,5,-10).
I can get the combinations needed to get the results. What i dont understand is.. Why?
For example, i think that for getting the Local Point we use(-2,5,10) - (0,0,-5) to get (-2,5,5). But i really dont understand why.
Whats the math for getting those results an why?
A little help would be appreciated.
thank you!!
I understand the differrence between points and vectors, and each one in local and world space.
I also thought i had all the math. But i have a some situations where i dont really understand the results.
Lets say we have an object in (5,0,0) (world position). Lets name it "Player"
And we have another one in (10,5,2) (world position). Lets name it "Enemy".
And we want to transform Enemy into its respective points and vectors of world and local/object space of Player.
No rotation and no scale.
So its easy, and we get this results:
Local Point ( 5, 5, 2)
Global Point (15, 5 , 2)
Local Vector (10, 5, 2)
global ( 10, 5, 2 ).
I think so far no problems. I understand the logic.
Now we rotate our player 90 degrees around Y-axis. And want to get the same.
So, the rotation of 90 degrees gives us (0,0,-5). (player * rotationAroundYmatrix) and (2,5,-10) (enemy * rotAroundYMatrix)
So now we get something like this:
Local Point ( -2,5,5)
Global Point ( 7,5,-10)
Local Vector (-2, 5, 10 )
Global Vector (2,5, -10)
My question is. Why?
1.- How do we decide the signs? For example, I now that (10,5,2) becomes (2,5,-10) when rotate by 90 degrees.
So we use that numbers to get the results.
For example, we can use ( 2,5,-10) + (5,0,0) to get the global point (7,5,-10).
I can get the combinations needed to get the results. What i dont understand is.. Why?
For example, i think that for getting the Local Point we use(-2,5,10) - (0,0,-5) to get (-2,5,5). But i really dont understand why.
Whats the math for getting those results an why?
A little help would be appreciated.
thank you!!