SL Cert - Basic LSL Rotations
This is an initial take on a set of guidelines for scripting position and rotations. It still needs a lot of work and a good deal of thought.
This list of requirements is part of the Second Life Certification project. It is an effort to create a list of specific skills for different topic areas. It is part of a standard to make it easier for people to demonstrate their abilities.
Basic Requirements
In the basic skill sets a person should be able to demonstrate that they understand the basic definitions. The person should also be able to demonstrate that they understand the basic idea. For example, a person should know how to calculate a dot product but also understand its relationship to the idea of a projection of one vector on to another.
Basic definition of position
- Absolute position
- Local position
A person should know what position is in the context of SL. This means the person should know the difference between an absolute position within a sim and the local position within a linkset. An understanding of the different contexts when you might use local versus absolute is vital to working with rotations and vectors. For example, when working within a linkset a local coordinate system is used. At the same time it is not uncommon to make use of local offsets when dealing with two separate objects.
Basic definition of a rotation
- Euler
- Axis and angle
- Quarternions
A person should demonstrate that they know the definitions of a rotation. The person should know the difference between an Euler rotation and a quarternion. A person need not know the specific implementation of a quarternion but should be understand a roation in terms of an axis of rotation and an angle around that axis.
Changing position and rotation via the edit window
A person should be proficient using the edit window to manually move and rotate an object. The person should be able to move and rotate an object to a specific orientation (position and rotation). Also, the person should be able to read the position and rotation for a given object using the edit window.
Vectors and Operations
- Definition of vector in LSL
- Working with vector components (x, y, and z)
- Linear combinations of vectors
- Dot product
- Cross product
- Unit vectors
A person should know the basic mathematical vector operations. The person should know how the calculations are performed and the LSL overloaded operators. For example, given two vectors u and v, the person should know how to calculate the dot product and also know that in LSL u*v will give you the dot product. The person should know how to multiply a scalar and a vector in LSL and add vectors that have been multiplied by a scalar in LSL.
Intermediate Requirements
Reference Frames
- Global
- Local
Basic commands to get position information
- llGetPos
- llGetLocalPos
- llGetRootPosition
Basic commands to get rotation information
- llGetRot
- llGetLocalRot
- llGetRootRotation
Basic commands for changing position
- llSetPos
- llSetPrimitiveParams
- llSetPos within different reference frames.
Basic commands for changing rotation
- llSetRot
- llSetLocalRot
- llSetPrimitiveParams
- How the commands work in different reference frames.
- Rotations
- Multiplication and division of rotations
- Difference between left and right multiplication
Working with vectors
- Finding a vector component in a given direction
- Finding a vector perpendicular to two vectors.
- Finding a vector perpindicular to a plane.
Advanced Requirements
Rotations and position
- using llSetPrimitiveParams to move and rotate at the same time
- Rotating and moving a prim to a specified orientation
- Absolute coordinates
- Relative coordinates (in a link set)
Smooth movements
Absolute coordinates
- Rotate and movement around the edge of a prim
- Rotate and move around a fixed point
- Rotate and move around a predefined axis
Local coordinates (within a linkset)
- Rotate and movement around the edge of a prim
- Rotate and move around a fixed point
- Rotate and move around a predefined axis
Transitions
- Smooth movements from one orientation (position and rotation) to another.
Determining specific orientations
Absolute coordinates
- Given a point rotate an object to face the point.
- Given two points rotate an object to face perpindicular to the two points.
Local coordinates to local
- Given a point rotate an object to face a local point.
- Given two local points rotate an object to face perpindicular to the two points.
Local coordinates to absolute
- Given a point rotate an object to face a point in absolute coordinates.
- Given two absolute points rotate a local object to face perpindicular to the two points.