home *** CD-ROM | disk | FTP | other *** search
- Vectors are used not only as a notation for a point in space but are used
- in the transformations scale, rotate, and translate. Scale sizes a texture
- or object. Translate moves a texture or object. And rotate turns a texture
- or object.
-
- When an object is transformed, all textures attached to the object at
- that time are transformed as well. This means that if you have a translate,
- rotate, or scale in an object BEFORE a texture, the texture will not be
- transformed. If the scale, translate, or rotate is AFTER the texture then
- the texture will be transformed with the object. If the transformation is
- INSIDE the 'texture { }' statement then ONLY THE TEXTURE is affected. The
- shape remains the same. For example:
- sphere {
- <0, 0, 0>, 1
- texture { White_Marble } // Identifier from TEXTURES.INC
- scale 3 // Affects both shape and texture
- }
- sphere {
- <0, 0, 0>, 1
- scale 3 // Affects the shape only
- texture { White_Marble }
- }
- sphere {
- <0, 0, 0>, 1
- texture {
- White_Marble
- scale 3 // Affects the texture only
- }
- }
-
- Transformations may also be independently applied to pigment patterns and
- surface normal (bump) patterns.
-
- NOTE: Scaling a normal pattern affects only the width and spacing. It
- does not affect the height or depth. For example:
- box {
- <0, 0, 0>, <1, 1, 1>
- texture {
- pigment {
- checker color Red color White
- scale 0.25 // Affects only the color pattern
- }
- normal {
- bumps 0.3 // Specifies apparent height of bumps
- scale 0.2 // Scales diameter and space between
- } // bumps; no effect on height nor color
- rotate y*45 // Affects the entire texture
- } // but not the object
- }
-
- Because rotations are always relative to the axis and scaling is relative
- to the origin, you will generally want to create an object at the origin and
- scale and rotate it first. Then you may translate it into its proper posi-
- tion. It is a common mistake to carefully position an object and then to
- decide to rotate it. Because a rotation of an object causes it to orbit the
- axis, the position of the object may change so much that it orbits out of
- the field of view of the camera!
-
- Similarly scaling after translation also moves an object unexpectedly.
- If you scale after you translate, the scale will multiply the translate
- amount. For example:
- translate <5, 6, 7>
- scale 4
- will translate to 20, 24, 28 instead of 5, 6, 7. Be careful when transfor-
- ming to get the order correct for your purposes.
-