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 451<br />

Using the Matrix Stack<br />

Figure 13.14 Rotating and Translating Text Strings<br />

Note the green string is extending backwards beyond the far clipping plane. Change the 7 to 10 in the<br />

Perspective command to see the complete string.<br />

Using the Matrix Stack<br />

JMP 3-D scenes use a matrix stack to keep track of the current transform. The stack is initialized to the<br />

identity matrix, and each time a translate, rotate, or scale command is given, the top matrix on the stack is<br />

changed.<br />

Note: Unlike many OpenGL implementations, JMP does not use a transposed matrix.<br />

The JSL example below uses Push Matrix and Pop Matrix to position pieces of the toy top and then<br />

return to the origin. This is faster than using the Translate command a second time in reverse.<br />

Figure 13.15 Drawing With a Matrix Stack<br />

toyTop = SceneDisplayList();<br />

toyTop

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

Saved successfully!

Ooh no, something went wrong!