1
vote
1answer
99 views

How do I create a camera?

I am trying to create a generic camera class for a game engine, which works for different types of cameras (Orbital, GDoF, FPS), but I have no idea how to go about it. I have read about quaternions ...
0
votes
1answer
97 views

Strange quaternion camera streching in WebGL

So after a lot of researching about quaternions I almost got the quaternion camera working. Almost, cause it rotates in a proper way only in a vertical axis. Other rotations stretches and deforms the ...
0
votes
1answer
274 views

How to get plane rotation by known normal vector

I have a FPP quaternion Camera and Plane with known normal vector. I want to find the orientation of this Plane so I can replace it to the Camera orientation to put the camera forward vector to a ...
0
votes
1answer
750 views

Quaternion LookAt for camera

I am using the following code to rotate entities to look at points. glm::vec3 forwardVector = glm::normalize(point - position); float dot = glm::dot(glm::vec3(0.0f, 0.0f, 1.0f), forwardVector); ...
1
vote
1answer
348 views

Quaternions, Axis Angles and Rotation Matrices. Which of these should I use for FP Camera?

After 2 weeks of reading many math formulas and such I know what is a Quaternion, an Axis Angles and Matrices. I have made my own math libary (Java) to use on my game (LWJGL). But I'm really confused ...
1
vote
2answers
206 views

Accumulating rotations for camera

It seems there are three ways to store a camera's rotation: in angles, view matrix or quaternion. I was using euler angles since when I used a matrix it had a tendency to accumulate rounding errors ...
2
votes
1answer
424 views

Finding a suitable axis-angle to avoid gimbal lock

In OpenGL the camera faces the -z axis with the +y axis pointing up. I am using quaternions to represent the orientation of my objects (which works well) and am trying to do the same for the camera. I ...
7
votes
3answers
2k views

How to keep my Quaternion-using FPS camera from tilting and messing up?

I am using an FPS-like camera, and it uses quaternions. But, whenever I try looking up and then sideways, it tilts, and sometimes it can turn upside down. How can I fix this?
3
votes
1answer
271 views

Smooth Camera Offsets

I am attempting to implement a sort of, smooth camera that has angle offsets from the player as they turn, creating a cinematic effect as well as visual feedback for when the player turns. Here is an ...
2
votes
2answers
947 views

Why is my quaternion camera rotating around strange axes?

I can't get it to work for the life of me. Its rotating the camera in the global coordinate system, or some other random coordinate system, not the camera local coordinate system. WASDEC work ...
13
votes
3answers
5k views

How do I implement a quaternion based camera?

UPDATE The error here was a pretty simple one. I have missed a radian to degrees conversion. No need to read the whole thing if you have some other problem. I looked at several tutorials about this ...
1
vote
2answers
518 views

OpenGL Camera causes spatial distortion

I'm trying to implement a 3D camera of the "Orbit around the origin" variety in a game engine I'm developing in order to learn about 3D graphics and game programming. I have a basic handle on the ...