Camera Translations: Find Translation & Rotation

  • Context: Undergrad 
  • Thread starter Thread starter _Nate_
  • Start date Start date
  • Tags Tags
    Camera
Click For Summary
SUMMARY

The discussion focuses on implementing a camera system in a physics game engine that utilizes translation vectors and quaternion rotations. The user seeks to create a function similar to gulLookAt, which requires three vectors: the camera's position, the target look-at point, and the up vector. To compute the necessary translation and rotation, the user is advised to adopt a Cartesian coordinate system and utilize rotation matrices. Understanding these mathematical concepts is essential for achieving the desired camera functionality.

PREREQUISITES
  • Understanding of translation vectors in 3D space
  • Knowledge of quaternion mathematics for rotation
  • Familiarity with Cartesian coordinate systems
  • Basic concepts of rotation matrices
NEXT STEPS
  • Study quaternion mathematics and its applications in 3D graphics
  • Learn about rotation matrices and their role in transforming 3D objects
  • Research the implementation of camera systems in game engines
  • Explore the gulLookAt function and its mathematical foundations
USEFUL FOR

Game developers, graphics programmers, and anyone interested in implementing camera systems in 3D environments.

_Nate_
Messages
19
Reaction score
0
I'm making a physics game engine, and I have some decent camera functionality.

Essentially, the camera has a translation (vector) and a rotation (quaternion), and functions exist to easily move the camera along any of seven degrees of freedom (pitch, yaw, roll, strafe, elevate, move, zoom), which all works nicely.

I would like to make a function that allows the camera to go wherever you specify with ease. Essentially, it would work like gulLookAt: you would give the function a camera and three vectors. The first is where the camera should be, the second is where the camera should look, and the third is the up vector.

Given these three vectors, how can I determine the translation (vector) and rotation (quaternion) of my camera? I don't know the math to do this.
 
Physics news on Phys.org
The beginning of every problem is to structure it, and convert it into something computable. Choose a Cartesian coordinate system with the camera at the origin. Then determine what you have (current look etc.) and what you want to achieve. If it is only a transformation in space, then you can use a series of rotations in space. It will be difficult without math, so just look at the corresponding Wikipedia article (rotation matrix) and see if it helps you.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 1 ·
Replies
1
Views
9K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K