Skip to main content
GameDev.net gamedev.net
🔒 Locked

Math for the facing vector

Started by nachilau Oct 25, 2002 at 4:11 PM 0 replies 450+ views
Original Post
nachilau
nachilau
Hello, Currently, I am trying to create a facing vector for my 3D object in the game. However, I can never nake it works for 360d. What I have done is this, I have prset an initial facing vector for the object, and when the object rotate, let say 30d along y axis, then I transform the vector whith the rotationY matrix by -30d. It works fine for 0d to 180d, but the value of the facing vector repeat after 180s to 360d. As the result, I cannot define where my object is facing to because there are two facing vector value within 360d. Can anyone suggest any solution on how to uniquely determine the facing vector within 360d? Thanks! Nachi
Nachi Lau (In Christ, I never die)www.sky-dio.com/Nachi
Zipster
Zipster
While it is true that certain quadrants will have equal sign values for particular coordinates, each quadrant will have its own unique sign pattern for the XYZ vector values (i.e +++, ---, +-+, --+, etc.), so there shouldn't be any ambiguity as to where your vector is facing if you have all three values.

[edited by - Zipster on October 26, 2002 2:33:17 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.