Home › Forums › Programming › —
- This topic has 7 replies, 5 voices, and was last updated 16 years ago by Anonymous.
-
AuthorPosts
-
-
19/04/2008 at 1:51 am #6690AnonymousInactive
—
-
19/04/2008 at 10:48 am #40757AnonymousInactive
Well, 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/
-
19/04/2008 at 3:25 pm #40759AnonymousInactive
Obligatory post to get past first-post-can’t-have-urls thing…
-
19/04/2008 at 3:26 pm #40760AnonymousInactive
… this is quite useful (as are all of the tutorials on the site):
http://www.codesampler.com/oglsrc/oglsrc_5.htm#ogl_fps_controls
-
20/04/2008 at 11:21 am #40765AnonymousInactive
—
-
21/04/2008 at 8:18 am #40771AnonymousInactive
What 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.
-
24/04/2008 at 5:39 pm #40821AnonymousInactive
—
-
29/04/2008 at 1:51 pm #40895AnonymousInactive
Yeah 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.