PDA

View Full Version : 6DOF camera....


ktolis
2002.07.20, 05:23 PM
Hello, I am trying to implement a 6DOF camera class
has anyone a reusable class or pointers to one that works for sure(and also tested it)?

thanx

Johan
2002.07.20, 06:20 PM
Hello, I am trying to implement a 6DOF camera class
has anyone a reusable class or pointers to one that works for sure(and also tested it)?


Have you tried using google to find one? I found a whole bunch of camera sources with just a quick 15 sec search.

Yeah yeah, I know all the "use google" post are kinda boring and useless. Still, you could have found the code you were looking for during the time it took you to write the post.

Cheers,

.johan

ktolis
2002.07.21, 01:44 PM
well this was the first thing i did. the results were quite many but this is not the problem. the problem is that almost all implementations were depending on code from classes of the project they came from, or they were not designed for OpenGL usage. The best code i found was one in VB (!!!) and direct3D, which i rewrote but the code for the strafeing was messed up (or at least it was messed up when i used c++ instead of vb). Other code samples included clean but platform dependent code (ms vcpp, mfc, etc...)so i am asking if someone has a piece of code that a) works, b) does not require copying (much) code from other classes from the project it cames from, c) works without requiring platform specific api ( e.g. uses only sdl + opengl)...

inio
2002.07.21, 05:43 PM
what features exactly are you looking for? "strafing" makes it sound like you want a bit more than simple location/rotation which is all that's required by your "6DOF" requirement.

ktolis
2002.07.22, 01:48 AM
i am searching for the following features:
yaw,roll,pitch,(all the rotations) and all the transformations (strafe,move forward (the way the camera looks), move behind) and if possible rotating around a specific point (e.g. for rotating around a model).

GoodDoug
2002.07.22, 04:40 PM
Check out David eberly's sample code for Quaternions, as his are really well written and easy to understand. I've used his code before to make a 6DOF camera by always describing the camera's rotations as quaternions (avoids gimbal lock, and allows for some nice interpolation. the only thing is you have to be careful about your up vector, but that is simple enough by using constraints in your interpolation schemes (interpolation using integral minimizers is what I did, but you could proably just get away with forcing an up vector at each interpolation)

just do a Google search on Quaternion, or Eberly to find stuff.

Mutle
2002.07.23, 01:17 PM
On http://www.GameTutorials.com (in the OpenGL Tutorials Section) are very nice Tutorials dealing with a Camera Class... The OpenGL base code uses some Windows/SDL Code, but you can just have a look at the Camera Class, which is just in OpenGL.