Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6173211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:31:56+00:00 2026-05-23T23:31:56+00:00

I am using glLookAt to control my camera view. I use the following code

  • 0

I am using glLookAt to control my camera view.

I use the following code to rotate around.

SPEED_TURN is a Const of 0.16 (speed we turn at)

GLfloat v[] = {[self centerAtIndex:0] - [self eyeAtIndex:0],
    [self centerAtIndex:1] - [self eyeAtIndex:1], 
[self centerAtIndex:2] - [self eyeAtIndex:2]}; 

[self setCenter:[self eyeAtIndex:0] + cos(SPEED_TURN / 2)*v[0] - sin(SPEED_TURN / 2)*v[2] atIndex:0];
[self setCenter:[self eyeAtIndex:2] + sin(SPEED_TURN / 2)*v[0] + cos(SPEED_TURN / 2)*v[2] atIndex:2]; 

My question is, how to I get the angle of the camera in degrees?

I tried this

rotAngleDegs = (cos(-SPEED_TURN)*v[0] - sin(-SPEED_TURN)*v[2]) * 180 / PI

However that give numbers from -620 to +620

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:31:57+00:00Added an answer on May 23, 2026 at 11:31 pm

    I don’t think you are trying the right functions to give you the angle. The functions “cos()” and “sin()” both take your angle and map it to [-1,1]. If SPEED_TURN is the angle in radians, then you would just use:

    float angleInDegrees = (SPEED_TURN * 180) / M_PI;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code produces the image that follows. The image I am using for
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I'm working on a homework assignment to modify code given by my professor using
Using the following as an example (with $db being a previously created database connection
I'm using a Perspective View with gluPerspective and gluLookAt and I have the x,y
I'm trying to use gluLookAt to move the camera in my iPhone game, but
I'm having some troubles converting a orthogonal camera to a perspective one, using OpenGL.
I have a car moving around an elliptical track on OpenGL. The top-down view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.