8.Viewing
[prev][next]
--- ############## Start of file ############## ----

Relationship among coordinate systems. The matrix underneath each stage determines the transformation applied at that stage for the perspective and parallel projections.



Workstation Transformation

(window to viewport mapping)

Projection coordinates
-1 <= x <= 1, -1 <= y <= 1, 0 <= z <= 1

Need device coordinates
xdmin <= x <= xdmax, ydmin <= y <= ydmax


Workstation Transformation

(window to viewport mapping)

Projection coordinates
-1 <= x <= 1, -1 <= y <= 1, 0 <= z <= 1

Need device coordinates
xdmin <= x <= xdmax, ydmin <= y <= ydmax

Steps:

1. Translate lower left corner to origin: T(1,1,0)


Workstation Transformation

(window to viewport mapping)

Projection coordinates
-1 <= x <= 1, -1 <= y <= 1, 0 <= z <= 1

Need device coordinates
xdmin <= x <= xdmax, ydmin <= y <= ydmax

Steps:

1. Translate lower left corner to origin: T(1,1,0)

2. Scale to correct size:


Workstation Transformation

(window to viewport mapping)

Projection coordinates
-1 <= x <= 1, -1 <= y <= 1, 0 <= z <= 1

Need device coordinates
xdmin <= x <= xdmax, ydmin <= y <= ydmax

Steps:

1. Translate lower left corner to origin: T(1,1,0)

2. Scale to correct size:

3. Translate into place:



View Volumes

View volume bounded by front and back planes, and by top, bottom, and side planes. Front and back planes are parallel to the view plane at positions zfront and zback along the zv axis.

Parallel Projection

Perspective Projection


View Volumes

View volume bounded by front and back planes, and by top, bottom, and side planes. Front and back planes are parallel to the view plane at positions zfront and zback along the zv axis.

Parallel Projection

Perspective Projection


View Volumes

View volume bounded by front and back planes, and by top, bottom, and side planes. Front and back planes are parallel to the view plane at positions zfront and zback along the zv axis.

Parallel Projection

Perspective Projection


View Volumes

View volume bounded by front and back planes, and by top, bottom, and side planes. Front and back planes are parallel to the view plane at positions zfront and zback along the zv axis.

Parallel Projection

Perspective Projection



World and View Spaces

World space
used for modeling;
right handed

World and View Spaces

World space
used for modeling;
right handed

View Space (simple)
Camera/viewer at origin
View along zv axis
xv and yv aligned with display system

World and View Spaces

World space
used for modeling;
right handed

View Space (simple)
Camera/viewer at origin
View along zv axis
xv and yv aligned with display system


World to View Transformation

Aligning a viewing system with the world-coordinate axes using a sequence of translate-rotate transformations.


World to View Transformation

Aligning a viewing system with the world-coordinate axes using a sequence of translate-rotate transformations.

Translate view point to origin of world coordinate space.


World to View Transformation

Aligning a viewing system with the world-coordinate axes using a sequence of translate-rotate transformations.

Rotate to align view coordinate axes (xv,yv,yv) with world coordinate axes (xw,yw,yw).



Two different projections of the same line


Line AB and its perspective projection A'B'.

Line AB and its parallel projection A'B'. Projectors AA' and BB' are parallel.


Simple parallel transformation (orthographic)

View plane is normal to direction of projection:
xs = xv, ys = yv, zs = 0



Simple perspective transformation

  • Assume line from center of projection to center of view plane parallel to view plane normal.
  • Center of projection is at origin


Simple perspective transformation

  • Assume line from center of projection to center of view plane parallel to view plane normal.
  • Center of projection is at origin
Have P(xv,yv,zv) want P(xs,ys)

Simple perspective transformation

  • Assume line from center of projection to center of view plane parallel to view plane normal.
  • Center of projection is at origin
Have P(xv,yv,zv) want P(xs,ys)
By similar triangles:


Simple perspective transformation

  • Assume line from center of projection to center of view plane parallel to view plane normal.
  • Center of projection is at origin
Have P(xv,yv,zv) want P(xs,ys)
By similar triangles:
In homogeneous coordinates:
x = xv, y = yv,z = zv, w = zv/d


Simple perspective transformation

  • Assume line from center of projection to center of view plane parallel to view plane normal.
  • Center of projection is at origin
Have P(xv,yv,zv) want P(xs,ys)
By similar triangles:
In homogeneous coordinates:
x = xv, y = yv,z = zv, w = zv/d

Do perspective divide to get screen coordinates:
xs = x/w, ys = y/w,zs = z/w = d


Basic Viewing System

Viewing system using a camera position, a viewing direction vector N, an up vector V, and an optional vector U. The world coordinate system is right handed, the view coordinate system is left handed.


Basic Viewing System

Requirements

  • Camera position (C)
  • View direction (N)
  • View up (V)
  • View plane distance (d)

Viewing system using a camera points, a viewing direction vector N, an up vector V, and an optional vector U. The world coordinate system is right handed, the view coordinate system is left handed.


Basic Viewing System

Requirements

  • Camera position (C)
  • View direction (N)
  • View up (V)
  • View plane distance (d)

Characteristics

  • View direction controllable
  • Camera up controllable
  • No view volume specified
  • No view plane window specified
  • Perspective projection with viewport as center of projection

Viewing system using a camera points, a viewing direction vector N, an up vector V, and an optional vector U. The world coordinate system is right handed, the view coordinate system is left handed.


Basic Viewing System

Implementation

  • Translation as before T(-cx,-cy,-cz)


Basic Viewing System

Implementation

  • Translation as before T(-cx,-cy,-cz)
  • Rotate to align axes:


Basic Viewing System

Implementation

  • Translation as before T(-cx,-cy,-cz)
  • Rotate to align axes:

  • Convert to left-handed coordinates


View Transformation

1. Translate origin of world coordinate system to origin of view coordinate system. (Transformation of coordinate system is inverse of that which moves points)


View Transformation

C - camera position (also called VRP)

1. Translate origin of world coordinate system to origin of view coordinate system. (Transformation of coordinate system is inverse of that which moves points)


View Transformation

2. Rotate coordinate system 90o about x' axis. Use theta = -90.


View Transformation

2. Rotate coordinate system 90o about x' axis.


View Transformation

3. Rotate about y' by theta so that (0,0,cz) lies on z' axis.


View Transformation

3. Rotate about y' by theta so that (0,0,cz) lies on z' axis.


View Transformation

4. Rotate about x' by phi so that origin of original coordinate system lies on z' axis.


View Transformation

4. Rotate about x' by phi so that origin of original coordinate system lies on z' axis.


View Transformation

5. Reflect z' axis to create left-handed coordinate system.


View Transformation

5. Reflect z' axis to create left-handed coordinate system.


View Transformation

6. Twist about z' so that y' aligns with V


View Transformation

6. Twist about z' so that y' aligns with V



Viewing Example

Camera at (6,8,7.5)
View towards (0,0,0)
VPN (-6,-8,-7.5)
View up (-3.6,-4.8,8)

Viewing Example

Camera at (6,8,7.5)
View towards (0,0,0)
VPN (-6,-8,-7.5)
View up (-3.6,-4.8,8)

1. Translate world origin to view origin


Viewing Example

2. Rotate 900 about x'.


Viewing Example

3. Rotate about y' by Theta 900 so that (0,0,cz) lies on z' axis.


Viewing Example

4.Rotate about x' by phi so that origin of original coordinate system lies on z' axis.


Viewing Example

5. Reflect z' axis to create left-handed coordinate system.


Viewing Example

6. Twist about z' so that y' aligns with V


Viewing Example

Multiply it all together


Viewing Example

Cube at origin

xyz
A-1 1-1
B 1 1-1
C 1-1-1
D-1-1-1
E-1 1 1
F 1 1 1
G 1-1 1
H-1-1 1


Compositions of Translations and Rotations

Resulting matrix has form



Basis Rotation Shortcut

Where u'x,u'y,u'z are unit basis vectors


Basis Rotation Shortcut

Where u'x,u'y,u'z are unit basis vectors

Assume we've already performed translation, so x'0=0, y'0=0, z'0=0


Basis Rotation Shortcut

Where u'x,u'y,u'z are unit basis vectors

Assume we've already performed translation, so x'0=0, y'0=0, z'0=0

Can rotate to align basis vectors using

Expressed in coordinates of S


Applying the shortcut

Given view direction vector N

Given view up vector V



Shortcut Example

Camera at (6,8,7.5)
View towards (0,0,0)
VPN (-6,-8,-7.5)
View up (-3.6,-4.8,8)

Shortcut Example

Camera at (6,8,7.5)
View towards (0,0,0)
VPN (-6,-8,-7.5)
View up (-3.6,-4.8,8)


Clipping for Basic View System

  • Rely on 2D clipping of projected primitives (mostly wire-frame)
  • Only works if view point is outside entire scene


Advanced Viewing System

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.


Advanced Viewing System

Requirements

  • Camera position (C)
  • View direction (N,Zv)
  • View up (Yv)
  • Distance to near (d) and far (f) plane

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.


Advanced Viewing System

Requirements

  • Camera position (C)
  • View direction (N,Zv)
  • View up (Yv)
  • Distance to near (d) and far (f) plane

Characteristics

  • View position and direction controllable
  • Camera up controllable

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.


Advanced Viewing System

Requirements

  • Camera position (C)
  • View direction (N,Zv)
  • View up (Yv)
  • Distance to near (d) and far (f) plane

Characteristics

  • View position and direction controllable
  • Camera up controllable
  • View volume specified, but view plane constrained to be coincident with near plane

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.


Advanced Viewing System

Requirements

  • Camera position (C)
  • View direction (N,Zv)
  • View up (Yv)
  • Distance to near (d) and far (f) plane

Characteristics

  • View position and direction controllable
  • Camera up controllable
  • View volume specified, but view plane constrained to be coincident with near plane
  • View window square and symmetric about the center of view plane
  • Perspective with center of projection at view point

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.


Advanced Viewing System

View volume specified by:
(two sides)

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.


Advanced Viewing System

View volume specified by:
(two sides)
(top and bottom)

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.


Advanced Viewing System

View volume specified by:
(two sides)
(top and bottom)
(near and far)

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.


Advanced Viewing System

View volume specified by:
(two sides)
(top and bottom)
(near and far)
View plane has dimensions:
2h x 2h

Advanced Viewing system: view frustum formed by six planes and the view volume. This is a left-handed coordinate system.



Projection for Advanced View System (part 1)

Want 3D screen space because it facilitates:

  • 3D Clipping
  • Visibility calculation

Chose Zs such that:

  • Zs normalized for maximum precision
  • Lines in view space -> lines in screen space
  • Planes in view space -> planes in screen space

Projection for Advanced View System (part 1)

Want 3D screen space because it facilitates:

  • 3D Clipping
  • Visibility calculation

Chose Zs such that:

  • Zs normalized for maximum precision
  • Lines in view space -> lines in screen space
  • Planes in view space -> planes in screen space

Satisfied for:

where B < 0 to preserve intuitive notion of depth (if Zv increases, so does Zs)
and range is normalized so that maps to


Projection for Advanced View System (part 1)

Want 3D screen space because it facilitates:

  • 3D Clipping
  • Visibility calculation

Chose Zs such that:

  • Zs normalized for maximum precision
  • Lines in view space -> lines in screen space
  • Planes in view space -> planes in screen space

Satisfied for:

where B < 0 to preserve intuitive notion of depth (if Zv increases, so does Zs)
and range is normalized so that maps to



Projection for Advanced View System (part 2)

Full perspective transformation

Where h insures that xs and ys fall in range [-1,1]

Projection for Advanced View System (part 2)

Full perspective transformation

Where h insures that xs and ys fall in range [-1,1]

Using a homogeneous coordinates:


Projection for Advanced View System (part 2)

Full perspective transformation

Where h insures that xs and ys fall in range [-1,1]

Using a homogeneous coordinates:

So:



Projection for Advanced View System (part 3)

Decompose Tpers:
Tpers = Tpers 2Tpers 1

Projection for Advanced View System (part 3)

Decompose Tpers:
Tpers = Tpers 2Tpers 1

Scaling in x and y to a regular pyramid (side sloping 45o)


Projection for Advanced View System (part 3)

Decompose Tpers:
Tpers = Tpers 2Tpers 1

Projection for Advanced View System (part 3)

Map pyramid to the box:




Clipping for Advanced View System

Clipping against view frustum necessary because:

  • View point may be arbitrarily located
  • Screen space clipping may not remove all points outside the viewing frustum

Clipping for Advanced View System

Clipping against view frustum necessary because:

  • View point may be arbitrarily located
  • Screen space clipping may not remove all points outside the viewing frustum

Clipping cases:

  • Completely outside -> discard
  • Completely inside -> accept
  • Intersect view frustum -> clip further

Clipping for Advanced View System

Clipping against view frustum necessary because:

  • View point may be arbitrarily located
  • Screen space clipping may not remove all points outside the viewing frustum

Clipping cases:

  • Completely outside -> discard
  • Completely inside -> accept
  • Intersect view frustum -> clip further

Clip in homogeneous coordinates (before perspective divide) to:



[prev][next]
Made by dynaPage 0.2