Home Forums Programming

Viewing 7 reply threads
  • Author
    Posts
    • #6690
      Anonymous
      Inactive

    • #40757
      Anonymous
      Inactive

      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/

    • #40759
      Anonymous
      Inactive

      Obligatory post to get past first-post-can’t-have-urls thing…

    • #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

    • #40765
      Anonymous
      Inactive

    • #40771
      Anonymous
      Inactive

      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.

    • #40821
      Anonymous
      Inactive

    • #40895
      Anonymous
      Inactive

      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.

Viewing 7 reply threads
  • The forum ‘Programming’ is closed to new topics and replies.