Programming and Graphics

(Kiana) #1

B Summary ofVogleFunctions 321


Drawing


draw (x, y, z) Draw from the current graphics position
to the point (x, y, z)
rdraw (deltax, deltay, deltaz) Relative draw
draw2 (x, y) Draw from the current graphics position
to the point (x, y)
rdraw2 (deltax,deltay) Relative draw
sdraw2 (x, y) Draw in screen coordinates, -1.0 to 1.0
rsdraw2 (deltax, deltay) Relative draw in screen units, -1.0 to 1.0

Viewport


It is possible to subdivide the screen into rectangular partitions called viewports,
and then navigate inside each partition using screen coordinates ranging from -1.0
to 1.0.


viewport (left, right, bottom, top) Specifies a portion of the screen
for drawing; the box limits: left,
right, bottom, and top are
real values in screen coordinates.
pushviewport () Save the current viewport
popviewport () Retrieve last viewport
getviewport (left, right, bottom, top) Returns limits of current viewport
in screen coordinates

Aspect details


float getaspec t() Returns the height-over-width ratio
of the display device
getfactors (wfact, hfact) Returns the width over the minimum of
the width and height of the device,
and the height over the minimum of
the width and height of the device
getdisplaysize (w, h) Returns width and height of device in pixels

Attribute stack


pushattributes () Save the current attributes on the attribute stack
popattributes () Restore attributes to what they were
at last pushattributes
Free download pdf