Linked Questions

4 votes
2 answers
5k views

Why is the camera tilting around the z axis when I only specified x and y? [duplicate]

My goal is to program a camera to point towards the mouse cursor. I attached the following script to the Main Camera. ...
Nick B.'s user avatar
  • 143
2 votes
0 answers
750 views

OpenGL using quaternion to rotate camera to avoid gimbal lock [duplicate]

I read in many sources about using quaternion to avoid gimbal lock but I can't apply this practically in my code, so I have a camera class I want to rotate it with mouse so I have Euler angles Pitch ...
Mohamed's user avatar
  • 141
1 vote
0 answers
455 views

OpenTK Camera Rotation issue [duplicate]

I'm currently developing a 3D game engine in C# using OpenTK. I have basic game objects, and each game object has transform (translation, rotation and scaling). A game object can have components (...
user avatar
0 votes
1 answer
343 views

Why transform.Rotate(X,0,Z) rotates also Y? [duplicate]

In my game I'm trying to rotate a turret. I'm using the classic pattern: ...
stighy's user avatar
  • 397
0 votes
1 answer
183 views

The rotation along z axis is not changing to zero? [duplicate]

Code: ...
coder_86's user avatar
  • 175
0 votes
1 answer
215 views

First-person shooter -style controls [duplicate]

This is not in regard to a video game, but to a 3D model viewer someone else created and I am modifying. I would like to implement first-person -style mouse and keyboard controls in the viewer, so ...
posfan12's user avatar
  • 258
0 votes
0 answers
47 views

Combining rotation (using Quaternion* Quaternion) doesn't work as expected [duplicate]

I have fragment of code that has to rotate the camera to the direction where my cursor is as below: float yaw = mouseSensitivity.x * Input.GetAxis("Mouse X"); float pitch = mouseSensitivity.y * -...
tc07's user avatar
  • 455
0 votes
0 answers
30 views

Ortbit camera rotation multiplication order with quaternions? [duplicate]

So I switched my camera to use quaternions and the first thing I noticed is that things started to 'roll' even though I'm not using any roll values. I looked it up and I found that people suggest that ...
vexe's user avatar
  • 332
18 votes
4 answers
11k 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?
Aeodyn's user avatar
  • 371
26 votes
2 answers
6k views

Using Quaternions: What can I do with them? (without the maths)

I am a Game Developer and did not study Mathematics. So I only want to use Quaternions as a tool. And to be able to work with 3D rotation, it's necessary to use Quaternions (Or Matrixes, but let's ...
OC_RaizW's user avatar
  • 1,460
2 votes
3 answers
5k views

Combining Quaternion Rotations

I'm trying to understand Quaternions in relation to rotation and orientation. As an example in learning, I'm trying to rotate a point (e.g. at [0.7071, 0, -0.7071], on the unit sphere) about the line ...
Mark Fisher's user avatar
2 votes
1 answer
5k views

Unwanted roll when rotating camera with pitch and yaw

I have a quaternion class implementation, and when I apply this class to my objects all gone right (rotations), but I have a lot of troubles with the camera. I've been searching a lot trying to solved ...
STK Oscar's user avatar
  • 135
2 votes
1 answer
2k views

Quaternion rotation problems [duplicate]

I want to rotate my model and I have X and Y rotations. Here is my code: ...
harut9's user avatar
  • 157
3 votes
2 answers
3k views

Quaternion based camera pitch freaking out, and Z-axis drift

This is the code I use to control my (first person) camera's movement and rotation. Translation successfully keeps orientation in mind, so that up and left and such are always in the expected ...
HypnoGenX's user avatar
0 votes
1 answer
3k views

Order of rotation in Euler angles

I'm want to control the direction my camera looks, so I'm using Euler angles, so rotating around an axis is relative to rotation around previous axis. Something like this. I want to always rotate ...
Atul's user avatar
  • 101

15 30 50 per page