Jump to content

Find Up/Down Angle of Mouselook Camera


Bash Quandry
 Share

You are about to reply to a thread that has been inactive for 4063 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am trying to find the Up and Down angle of the mouselook camera. I need to know when the camera is aiming down/up on the Y axis and at what angle. 

Currently using llGetCameraRot() I get different values depending on the direction I am facing. Sometimes down is -.5 and sometimes it is .5

 

Link to comment
Share on other sites

Worked it out yesterday, but thank you for your response :matte-motes-bashful-cute-2:. I'm gonna plug this in to see if it will work as well. We came up with...

 

vector fwd = llRot2Fwd(llGetCameraRot());vector euler = ((fwd * RAD_TO_DEG) * 3);integer angle = (integer)(euler.z);

 

Link to comment
Share on other sites


Bash Quandry wrote:

vector fwd = llRot2Fwd(llGetCameraRot());vector euler = ((fwd * RAD_TO_DEG) * 3);integer angle = (integer)(euler.z);

That is an approximation and may work OK for you.

I don't know how accurate you need it:smileysurprised::):smileyvery-happy:

Completing your idea is leading to this accurate expression:

vector fwd = llRot2Fwd(llGetCameraRot());float angle = llAsin( fwd.z)*RAD_TO_DEG;

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4063 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...