EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 429

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
normalize 429
typeIndicator Optional. Specifies the type of the new texture. If omitted, the new texture is
created with no specific type. Valid values include the following:
• #fromCastMember (a cast member)
• #fromImageObject (a Lingo image object)
sourceObjectReference Optional. Specifies a reference to the source cast member or Lingo
image object. If omitted, the new texture is created from no specific source.
sourceObjectReference must refer to a cast member if typeIndicator is #fromCastMember,
and it must refer to a Lingo image object if
typeIndicator is #fromImageObject.
Example
The first line of this statement creates a new texture called Grass 02 from cast member 5 of
castlib 1. The second line creates a blank new texture called Blank.
member("3D World").newTexture("Grass \
02",#fromCastMember,member(5,1))
member("3D World").newTexture("Blank")
normalize
Usage
normalize(vector)
vector.normalize()
Description
3D command; normalizes a vector by dividing the x, y, and z components by the vector’s
magnitude. Vectors that have been normalized always have a magnitude of 1.
Parameters
None.
Example
This statement shows the value of the vector MyVec before and after being normalized:
MyVec = vector(-209.9019, 1737.5126, 0.0000)
MyVec.normalize()
put MyVec
-- vector(-0.1199, 0.9928, 0.0000)
put MyVec.magnitude
-- 1.0000
This statement shows the value of the vector ThisVector before and after being normalized.
ThisVector = vector(-50.0000, 0.0000, 0.0000)
normalize(ThisVector)
put ThisVector
-- vector(-1.0000, 0.0000, 0.0000)
See also
getNormalized, randomVector(), magnitude