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

Graphics Primitives<br />

Size and Width<br />

To set the point size of rendered objects, use the Point Size command.<br />

Point Size (n)<br />

where n is the number of pixels. Note that this might not be the actual number of pixels rendered,<br />

depending on other settings such as anti-aliasing and your hardware configuration.<br />

Set the line width using the Line Width command<br />

Line Width(n)<br />

where n is the number of pixels. The argument n must be larger than zero and is, by default, one.<br />

Stippling Pattern<br />

To make stippled lines, use the Line Stipple command.<br />

Line Stipple(factor, pattern)<br />

Factor is a stretching factor. Pattern is a 16-bit integer that turns pixels on or off. Use<br />

Enable(LINE_STIPPLE) to turn the effect on.<br />

To construct a line stippling pattern, write a 16-bit binary number that represents the stippling pattern that<br />

you desire. Note that the pattern should read from right to left, so your representation might seem backward<br />

to the way it is rendered. Convert the binary number to an integer and use this as the pattern parameter.<br />

For example, imagine you want the dotted line pattern 0000000011111111. This is equal to 255 in decimal<br />

notation, so use the command Line Stipple(1, 255).<br />

The factor parameter expands each binary digit to two digits. In the example above, Line Stipple(2,<br />

255) would result in 00000000000000001111111111111111.<br />

For example, the following script draws three lines, each of different widths (the Line Width commands)<br />

and stippling patterns.<br />

// make a scene box...holds an OpenGL scene.<br />

scene = SceneBox( 200, 200 );<br />

// put the scene in a window.<br />

New Window( "Stipples", scene );<br />

scene

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

Saved successfully!

Ooh no, something went wrong!