Difference between revisions of "API Panel.Position.RotateX"

From Flowcode Help
Jump to navigationJump to search
Line 36: Line 36:
 
===Rotating around an object's own axis===
 
===Rotating around an object's own axis===
 
This is the simplest technique for rotating an object or group.The image shows a cube with it's axis labelled (note the x,y,z axis is illustrated just to highlight this technique, it is not representative of the axis position in Flowcode v6). Calling Rotatex(MyCube,MyCube,1) will rotate the object in one-degree steps along it's X axis as shown by the red rotation arc. To rotate the cube in a counter direction simply specify a negative number for the degrees parameter.
 
This is the simplest technique for rotating an object or group.The image shows a cube with it's axis labelled (note the x,y,z axis is illustrated just to highlight this technique, it is not representative of the axis position in Flowcode v6). Calling Rotatex(MyCube,MyCube,1) will rotate the object in one-degree steps along it's X axis as shown by the red rotation arc. To rotate the cube in a counter direction simply specify a negative number for the degrees parameter.
 
+
[[file:SIMAPI_Panel_Position_Rotate_Pic1.png|500x500px]]
[[file:SIMAPI_Panel_Position_Rotate_Pic1.png]]
 
 
 
 
 
 
 
 
 
  
 
==Examples==
 
==Examples==

Revision as of 19:29, 21 May 2013

<sidebar>API contents</sidebar> Rotates the object around the X axis

Class hierarchy

Panel

Position
RotateX

Parameters

HANDLE Handle

The position or component to update
The default value for this parameter is: this

HANDLE PivotHandle

An optional position to treat as the origin to rotate around

FLOAT Degrees

Number of degrees to rotate by


Return value

This call does not return a value


Detailed description

There are several api calls that deal exclusively with rotation of an object, here we are going to deal exlusively with the RotateX() api call. An object can rotate around it's own axis(x,y,z), or around the axis of another object's axis(x,y,x) if a different object is named as the pivothandle in the api call. When dealing with rotation in Flowcode it is important therefore to understand the following points

  1. Rotation of an object occurs from the centre of an object or group.
  2. The axis of the object or group may well be different from the axis on the system panel(world axis)


Rotating around an object's own axis

This is the simplest technique for rotating an object or group.The image shows a cube with it's axis labelled (note the x,y,z axis is illustrated just to highlight this technique, it is not representative of the axis position in Flowcode v6). Calling Rotatex(MyCube,MyCube,1) will rotate the object in one-degree steps along it's X axis as shown by the red rotation arc. To rotate the cube in a counter direction simply specify a negative number for the degrees parameter. SIMAPI Panel Position Rotate Pic1.png

Examples

Calling in a calculation

  • Add to a calculation icon:
    ::Panel.Position.RotateX(handle, pivothandle, degrees)

No additional information