Home › Forums › Programming › —
- This topic has 7 replies, 5 voices, and was last updated 15 years, 5 months ago by
Anonymous.
-
AuthorPosts
-
-
April 19, 2008 at 1:51 am #6690
Anonymous
Inactive—
-
April 19, 2008 at 10:48 am #40757
Anonymous
InactiveWell, the one that comes to mind straight away for OpenGL is the Nehe site, which has lots of tuts covering everything OpenGL. Url is http://nehe.gamedev.net/
-
April 19, 2008 at 3:25 pm #40759
Anonymous
InactiveObligatory post to get past first-post-can’t-have-urls thing…
-
April 19, 2008 at 3:26 pm #40760
Anonymous
Inactive… this is quite useful (as are all of the tutorials on the site):
http://www.codesampler.com/oglsrc/oglsrc_5.htm#ogl_fps_controls
-
April 20, 2008 at 11:21 am #40765
Anonymous
Inactive—
-
April 21, 2008 at 8:18 am #40771
Anonymous
InactiveWhat way are you storing your player’s orientation / viewing direction ?
If you’re using just a single angle for direction (no looking up or down – like Doom) then you can get the direction like this:
direction_x = – sin(playerAngle)
direction_y = 0
direction_z = – cos(playerAngle).. The above assumes at angle zero your player faces into the screen and that rotation is clockwise for the player. You may have to change the signs around a bit though depending on how your coordinate system or camera etc. is set up.
If you want looking up and down (pitch rotation) as well turning around (yaw rotation) then you will have to modify the equations as follows:
direction_x = – sin(playerYawAngle) * cos(playerPitchAngle)
direction_y = – sin(playerPitchAngle)
direction_z = – cos(playerYawAngle) * cos(playerPitchAngle).. This lot has the player’s head level at pitch angle = 0 and an increase in the angle will tilt the players head down towards the ground. Again you may have to tweak the signs if it doesn’t work in your app.
-
April 24, 2008 at 5:39 pm #40821
Anonymous
Inactive—
-
April 29, 2008 at 1:51 pm #40895
Anonymous
InactiveYeah I had it working with a single direction vector which worked fine. But I was trying to get it working with any vector.
I got it working in the end, I found a really great tutorial that applied to what I was doing on http://www.morrowland.com[/quote:9ced882ace%5D
Is it just me or do all these tutorial sites seem to offer the exact same tutorials.
I think you can get the red and blue books free online(not the latest revisions) now though cant remember the url off hand.
-
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.