Results 1 to 10 of 18

Thread: Direction between 2 Vectors

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Direction between 2 Vectors

    OK so i have 2 3d vector's

    the first is the camera and the second is an object i want to look at, my camera system using the mouse relative position so rot.x = rad offset from 0.

    So i've been trying to come up with a function to calculate the Radians from vec1 to vec2 and I just can't seem to get anything to work, can anyone save me from this task as my head is about to explode.

    I have the xz rotation working fine using: rV.x := ArcTan2( targ.z - posZ, targ.x - posX ); - altho sometimes it does a full rotation reversal

    but i need the y axis also to be correct, looking up or down at the object once it is facing it
    Last edited by Colin; 14-11-2012 at 12:39 PM.
    Download the Ziron Assembler
    Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.

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
  •