LWJGL
May 21, 2012, 01:25:37
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
LWJGL 2.8.3 released!
Home
Help
Search
Login
Register
LWJGL
>
Programming
>
OpenGL
>
opengl rotation basics?
Pages: [
1
]
« previous
next »
Print
Author
Topic: opengl rotation basics? (Read 3851 times)
amoeba
Regular nerd
Posts: 56
opengl rotation basics?
«
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
Re: opengl rotation basics?
«
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
Logged
amoeba
Regular nerd
Posts: 56
Re: opengl rotation basics?
«
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
Re: opengl rotation basics?
«
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
Re: opengl rotation basics?
«
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
Re: opengl rotation basics?
«
Reply #5 on:
September 22, 2007, 06:20:25 »
Yup. That's correct
Rotation is anti-clockwise.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Programming
-----------------------------
=> Lightweight Java Library Game Development
=> LWJGL Documentation
=> Bug Reports / RFE
=> OpenGL
=> OpenAL
=> General Java Game Development
-----------------------------
Archive
-----------------------------
=> Resolved Bugs/RFE
=> DirectX
=> DevIL
=> FMOD
Loading...