LWJGL
May 21, 2012, 01:25:37 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: opengl rotation basics?  (Read 3851 times)
amoeba
Regular nerd
**
Posts: 56


« on: September 21, 2007, 03:33:43 »

My Math.todegrees(Math.atan2(y,x)) function seems to be setting 0 degrees to 3 o'clock. Is this right? Also I think its anti-clockwise.

Or is it just my gluLookat code thats wrong?
Logged
Kavi
Newbie
*
Posts: 7


« Reply #1 on: September 21, 2007, 10:21:22 »

Not sure what you mean - or what you're using it for, but normally "3 o'clock" equals 0 degrees on the unit circle. That is horizontal going right in a 2d cartesian coordinate system (ie. the vector (1, 0)).

And if I completely misunderstood, then.. well i tried Cheesy
Logged
amoeba
Regular nerd
**
Posts: 56


« Reply #2 on: September 21, 2007, 13:30:47 »

Yes I think you've answered my question - 0 degrees rotation = 3 o'clock.

Seems weird to me, 0 degrees should be 12 o'clock!
Logged
Kavi
Newbie
*
Posts: 7


« Reply #3 on: September 21, 2007, 17:41:52 »

Well yes if you think of it as a clock 12 o'clock makes more sense, but I think it was defined with the cartesian coordinates in mind, with the x-axis being the 1st axis and the y-axis being the 2nd. Hence you start your degrees-measurement at (1,0) rather than (0,1) - 12 o'clock. So there is some method to the madness ^^
Logged
amoeba
Regular nerd
**
Posts: 56


« Reply #4 on: September 22, 2007, 03:11:55 »

Thanks.

Should 6 o'clock be 270 or 90? Mine seems to be 270 - i.e. direction angle increments anti-clockwise.
Logged
Kavi
Newbie
*
Posts: 7


« Reply #5 on: September 22, 2007, 06:20:25 »

Yup. That's correct Smiley
Rotation is anti-clockwise.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!