Results 1 to 3 of 3

Thread: Move in a 3D Line, 2points

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Move in a 3D Line, 2points

    Alright, I have a camera at point (-50,-50,-50)
    I want it to move at a certain rate to (50,75,100);

    But I want it to ratio its movement as to arrive at that destination in a line.

    How do I walk the line between those two points.

    An example would be great.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Never worked in 3D, but to get the values I think you just need the difference in each D (like: (50-(-50),75-(-50),100-(-50)). That would be the total vector, to make a move along this vector(or line) just divide it in your neccessary steps.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  3. #3
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703
    dx = k(50 - -50)
    dy = k(75 - -50)
    dz = k(100 - -50)

    where k is some constant that you choose to determine the camera speed.

    Each tick the camera advances dx in the x-dir, dy in y-dir, etc.
    an ending

Posting Permissions

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



Click Here to Expand Forum to Full Width