Viewing Transformations, Web GL




CS185c

Chris Pollett

Feb 25, 2019

Outline

Introduction 1

Introduction 2 - Big Picture

Viewing Transformations

Specifying an Eye what an eye is Looking At

An Eye in a VR Scene

Orthographic Projection

Perspective Projection

Perspective Projection

Quiz

Which of the following statements is true?

  1. We said any 3D-translation of a point `vec{p}=(x,y,z)` can be specified using a `3 times 3`-matrix multiplied against `vec{p}^T`.
  2. Rotations in 2D can be viewed as a multiplication with a complex number of unit length; any rotation in 3D can be specified using a unit quaternion `q` and the operation `vec v mapsto q vec v q^{-1}`.
  3. It is possible to have a 3D rotation that does not fix an axis of rotation.

Chaining Transformations

Canonical View Transform

Viewing Frustum

Getting a Canonical View Matrix

Keeping Track of Depth

Additional Translation and Scaling

Transformed Frustum

Viewport Transform

Left and Right Eyes

WebGL and WebVR

WebGL Cube Demo

Rotating WebGL Cube

[Test Out Cube Demo]