2.) You have rasterized a perfect circle into a 500 by 500 pixel square viewport,

but now you use a different display that does not have square pixels ==> How to avoid distortions ?

3.) How do you display a 16:9 aspect ratio movie on your old 4:3 aspect ratio screen ?

PREVIOUS < - - - - > CS 184 HOME < - - - - > CURRENT < - - - - > NEXT

Today we talk about how to transform it::

-- first in the modeling phase to build up a scene (

-- and then again to map that scene to a particular location on the display (

World to screen transforms for the classical rendering pipeline.

And what it does to a world of triangles.

Transformations are a key element of computer graphics !

e.g., synthesizing a shear transformation

note: order of transformation matters !

Now, what is going on "under the hood"?

This yields a powerful formalism for combining the effects of several transformations through matrix multiplication.

Also: If we transform a complicated object with thousands of vertices with the same transformation,

then we need to calculate that compound matrix only once and can than use it to transform

We also want to do

--> We use a clever hack via homogeneous coordinates:

We can recover the regular cartesian coordinates by a division with w (w<>0); this corresponds to a cut of the homogeneous line with the w=1 plane.

Matrix operation is still linear in d+1 dimension (origin stays in place), but we are only interested in (hyper-)plane w=1.

All

Distinguish:

Also: Now we have

But you don't want your carefully designed fantasy polygon to be distorted -- just scale it uniformly to the largest size that fits into the given window.

Thus you have to determine what is the largest rectangle with the aspect ratio of your original drawing window (= square) that fits into the given window.

If we were to just scale the x- and y-directions individually, so that the content of window completely fills the viewport, we might get affine distortions, if the aspect ratios of window and viewport are different.

To gain independence and abstraction of the actual display device, we calculate the necessary transformation in steps:

Practical hint: draw some orientation onto the polygon contour if it is not already given. Label fields with winding numbers. Check that adjacent fields differ by exactly ONE.

How many DOFs are there
for the specification of all
possible
...

- line segments in 2D: ( 4 )
- arbitrary n-gons in 2D: ( 2n )

- rectangles in 2D: ( 5 )
- infinitely long lines in 2D: ( 2 )
- spheres in 3D: ( 4 )
- planes in 3D: ( 3 )

Find what is under the cursor! ( Like target shooting in a CG game: How do you know what, if anything, you hit with your blaster ? )

A#2:

**Various possible bounds:**

**Axis-aligned bounding boxes (AABB): ** most often used, easy to compute, can be somewhat wasteful.**
Optimally oriented bounding boxes (OOBB)**: are more
efficient
but more difficult to determine.

How should we "describe" a complex world model in the computer ? -- for instance: a Boeing 747: ~ 4 000 000 identifyable parts?. -- or a battle scene in StarWars?

Use

An object or group of objects can be

Benefits: Managing complexity, abstraction, structure, re-use of objects, easy searching and editing, reducing the rendering work, ...

Shirley, 2nd Ed: Ch 6.1, 6.3.

Assignment #2 is due (electronically submitted) before Thursday 2/12, 11:00pm.

I strongly recommend that you should be done with your assignments by **Wednesday**,

so that you can then focus on the new one and pay attention to what I might say in class about it.

The "extension" to Thursday should only be seen as an emergency measure.

PREVIOUS < - - - - > CS 184 HOME < - - - - > CURRENT < - - - - > NEXT

Page Editor: Carlo H. Séquin