Bill DeWitt (bdewitt@gateway.net) asked for more information about vrotate and other vector expressions.
![]() |
Step 1 Creating the scene |
|---|---|
Here is the scene we are going to work with. The red sphere sits on the floor. Here is the code to set this scene up:
rv is our rotation vector, and p1 is the position of the sphere.
| |
|
Step 2 Rotate around the x axis |
Vrotate works exactly the same as the rotate command, it only applies to vectors where rotate applies to objects. Like any rotation this is done by rotating around the x axis first. Note that the two code blocks below place the sphere in the same place... the texture would be applied differently:
Below is an example of this in a bit more detail. The red curve shows the full range of rotation for the sphere.
| |
![]() |
Step 3 Rotate around the y axis |
Next, we rotate around tht y axis...
and this time the green curve indicates this rotation.
| |
![]() |
Step 4 Rotate around the z axis |
And finally we rotate around the z axis. Normally you probably wont need to (or want to) rotate around all three axes. Two will suffice.
And (need we say it?) the blue curve shows the rotation around the z axis.
|
Thanks for watching.