An abstract class for 3D shape classes.
An array of RedVector3D defining the corners of the shape.
An array of arrays with pairs of indices defining connections between the points (corners) of the shape.
An array or arrays with four indices defining the planes (rectangles) of the shape.
Get or set the current position of the shape as a RedVector3D.
Set the angle of rotation around the X axis.
theta |
In radians. |
Set the angle of rotation around the Y axis.
theta |
In radians. |
Set the angle of rotation around the Z axis.
theta |
In radians. |
Returns an array of 3 arrays each holding a 3-row matrix for the current rotation in X, Y and Z dimensions. This is calculated when calling -update.
An array of RedVector3D. This holds the current positions of all points (corners) after rotation. This is calculated when calling -update.
An array of Points. This holds the current positions of all points (corners) after projection and scaling. This is calculated when calling -render.
dist |
Distance. A value lower than 2 exaggerate the depth. |
size |
Scaling factor. |
Call this to perform the rotation calculations. This updates the variable -vectors.
Call this to perform the projection and scaling calculations. This updates the variable -rederedPoints.
Draws an oval at each point (in each corner). Must be called inside a draw function. Use Pen.fillColor_
to set the color.
dotSize |
The size of the oval. |
Draws a line between each point (all edges). Must be called inside a draw function. Use Pen.strokeColor_
to set the color, and Pen.width_
to set the line thickness.
Draws a rectangle for each plane. Must be called inside a draw function. Use Pen.fillColor_
to set the color.