# CS488 - Introduction to Computer Graphics - Lecture 20

# Projects

The idea is simple:

- Think about what you want your result to do and to look like.
- Choose technical objectives that make your result better than it would
otherwise be
- Some should be easy; some hard.

- Make an implementation plan
- Should be incremental: you might not get completely finished
:-).

- Implement
- Should do your easy objectives first.

- Demo your project
- Should be able to show the effect of your technical objectives
clearly
- On-off toggle for interactive projects; sample images for
others.

#### Types of Projects

Contemplative

- Still image
- Animation

Interactive

- Game
- Visualization

#### Subjects for Projects

Architecture

Art

Game

Geometry

Nature

Simulation

#### Rendering Style

Photorealistic

Non-photorealistic

#### Objectives

#### Resources

For what to do

- A5 assignment description on the web page; it's long but everybody
ahould read all of it.

For project ideas

For possible objectives

- The last half of the course notes

# Ray Tracing

## Intersection Tests

#### Eye-pixel ray

E + t*(P - E)

#### Object in scene

Set of points {Q} satisfying

- f(Q) = 0
- Usually f(Q) is a distance function from the surface.
- f(Q) > 0 means outside,
- f(Q) < 0 means inside

- This is the surface of an object. (How do you know?)
- Why don't we care about inside points?

Solve the equation

- f(E + t*(P-E)) = 0 for t.

#### Another idea: intersect in object coordinates

- In object coordinates each point is given by the object definition.
- In world coordinates each point in object coordinates is Q = MQ', where
Q' is the point in object coordinates
- M is the affine modelling transformation, therefore invertible
- f'(Q') is the object definition in object coordinates, which is
usually known

- Use invM to transform E,P to E',P', then solve the equation for t
- Find intersection point in world coordinates as E + t*(P-E)

### Shading for Ray Tracing

When we have found the intersection point we need to calculate a
colour.

We know

- The eye ray, Q-E
- Surface properties
- The normal vector
- by interpolation from vertex normals
- by calculation from the equation of the surface

For each light

- Calculate illumination: RGB, l
- Accumulate outgoing light

#### How about shadows?

In principle,

- Do an intersection test from the light
- in the direction of the eye ray intersection

- If it hits the eye ray intersection, then
- intersection illuminated by that light

else

- intersection in shadow from that light

#### How about reflections?

#### Return to: