Simple OpenGL based Camera Class

12,389

Solution 1

Have you tried http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=Quaternion_Camera_Class?

Solution 2

Since I'm not sure about the question, I'm going to tentatively answer with a tutorial of mine :

http://www.opengl-tutorial.org/beginners-tutorials/tutorial-6-keyboard-and-mouse/

(source code here)

Hope that helps. If it does not completely fulfills your needs, don't hesitate to explain exactly what is wrong, and I'll edit my post.

Share:
12,389
Jared Krumsie
Author by

Jared Krumsie

Updated on July 15, 2022

Comments

  • Jared Krumsie
    Jared Krumsie almost 2 years

    I'm looking for a simple yet complete camera implementation (library) for OpenGL. My use case is rendering volumetric models - which I'm visualizing with glut. But my current camera implementation is a bit buggy.

    After googling I found a few implementations such as those found in NeHe however they don't have all the functionality I'm after, specifically:

    1. Left, Right
    2. Strafe
    3. Rotation about viewing axis
    4. Arbitrary translation of viewing point

    Any DirectX solutions that can be easily converted into OpenGL will also be appreciated.

  • Jared Krumsie
    Jared Krumsie almost 13 years
    Yes, i don't believe it supports rotations about the viewing axis. I'm not really good at math, so i was hoping for an all-in-one solution - it seems like such a common problem.
  • datenwolf
    datenwolf almost 13 years
    @Jared: Of course it can do it. The viewing axis is the camera local Z axis, and CreateFromAxis angle operates on the local frame.
  • Meep
    Meep over 10 years
    This page no longer exists, maybe there is an updated link?