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
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...