A Frame3d has an origin point and a set of X, Y and Z directions (which are
always perpendicular to each other). It can be thought of as:
relativeTo
and placeIn functions that convert values of that type from global
coordinates to local coordinates in a particular frame, and vice versa.Frame3d could be
used to define the position and orientation of a spaceship in a 3D game.
Movement of the ship would then be done by translating and rotating the
frame.The withXDirection, withYDirection and withZDirection functions all
construct a new Frame3d with the given axis direction, having the given origin
point. The other two directions will be chosen arbitrarily. This can be useful
when constructing 'scratch' frames where (for example) you want a particular Z
direction but the specific X/Y directions are unimportant.
No guarantees are given about the other two directions other than that the three directions will be mutually perpendicular, and will be oriented so that the resulting frame is right-handed.
The following functions all return planes with the same origin point as the given frame, but with varying normal directions. In each case the normal direction of the resulting plane is given by the cross product of the two indicated basis directions (assuming a right-handed frame).
These functions all form a SketchPlane3d from two axes of the given frame. The
X and Y axes of the sketch plane will correspond to the two indicated axes.