Direction Vector Problem

Started by
6 comments, last by OvidiuPop_179073 13 years, 1 month ago
Hello,
I am trying to change XYZ of a point according to a direction vector.
89241639.jpg


Any idea how can I do that?
Advertisement
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.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

I have already done what you told me.

But this game is a bit "gay" laugh.gif 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" laugh.gif 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.
Sorry for dpost.

I understood that if i subtract the first value of my vector (a, 0, B) -> 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 ?
Well, the code just Reads process memory and writes.

I have problems understanding how to get a normal vector direction :(

This topic is closed to new replies.

Advertisement