MiguelP
MiguelP

Reputation: 502

Implementing Camera Movement and Rotation in 3D Game Engine

Apologies in advance for any mistakes on terminology, I'm really really new to this

I'm completely new to 3d (and it's maths) but as a personal exercise I'm doing my own game engine that displays a simple wireframe.

I've implemented rotate (x, y and z), orthogonal, isometric, perspective projection matrices (column major) and a look_at function.

I've got a list of points and my rudimentary pipeline (on keypress) is as follows:

  1. get original points
  2. scale
  3. rotate_x
  4. rotate_y
  5. rotate_z
  6. look_at(cam,target,up)
  7. projection
  8. translate to centre of the window It works fine with hardcoded camera and target coordinates

However I want to be able to:

  1. move the camera up/down/left/right in the same plane I'm currently at.
  2. To be able to rotate that plane around the z axis
  3. and to bring the plane the camera is closer or farther from the z axis But I have no Idea how to do that. (quaternions or matrices)

The reason I want to rotate around the z axis and not the y is because I haven't implemented any coordinate system and the hardcoded camera and target values are for an isometric projection.

How can I do this?

Upvotes: 0

Views: 302

Answers (0)

Related Questions