dot()
295
doneParsing()
Usage
parserObject
.doneParsing()
Description
Function; returns
1 (TRUE)
when the parser has completed parsing a document using
parseURL()
. The return value is
0 (FALSE)
until the parsing is complete.
Parameters
None.
See also
parseURL()
dot()
Usage
vector1.
dot(
vector2
)
Description
3D vector method; returns the sum of the products of the x, y, and z components of two vectors.
If both vectors are normalized, the
dot
is the cosine of the angle between the two vectors.
To manually arrive at the dot of two vectors, multiply the x component of
vector1
by the x
component of
vector2
, then multiply the y component of
vector1
by the y component of
vector2
, then multiply the z component of
vector1
by the z component of
vector2
, and finally
add the three products together.
This method is identical to
dotProduct()
function.
Parameters
vector2
Required. The second vector from which a sum is returned.
Example
In this example, the angle between the vectors pos5 and pos6 is 45 degrees. The
getNormalized
function returns the normalized values of pos5 and pos6, and stores them in the variables norm1
and norm2. The
dot
of norm1 and norm2 is 0.7071, which is the cosine of 45 degrees.
pos5 = vector(100, 100, 0)
pos6 = vector(0, 100, 0)
put pos5.angleBetween(pos6)
-- 45.0000
norm1 = pos5.getNormalized()
put norm1
-- vector( 0.7071, 0.7071, 0.0000 )
norm2 = pos6.getNormalized()
put norm2
-- vector( 0.0000, 1.0000, 0.0000 )
put norm1.dot(norm2)
-- 0.7071
See also
dotProduct()
,
getNormalized
,
normalize
Summary of Contents for DIRECTOR MX 2004
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...