Thread: Moving a object in 3 dimensional space along its local axis

1. In a 3D space, an Object (A) is currently at the postion (x1, y1, z1). The angle of rotation of its local axis is ( ax, ay, az ).
If the next position should be (d) distance from current position along its local axis, then calculate the next position (x2, y2, z2).

In other words, a bird (A) is currently at (x1, y1, z1) and pointing in the direction ( ax, ay, az ). Move it forward for a distance (d). Find the new position (x2, y2, z2)?

In 2D it would be as easy as.
x2 = x1 + d * cos( ax );
y2 = y1 + d * sin( ay );

But in 3D it quite challenging.

Thanks  2.

3. Shouldn't you have just one angle in 2D, since, if t is your angle, (d*cost, d*sint) describes the vector the bird moved?  4. oops! Yes, just one angle in 2D.
But my problem is with 3D.  5. Originally Posted by cforcloud In a 3D space, an Object (A) is currently at the postion (x1, y1, z1). The angle of rotation of its local axis is ( ax, ay, az ).
If the next position should be (d) distance from current position along its local axis, then calculate the next position (x2, y2, z2).

In other words, a bird (A) is currently at (x1, y1, z1) and pointing in the direction ( ax, ay, az ). Move it forward for a distance (d). Find the new position (x2, y2, z2)?

In 2D it would be as easy as.
x2 = x1 + d * cos( ax );
y2 = y1 + d * sin( ay );

But in 3D it quite challenging.

Thanks
Yes, it is a little more involved in 3D. The basic idea is this : wherein the R represent rotational matrices for pitch, roll and yaw, i.e. for the rotation angles around the three spacial axis. The resultant vector will point into the right direction, and then needs to be length adjusted to correspond to your distance between the two points; finally you add this vector to your original point, which gets you to your new point. The explicit representation for these three matrices can be found here :

Rotation matrix - Wikipedia, the free encyclopedia  6. In 3D computer graphics we use homogeneous coordinates to do this sort of thing: Homogeneous coordinates - Wikipedia, the free encyclopedia  3 dimensional, local axis 