AMCAF Extension V1.40 Manual  Index

Vector Rotate Commands

Note: this should not be a replacement for the 3d-extension

At least not at this time. Nevertheless you can create vector graphics without problems which is proved by the example programs.

instruction: position the camera
Vec Rot Pos posx,posy,posz

Using Vec Rot Pos you can change the position of the camera. 'posx' and 'posy' hold the movement position of the camera in X and Y direction.
The value in 'posz' contains the distance to the camera.

There is no need to recalculate the matrix if you only change the position of the camera.

instruction: set the viewing angles
Vec Rot Angles angx,angy,angz

This command sets the three viewing angles, which are used for the vector rotation.
'angx' represents the angle, the coordinate is to be rotated along the X-axis.

Same with 'angy' and 'angz', which are related to the Y- and the Z-axis.
The angles are -like with Qsin and Qcos- neither values in degree nor radians format, but a revolution (360 degrees) equals the value 1024.

After you have given the angles and the new position, you can calculate the new vector matrix using the Vec Rot Precalc command.

instruction: calculate the precalc matrix
Vec Rot Precalc

This command must be called before every vector rotations, always after you have changed the viewing angle.
It calculates a internal matrix that holds the results of often needed calculations which are required for the rotation in three dimensions.

After you have called Vec Rot Precalc, you can use the Vec Rot X,Y and Z functions.


function: calculate the 2d x value
newx=Vec Rot X(x,y,z)
newx=Vec Rot X

This function calculates the X coordinate, which results in the vector rotation of a three dimensional point x,y,z around all three axis.
This coordinate is automatically projected from 3D to 2D by dividing it through the distance.

If you call the function with the parameters x,y,z all three new coordinates are calculated, i.e the y,z position too.
If you require the Y coordinate too, when simply write the Vec Rot Y command without the parameters. Same with Vec Rot Z.

This parameter system can be also used on Vec Rot Y in the same way.

function: calculate the y value
newy=Vec Rot Y(x,y,z)
newy=Vec Rot Y

This function calculates the new Y coordinate after the rotation. For more detailed information see Vec Rot X.

function: return the z coordinate
newz=Vec Rot Z(x,y,z)
newz=Vec Rot Z

This function returns the new Z coordinate after the rotation.

Please note that the current camera position has already been added to this value.
The Z coordinate can be used to sort objects by distance or to evaluate a brightness level.
More information on the syntax or the parameters see Vec Rot X.