Hello,
I am trying to change XYZ of a point according to a direction vector.
Any idea how can I do that?
Direction Vector Problem
The description of exactly what you want to do isn't all that clear.
If you have coordinates ( px, py, pz ) and a normalized direction vector ( dx, dy, dz ), the new point = ( px + s*dx, py + s*dy, pz + s*dz ), where s is the distance you want to move.
If you have coordinates ( px, py, pz ) and a normalized direction vector ( dx, dy, dz ), the new point = ( px + s*dx, py + s*dy, pz + s*dz ), where s is the distance you want to move.
I have already done what you told me.
But this game is a bit "gay" The directions are strange, I don't know.
If I start the game and my direction vector is (1,0,0), if i turn around my vehicle of 360°, that vector should be the same(1,0,0), shouldn't it?
BUT IT IS NOT it's (-1,0,0)
I have to turn 720° to get that again (1,0,0)
But this game is a bit "gay" The directions are strange, I don't know.
If I start the game and my direction vector is (1,0,0), if i turn around my vehicle of 360°, that vector should be the same(1,0,0), shouldn't it?
BUT IT IS NOT it's (-1,0,0)
I have to turn 720° to get that again (1,0,0)
But this game is a bit "gay" The directions are strange, I don't know.
Seems like your rotation code is screwed up. My random guess? most trig functions take radians not degrees. Maybe that is whats wrong?
It's very strange this game, it's German Truck Simulator, using ODE.
Some other objects in the game, have normal vector directions.
Some other objects in the game, have normal vector directions.
Sorry for dpost.
I understood that if i subtract the first value of my vector (a, 0, -> a-b = right cos and sin
Any more ideas?
I understood that if i subtract the first value of my vector (a, 0, -> a-b = right cos and sin
Any more ideas?
Erm, Q-Circles again so soon, read: somewhere (and wrongly) using quaternions ?
That was just a far reached guess. Could you shed some more light by providing code, please ?
That was just a far reached guess. Could you shed some more light by providing code, please ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement