Some more advanced topics for Project 3...

There are lots of things that you probably will not have time to get to. If you're fealing ambitious, try some of these.

You can spend a lot of time making nice objects for your world, but if it doesn't draw quickly enough, ...

#### Culling

In order to be able to look "animated" you must be able to redraw your town many times per second. Hopefully, your town will be big and complex enough that even with a fast computer you cannot draw every object in the world all of the time. Instead, you must avoid drawing objects (or simulating the behavior of objects) that you cannot see.

While clipping and z-buffering will hide objects that you cannot see, if you can figure out a way to decide even faster that there will be no-way to see an object, you can save time.

Doing culling well is a difficult topic. The trick is to quickly rule out large portions of the geometry in ways that are faster than simply trying to draw each piece and let culling and z-buffering decide. Computer games and simulators use many fancy tricks to quickly rule out lots of the geometry.

Here are some simple methods you might want to implement:

• Objects that are behind you (or outside your view) cannot be seen, so don't bother.
• Some objects have parts that are only visible from certain directions (like the details on the facade of a building).
• Certain things are only visible from certain places. For example, the inside of a room might only be visible through a window which may only be visible from a particular place on the street.

When culling is implemented correctly, the user should not notice (because you are only throwing away things that can't be seen). If you implement a culling method, you should provide some way for us to tell that it works. For example, you can give the user the opportunity to turn it on and off so they can see how much it helps.

#### Level of Detail

An optimization related to culling is level of detail. That is, sometimes we draw simpler versions of objects if we want to save time. For example, if an object is far away (so it appears small) we might want to save time by drawing a simplified version of it. Or, if we decide that we simply do not have time to draw the complex version, we draw a simplified version.

As with culling, you should provide the user with some way to see that it is working. You may want to allow the user the option of controlling what levels of detail are used (in addition to letting the system decide).