14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 13 Three-Dimensional Scenes 433<br />

Setting the Viewing Space<br />

Figure 13.5 Comparing Projections<br />

Orthographic Scene<br />

viewer<br />

angle<br />

near<br />

far<br />

Perspective Scene<br />

In general, perspective projections give a more realistic view of the world, since it mimics the way an eye or<br />

a camera sees. Orthographic projections are important when it is essential to preserve dimensions, such as an<br />

architectural CAD program.<br />

Setting Up a Perspective Scene<br />

To set up a perspective scene in JSL, send the Perspective command to a display list.<br />

Perspective (angle, near, far)<br />

where angle is the viewing angle, near is the distance to the near plane, and far is the distance to the far<br />

plane, as illustrated in the drawing above. A couple of things need to be remembered when defining the<br />

viewing space.<br />

• Items outside the viewing space (for example, closer than the near plane or farther than the far plane)<br />

are not drawn. They are clipped off.<br />

• The ratio of far to near needs to be small so that the rendering engine can effectively determine which<br />

items should be drawn “on top of” other items, simulating closeness of items. The near parameter must<br />

be greater than zero.<br />

The “Hello World” example contains the line<br />

scene

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!