The camera
Download
1 / 17

The Camera - PowerPoint PPT Presentation


  • 111 Views
  • Uploaded on

The Camera. Course Information CVG: Programming 4 My Name: Mark Walsh Website: www.activehelix.co.uk/courses Recommended Reading Introduction to 3D Game Programming with DirectX 9.0 (Frank D. Luna). Re-Cap. Local Space World Space View Space. Local Space. World Space. View Space.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'The Camera' - kale


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
The camera
The Camera

Course Information

  • CVG: Programming 4

  • My Name: Mark Walsh

  • Website: www.activehelix.co.uk/courses

    Recommended Reading

  • Introduction to 3D Game Programming with DirectX 9.0 (Frank D. Luna)


Re cap
Re-Cap

  • Local Space

  • World Space

  • View Space





The camera

  • Flexible Camera Class

  • Objective is to build a flexible FP based games camera: Flight Simulators and Shooters

  • The first stage is camera design


Camera design
Camera Design

  • The camera position is defined relative to the world coordinate system using 4 vectors

  • Right, Up, Look, Position

  • They define a local coordinate system relative to the world coordinate system



The camera


Camera operations
Camera Operations in the world

  • Using the 4 vectors we wish to be able to:

  • Rotate around the right vector or X axis (Pitch)

  • Rotate around the up vector or Y axis (Yaw)

  • Rotate around the look vector Z axis (Roll)

  • Strafe along the right vector

  • Fly along the up vector

  • Move along the look vector


Implementation
Implementation in the world

  • We calculate the view matrix using the camera vectors

  • Remember that view space transforms the geometry in the world…

  • …so that the camera is centred at the origin and the axes are aligned with the major coordinate axes


Rotation about arbitrary axis
Rotation About Arbitrary Axis in the world

  • Pitch

  • Yaw

  • Roll


Rotation
Rotation in the world

  • D3DXMatrixRotationAxis

  • Angle in Radians to Rotate

  • Rotate around arbitrarily defined vector


Walking strafing flying
Walking, Strafing, Flying in the world

  • Walking = Moving along the Look vector

  • Strafing = Moving along the Right vector

  • Flying = Moving along the Up Vector


The camera


The camera

The End in the world