Notices
Results 1 to 5 of 5

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

  1. #1 Moving a object in 3 dimensional space along its local axis 
    New Member
    Join Date
    May 2012
    Posts
    2
    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


    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Freshman
    Join Date
    Feb 2012
    Posts
    10
    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?


    Reply With Quote  
     

  4. #3  
    New Member
    Join Date
    May 2012
    Posts
    2
    oops! Yes, just one angle in 2D.
    But my problem is with 3D.
    Reply With Quote  
     

  5. #4  
    Moderator Moderator Markus Hanke's Avatar
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    7,302
    Quote Originally Posted by cforcloud View Post
    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
    Reply With Quote  
     

  6. #5  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    17,036
    In 3D computer graphics we use homogeneous coordinates to do this sort of thing: Homogeneous coordinates - Wikipedia, the free encyclopedia
    ei incumbit probatio qui dicit, non qui negat
    Reply With Quote  
     

Similar Threads

  1. Releasing the object from Space Elevator
    By Eagle9 in forum Astronomy & Cosmology
    Replies: 5
    Last Post: July 6th, 2011, 01:45 PM
  2. Replies: 3
    Last Post: March 29th, 2010, 02:16 PM
  3. 11 DIMENSIONAL SPACE
    By KALSTER in forum Astronomy & Cosmology
    Replies: 11
    Last Post: October 1st, 2007, 06:38 PM
  4. effects of mass increase of a moving object
    By dejawolf in forum Physics
    Replies: 10
    Last Post: June 14th, 2007, 11:01 PM
  5. Replies: 2
    Last Post: August 25th, 2005, 11:07 AM
Tags for this Thread

View Tag Cloud

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •