Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

XOBJVIEW_ROTATE


Syntax | Arguments | Keywords | Examples | Version History | See Also

The XOBJVIEW_ROTATE procedure is used to programmatically rotate the object currently displayed in XOBJVIEW. XOBJVIEW must be called prior to calling XOBJVIEW_ROTATE. This procedure can be used to create animations of object displays.

This routine is written in the IDL language. Its source code can be found in the file xobjview_rotate.pro in the lib/utilities subdirectory of the IDL distribution.

Syntax

XOBJVIEW_ROTATE, Axis, Angle [, /PREMULTIPLY]

Arguments

Axis

A 3-element vector of the form [x, y, z] describing the axis about which the model is to be rotated.

Angle

The amount of rotation, measured in degrees.

Keywords

PREMULTIPLY

Set this keyword to cause the rotation matrix specified by Axis and Angle to be pre-multiplied to the model's transformation matrix. By default, the rotation matrix is post-multiplied.

Examples

The following example creates an animation of the test object (a surface) currently displayed in XOBJVIEW. It does this by rotating the surface through 360 degrees in increments of 10 degrees using XOBJVIEW_ROTATE, and writing the display image to a BMP file for each increment using XOBJVIEW_WRITE_IMAGE.

PRO RotateAndWriteObject 
 
XOBJVIEW, /TEST 
FOR i = 0, 359 DO BEGIN 
   XOBJVIEW_ROTATE, [0, 1, 0], 1, /PREMULTIPLY;       
   XOBJVIEW_WRITE_IMAGE, 'img' + $ 
   STRCOMPRESS(i, /REMOVE_ALL) + '.bmp', 'bmp' 
ENDFOR 
 
END 

Version History

Introduced: 5.5

See Also

XOBJVIEW, XOBJVIEW_WRITE_IMAGE


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]