data-id=javascript-objects-for-acrobat-3d
JavaScript Objects for Acrobat 3D
Note
A property labeled as R (read-only) is one whose value cannot be set. An object labeled as R (read-only) is one whose reference cannot be modified, though the object itself can be set and its properties may be modified. Unless otherwise indicated, all properties and objects labeled with R/W have read/write access.
data-id=animation
Animation
A type of SceneObject, used to store keyframe animation sequences of Node objects in the Scene. In addition to the methods and properties below, it also contains the same methods and properties as a SceneObject.
Properties
Animation, measured in seconds.data-id=background
Background
Represents the background of a Canvas. It can be used as a target of a MouseEventHandler. (See Canvas and MouseEventHandler.)
Properties
Image to be used by the Background.FlashMovie to be used by the Background. FlashMovie replaces any Image or Color currently being used by the Backgrounddata-id=getcolor
getColor
Obtains the background Color.
Syntax
getColor()
Returns
A Color object representing the background color of the Canvas.
data-id=getimage
getImage
Deprecated
Obtains the background Image.
Syntax
getImage()
Returns
An Image object representing the background image of the Canvas.
data-id=setcolor
setColor
Sets the background Color. If only one color is passed to this method, the background is a constant color. If two colors are passed to this method, the background is a linear gradient from top to bottom, with the first color argument representing the top color and the second representing the bottom color.
Syntax
setColor(topColor, bottomColor)
Parameters
Color object representing the desired background color. If bottomColor is used, topColor represents the top background color used in a linear gradient.Color object representing the bottom background color used in a linear gradient.Returns
undefined
data-id=setimage
setImage
Deprecated
Sets the background Image.
Syntax
setImage(image)
Parameters
Image object representing the desired background image.Returns
undefined
data-id=bone
Bone
A type of Node used to modify the shape of a Mesh, and is usually moved over time to create animated characters. It contains the same methods and properties as a Node.
Related objects are Node and Mesh.
data-id=boundingbox
BoundingBox
Represents an axis-aligned bounding box.
Properties
BoundingBox center.BoundingBox corner with the greatest x, y, and z values.BoundingBox corner with the smallest x, y, and z values.data-id=camera
Camera
A Node that controls the projection from world space to screen space. In addition to the methods and properties below, it also contains the same methods and properties as a Node.
Properties
"min" * "max" * "horizontal" * "vertical""horizontal"."max"."min"."vertical".Camera to the far clipping plane. A value of -1 for both near and far signifies to use auto clipping plane calculations.Camera objects, measured in radians.Camera to the near clipping plane. A value of -1 for both near and far signifies to use auto clipping plane calculations.Camera in world space.Camera in local space."perspective" * "orthographic"Camera, measured in radians.Node used as the Camera object’s target.Camera object’s target in world space.Camera object’s target in local space."orthographic"."perspective".Camera objects, measured in scene units.data-id=getscreenfromposition
getScreenFromPosition
Obtains the screen coordinates of the provided 3D position.
Syntax
getScreenFromPosition(position, canvasWidth, canvasHeight)
Parameters
Vector3 object representing the 3D position.Canvas, measured in pixels.Canvas, measured in pixels.Returns
A Vector3 object representing the screen coordinates, with x and y as pixel positions and z equal to zero.
See Vector3 for more information on the return object.
data-id=getdirectionfromscreen
getDirectionFromScreen
Obtains the direction from the normalized coordinates
Syntax
getDirectionFromScreen(x, y, canvasWidth, canvasHeight)
Parameters
Canvas, measured in pixels.Canvas, measured in pixels.Returns
A Vector3 object representing the direction.
See Vector3 for more information on the return object.
data-id=cameraevent
CameraEvent
Describes the format of the object that is passed as an argument to the onEvent method of the CameraEventHandler object.
Properties
Canvas in which the event took place.Camera to the far clipping plane. A value of -1 for both near and far signifies to use auto clipping plane calculations.Camera objects, measured in radians.Canvas.Camera to the near clipping plane. A value of -1 for both near and far signifies to use auto clipping plane calculations.Camera to its target.data-id=cameraeventhandler
CameraEventHandler
Exposes a callback mechanism that allows a function to be evaluated when an camera event occurs. Event handlers are registered with the Runtime addEventHandler method.
data-id=cameraeventhandler-1
data-id=id1
CameraEventHandler
A constructor that creates a new CameraEventHandler object.
Syntax
new CameraEventHandler()
Returns
A CameraEventHandler object.
data-id=onevent
onEvent
A method that is called when a view is selected from the list of views on the 3D toolbar or in the context menu for an active 3D annotation.
syntax
onEvent(event)
Parameters
CameraEvent object representing the event.Returns
undefined
data-id=canvas
Canvas
Represents a rectangular region into which the Scene is rendered from the viewpoint of the attached Camera.
See related objects, Scene and Camera.
Properties
Background object associated with the Canvas.data-id=getcamera
getCamera
Obtains the Camera object attached to the Canvas.
Syntax
getCamera()
Returns
A Camera object.
data-id=setcamera
setCamera
Sets the Camera object attached to the Canvas.
Syntax
setCamera(camera)
Parameters
Camera object used to set the object’s value.Returns
undefined
data-id=clippingplane
ClippingPlane
An object representing a plane, within the Scene, that clips all geometry on one side of it. It is created by invoking the createClippingPlane method of the Scene object.
data-id=remove
remove
Removes the ClippingPlane object from the Scene.
Syntax
remove()
Returns
undefined
data-id=color
Color
An object that represents a RGB encoded color.
Properties
0.0 to 1.0.0.0 to 1.0.0.0 to 1.0.data-id=color-1
data-id=id2
Color
A constructor that creates a Color object, initialized to black.
Syntax
new Color()
Returns
A Color object, initialized to black.
data-id=color-2
data-id=id3
Color
A constructor that creates a Color object, initialized to the supplied RGB values.
Syntax
new Color(r, g, b)
Parameters
0.0 to 1.0.0.0 to 1.0.0.0 to 1.0.Returns
A Color object, initialized to the supplied RGB values.
data-id=set
set
Sets the Color object’s value using an existing Color object
Syntax
set(color)
Parameters
Color object used to set the object’s value.Returns
undefined
data-id=set-1
data-id=id4
set
Acrobat 7.0.7
Sets the Color object’s value using the given RGB components.
Syntax
set(r, g, b)
Parameters
0.0 to 1.0.0.0 to 1.0.0.0 to 1.0.Returns
undefined
data-id=set3
set3
Deprecated
Sets the Color object’s value using the given RGB components.
Syntax
set3(r, g, b)
Parameters
0.0 to 1.0.0.0 to 1.0.0.0 to 1.0.Returns
undefined
data-id=console
Console
This object can direct output to the JavaScript console in Acrobat for debugging purposes. The variable console is a global reference to this object.
data-id=print
Prints a string to the JavaScript Console.
Syntax
print(string)
Parameters
Returns
undefined
data-id=println
println
Prints a string with an accompanying newline to the JavaScript Console.
Syntax
println(string)
Parameters
Returns
undefined
data-id=dummy
Dummy
Deprecated
A Node object used as an empty placeholder or a group within a Scene.
data-id=flashevent
FlashEvent
Acrobat 9.0
An object that is passed as an argument to the onEvent method of the FlashEventHandler object.
Properties
FlashEvent of type "command", this is the string representation of the command that has been sent through the ActionScript FSCommand function or through the ExternalInterface.call method. To execute the command, run the JavaScript function eval with the command string as an argument.FlashMovieFlashMovie that the FlashEvent is from.FlashEvent, which can be "command", "progress", or "stateChange".FlashEvent type of "command".FlashEvent type of "progress".FlashEvent type of "stateChange".FlashEvent. The interpretation of value depends on the event type, "progress" or "stateChange". "progress" : value is an integer from 0 to 100 representing the load progress of the FlashMovie. "stateChange" : value is an integer signifying the ready state of the FlashMovie. Permitted values are 0 (Loading), 1 (Uninitialized), 2 (Loaded), 3 (Interactive), 4 (Complete).data-id=flasheventhandler
FlashEventHandler
Acrobat 9.0
An object that exposes a callback mechanism that allows a function to be evaluated when an event occurs in a FlashMovie object. Event handlers are registered with the Runtime. addEventHandler method.
Properties
FlashMovieFlashEventHandler will only report FlashEvents from the provided target FlashMovie.data-id=onevent-1
data-id=id5
onEvent
A method that is called when an ExternalInterface.call method or MMExecute command is invoked from the FlashMovie ‘s ActionScript.
Syntax
onEvent(event)
Parameters
Returns
undefined
data-id=flasheventhandler-1
data-id=id6
FlashEventHandler
The constructor that creates a new FlashEventHandler.
Syntax
new FlashEventHandler()
Returns
A FlashEventHandler object.
data-id=flashmovie
FlashMovie
Acrobat 9.0
An object that represents a Flash movie in the Scene.
Properties
FlashMovie scaleMode type of " bottom ".FlashMovie scaleMode type of " left ".FlashMovie scaleMode type of " right ".FlashMovie scaleMode type of " top ".FlashMovie content to be rendered at.FlashMovie content to be rendered at.FlashMovie to elements in the scene behind it. If true, mouse events are trapped.FlashMovie in the scene.true, the animation loops. If false, it plays only once.FlashMovie represented by a value from 0.0 to 1.0, where 1.0 is completely opaque.true, it is playing. If false, it is paused.0 (Low), 1 (High), 2 (AutoLow), and 3 (AutoHigh).FlashMovie. Permitted values are 0 (Loading), 1 (Uninitialized), 2 (Loaded), 3 (Interactive), 4 (Complete)."custom", "movie", and "window".FlashMovie resolution type of "custom".FlashMovie resolution type of "movie".FlashMovie resolution type of "window"."exact fit", "no border", or "show all".FlashMovie scaleMode type of "exact fit".FlashMovie ‘s scaleMode type of "no border".FlashMovie scaleMode type of "show all".ReadyState = 4.FlashMovie in the Canvas. Applies only to a FlashMovie if it is attached to the Foreground.FlashMovie in the Canvas. Applies only to a FlashMovie if it is attached to the Foreground.data-id=flashmovie-1
data-id=id7
FlashMovie
Creates a new FlashMovie from a Resource of type "flash".
Syntax
FlashMovie(FlashMovieResource)
Parameters
Resource of type "flash".Returns
A FlashMovie object.
data-id=call
call
Calls into ActionScript with the ExternalInterface calling convention to an exposed method (ExternalInterface.addCallback in ActionScript). The call method returns the return value of the method specified as the first parameter.
Note
See the Acrobat JavaScript API Reference which has the
callASmethod of the AnnotRichMedia object that uses the same mechanism as thecallmethod.
Syntax
call(functionName, [argument1[, ...,argumentn]])
Parameters
FlashMovie ActionScript engine.Returns
The return value from the called function, which can be of any type.
data-id=getvariable
getVariable
A method that returns the value of the Flash variable specified by varName, and returns undefined if the variable does not exist.
Syntax
getVariable(varName)
Parameters
Returns
A string representing the value of the specified Flash variable, or undefined.
data-id=gotoframe
gotoFrame
Activates the frame number specified by frameNumber in the current movie. If the data for a requested frame is not yet available, the player goes to the last frame available and stops, causing unexpected results during playback. Use the percentLoaded property to determine if enough of the movie is available to execute the gotoFrame() method. The argument frameNumber is zero-based; that is, frameNumber is 0 in the first frame of the movie, 1 for the second frame, and so on. This differs from the Goto action within Flash, which begins at 1.
Syntax
gotoFrame(frameNumber)
Parameters
Returns
undefined
data-id=isplaying
isPlaying
A method that returns true if the movie is currently playing.
Syntax
isPlaying()
Returns
A Boolean type, true if the movie is playing, false otherwise.
data-id=pan
pan
This method pans a zoomed-in movie to the coordinates specified by x and y. Use mode to specify whether the values for x and y are pixels or a percentage of the window. The pan method does not pan beyond the boundaries of the zoomed-in movie.
Syntax
pan(x, y, mode)
Parameters
mode is 0, the coordinates are pixels; when mode is 1, the coordinates are a percentage of the window.Returns
undefined
data-id=play
play
Starts playing the movie.
Syntax
play()
Returns
undefined
data-id=rewind
rewind
Goes to the first frame.
Syntax
rewind()
Returns
undefined
data-id=setvariable
setVariable
Sets the value of the Flash variable specified by variableName to the value specified by value.
Syntax
setVariable(varName, value)
Parameters
Returns
undefined
data-id=setzoomrect
setZoomRect
Zooms in on a rectangular area of the movie. The units of the coordinates are measured in twips (1440 units per inch).
Note
To calculate the dimensions of a rectangle in the correct units, set the ruler units to Points and multiply the coordinates by 20 to get twips. (There are 72 points per inch.)
Syntax
setZoomRect(left, top, right, bottom)
Parameters
Returns
undefined
data-id=stop
stop
Stops playing the movie.
Syntax
stop()
Returns
undefined
data-id=zoom
zoom
This method zooms the view by a relative scale factor specified by percentage. For example, zoom(50) doubles the size of the objects in the view, zoom(200) reduces the size of objects in the view by one half, and zoom(0) resets the view to 100%. You cannot specify a scale factor that will zoom-out the original content further than 100%.
Syntax
zoom(percentage)
Parameters
Returns
undefined
data-id=hitinfo
HitInfo
The object returned when a hit test occurs during a MouseEvent.
Properties
Camera to the HitInfo object’s position.data-id=host
Host
Acrobat 7.0.7
An object that provides access to the JavaScript engine context and to pertinent objects within it. The variable host is a global reference to this object. It is a reference to the JavaScript Doc object in which the 3D annotation is contained.
data-id=image
Image
An object that represents an image.
Properties
data-id=image-1
data-id=id8
Image
A constructor that creates an new Image object.
Syntax
new Image(resource)
Parameters
Image object used to create the new object.Returns
An Image object.
See Image for more information about the return object.
data-id=keyevent
KeyEvent
An object that is passed as an argument to the onEvent method of the KeyEventHandler object.
Properties
Canvas in which the KeyEvent took place.Canvas.Canvas.KeyEvent.characterCode property.data-id=keyeventhandler
KeyEventHandler
An object that exposes a callback mechanism that allows a function to be evaluated when a key event occurs. Event handlers are registered with the Runtime addEventHandler method.
data-id=keyeventhandler-1
data-id=id9
KeyEventHandler
A constructor that creates a new KeyEventHandler object.
Syntax
new KeyEventHandler()
Returns
A KeyEventHandler object.
data-id=onevent-2
data-id=id10
onEvent
A method that is called when a key is pressed.
Syntax
onEvent(event)
Parameters
KeyEvent object representing the event.Returns
undefined
data-id=light
Light
A Node object that illuminates meshes in the Scene.
There are different types of Light objects, each with their own distinct behavior. Infinite Light objects behave much like sunlight in that they cast parallel light in a given direction. Spot Light objects have a fixed cone angle that limits their beam to a conical projection. Point Light objects act similarly to a light bulb, where the light comes from a specific location in 3D space. Currently, none of the Light objects cast shadows.
In addition to the methods and properties that follow, the Light object also contains the same methods and properties as a Node.
Properties
a coefficient for attenuationType "abc".b coefficient for attenuationType "abc".c coefficient for attenuationType "abc".Light object being represented. Attenuation determines how fast the light intensity decreases with distance. The attenuation type of "abc" uses the equation 1 / max( ( a + bd + cdd), 1) to determine the intensity where d is the distance from the light. One of the following values may be assigned: * "abc". * "none"attenuationType of "abc".attenuationType of "none".Light. A value of 1 represents a brightness of 100%, though the property may be assigned higher values.Node.direction in which the light is of uniform full density.direction outside of which the light’s intensity is zero.Light object.Light object relative to its parent Node.Light object being represented. One of the following values may be assigned: * “point” * “spot” * “infinite”Light type of "infinite".Light type of "point".Light type of "spot".data-id=material
Material
A SceneObject that controls the appearance of materials using the fixed function shader. In addition to the properties below, it contains the same methods and properties as a SceneObject.
Properties
0.0 to 1.0.specularColor is the color of the highlight on the material.data-id=attachflashmovie
attachFlashMovie
Acrobat 9.0
Sets the provided FlashMovie as the diffuse texture for the Material.
Syntax
attachFlashMovie(movie)
Parameters
FlashMovie object to be used as the diffuse texture.Returns
undefined
data-id=matrix4x4
Matrix4x4
A four-by-four matrix commonly used for transformations.
Properties
data-id=matrix4x4-1
data-id=id11
Matrix4x4
A constructor that creates a new Matrix4x4 object initialized to the identity matrix.
Syntax
new Matrix4x4()
Returns
A Matrix4x4 object initialized to the identity matrix.
data-id=matrix4x4-2
data-id=id12
Matrix4x4
A constructor that creates a new Matrix4x4 object initialized to the specified matrix.
Syntax
new Matrix4x4(matrix)
Parameters
Matrix4x4 object used to initialize the new matrix.Returns
A Matrix4x4 object initialized to the specified matrix.
data-id=invertinplace
invertInPlace
Inverts the matrix.
Returns
undefined
data-id=isequal
isEqual
Determines whether the current matrix is equal to the specified matrix.
Syntax
isEqual(matrix)
Parameters
Matrix4x4 object used for the comparison.Returns
Returns true if the matrices are equal, false otherwise.
data-id=multiply
multiply
Multiplies the current matrix by the specified matrix.
Syntax
multiply(matrix)
Parameters
Matrix4x4 object used for the multiplication.Returns
A Matrix4x4 object.
data-id=multiplyinplace
multiplyInPlace
Multiplies the current matrix by the specified matrix, and updates the current matrix with the resulting value.
Syntax
multiplyInPlace(matrix)
Parameters
Matrix4x4 object used for the multiplication.Returns
undefined
data-id=rotatewithquaternion
rotateWithQuaternion
Rotates the current matrix using the specified Quaternion.
Syntax
rotateWithQuaternion(quaternion)
Parameters
Quaternion object used for the rotation.Returns
A Matrix4x4 object.
data-id=rotatewithquaternioninplace
rotateWithQuaternionInPlace
Rotates the current matrix using the specified quaternion, and updates the current matrix with the resulting value.
Syntax
rotateWithQuaternionInPlace(quaternion)
Parameters
Quaternion object used for the rotation.Returns
undefined
data-id=rotateaboutline
rotateAboutLine
Rotates the current matrix about the specified line.
Syntax
rotateAboutLine(angle, start, end)
Parameters
Vector3 object used to specify the beginning of the line of rotation, which is represented by start - end.Vector3 object used to specify the end of the line of rotation, which is represented by start - end.Returns
A Matrix4x4 object.
data-id=rotateaboutlineinplace
rotateAboutLineInPlace
Rotates the current matrix about the specified line, and updates the current matrix with the resulting value.
Syntax
rotateAboutLineInPlace(angle, start, end)
Parameters
Vector3 object used to specify the line of rotation, which is represented by start - end.Vector3 object used to specify the line of rotation, which is represented by start - end.Returns
undefined
data-id=rotateaboutx
rotateAboutX
Rotates the current matrix about the x axis.
Syntax
rotateAboutX(angle)
Parameters
Returns
A Matrix4x4 object.
data-id=rotateaboutxinplace
rotateAboutXInPlace
Rotates the current matrix about the x axis, and updates the current matrix with the resulting value.
Syntax
rotateAboutXInPlace(angle)
Parameters
Returns
undefined
data-id=rotateaboutvector
rotateAboutVector
Rotates the current matrix about the specified vector.
Syntax
rotateAboutVector(angle, axis)
Parameters
Vector3 object about which the matrix is rotated.Returns
A Matrix4x4 object.
data-id=rotateaboutvectorinplace
rotateAboutVectorInPlace
Rotates the current matrix about the specified vector, and updates the current matrix with the resulting value.
Syntax
rotateAboutVectorInPlace(angle, axis)
Parameters
Vector3 object about which the matrix is rotated.Returns
undefined
data-id=rotateabouty
rotateAboutY
Rotates the current matrix about the y axis.
Syntax
rotateAboutY(angle)
Parameters
Returns
A Matrix4x4 object.
data-id=rotateaboutyinplace
rotateAboutYInPlace
Rotates the current matrix about the y axis, and updates the current matrix with the resulting value.
Syntax
rotateAboutYInPlace(angle)
Parameters
Returns
undefined
data-id=rotateaboutz
rotateAboutZ
Rotates the current matrix about the z axis.
Syntax
rotateAboutZ(angle)
Parameters
Returns
A Matrix4x4 object.
data-id=rotateaboutzinplace
rotateAboutZInPlace
Rotates the current matrix about the z axis, and updates the current matrix with the resulting value.
Syntax
rotateAboutZInPlace(angle)
Parameters
Returns
undefined
data-id=scale
scale
Scales the current matrix using the specified scaling components.
Syntax
scale(x, y, z)
Parameters
Returns
A Matrix4x4 object.
data-id=scaleinplace
scaleInPlace
Scales the current matrix using the specified scaling components, and updates the current matrix with the resulting value.
Syntax
scaleInPlace(x, y, z)
Parameters
Returns
undefined
data-id=set-2
data-id=id13
set
Sets the value of the current matrix using the specified matrix.
Syntax
set(matrix)
Parameters
Returns
undefined
data-id=set-3
data-id=id14
set
Acrobat 8.1
Sets the value of the current matrix using an array.
Syntax
set( array )
Parameters
Returns
undefined
data-id=set-4
data-id=id15
set
Acrobat 8.1
Sets the value of the current matrix using 16 numeric values.
Syntax
set(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15)
Parameters
Returns
undefined
data-id=setidentity
setIdentity
Sets the value of the current matrix to the identity matrix.
Syntax
setIdentity()
Returns
undefined
data-id=setview
setView
Sets the current matrix according to the specified component vectors.
Syntax
setView(position, direction, up)
Parameters
Vector3 object used to specify the position component.Vector3 object used to specify the direction component.Vector3 object used to specify the upward component.Returns
undefined
data-id=transformdirection
transformDirection
Transforms the specified vector by the current matrix.
Syntax
transformDirection(vector)
Parameters
Vector3 object to be transformed.Returns
A Vector3 object.
data-id=transformposition
transformPosition
Transforms the specified position by the current matrix.
Syntax
transformPosition(position)
Parameters
Vector3 object representing the position to be transformed.Returns
A Vector3 object.
data-id=translate
translate
Translates the current matrix by the components of the specified vector.
Syntax
translate(translation)
Parameters
Vector3 object whose components are used to perform the matrix translation.Returns
A Matrix4x4 object.
data-id=translateinplace
translateInPlace
Translates the current matrix by the components of the specified vector, and updates the current matrix with the resulting value.
Syntax
translateInPlace(translation)
Parameters
Vector3 object whose components are used to perform the matrix translation.Returns
undefined
data-id=transposeinplace
transposeInPlace
Sets the value of the current matrix to its transpose.
Syntax
transposeInPlace()
Returns
undefined
data-id=menuevent
MenuEvent
An object that is passed as an argument to the onEvent method of the MenuEventHandler object.
Properties
Canvas in which the MenuEvent took place.data-id=menueventhandler
MenuEventHandler
A MenuEventHandler object exposes a callback mechanism that allows a function to be evaluated when an event occurs. Event handlers are registered with the Runtime addEventHandler method.
data-id=menueventhandler-1
data-id=id16
MenuEventHandler
A constructor that creates a new MenuEventHandler object.
Syntax
new MenuEventHandler()
Returns
A MenuEventHandler object.
data-id=onevent-3
data-id=id17
onEvent
A method that is called when a custom menu item is selected on the context menu for an active 3D annotation.
Syntax
onEvent(event)
Parameters
MenuEvent object representing the event.Returns
undefined
data-id=mesh
Mesh
A Node object that contains geometry. A Mesh object with no geometry has children Node objects that can be transformed as a group. In addition to the methods and properties below, it contains the same methods and properties as a Node.
Properties
Mesh object’s default Material.Mesh object’s rendering style, which can be one of the following values: * "default" * "bounding box" * "transparent bounding box" * "transparent bounding box outline" * "vertices" * "shaded vertices" * "wireframe" * "shaded wireframe" * "solid" * "transparent" * "solid wireframe" * "transparent wireframe" * "illustration" * "solid outline" * "shaded illustration" * "hidden wireframe"data-id=computeboundingbox
computeBoundingBox
Acrobat 7.0.7
Computes the bounds of the Node object.
Syntax
computeBoundingBox()
Returns
A BoundingBox object.
data-id=setcolor-1
data-id=id18
setColor
Acrobat 11
Sets the color, either for the entire mesh or for any one of the faces of the mesh. setColor can be called several time for the same mesh, either to change the color of the entire mesh or to change the color of the faces.
Syntax
setColor(color,faceIndex)
Parameters
Color object representing the desired color. Omit this parameter to reset the color and return to the original color (the one read from the PRC or U3D file).faceIndex is out of bounds, no action is performed by this method.Returns
undefined.
data-id=mouseevent
MouseEvent
An object that is passed as an argument to the onEvent method of the MouseEventHandler object.
Properties
Canvas in which the MouseEvent took place.Canvas in which the MouseEvent took place.Canvas in which the MouseEvent took place.HitInfo objects ordered by distance from nearest to furthest.Canvas.Canvas.data-id=mouseeventhandler
MouseEventHandler
An object that exposes a callback mechanism that allows a function to be evaluated when a mouse event occurs. The handler may be customized to filter out certain event types. Event handlers are registered with the Runtime addEventHandler method.
Properties
MouseEvent hits property.Node hitEnabled property.false, a hit test is not performed except on a mouse-down or mouse-up event. This is an optimization feature because the current hit test is extremely expensive on complex models. When set to false, the following events are not reported because they depend on hit testing: * mouse-hit * mouse-move * mouse-out * mouse-overMesh or Background object on which the mouse event occurs.data-id=mouseeventhandler-1
data-id=id19
MouseEventHandler
A constructor that creates a new MouseEventHandler object.
Syntax
new MouseEventHandler()
Returns
A MouseEventHandler object.
data-id=onevent-4
data-id=id20
onEvent
A method that is called when a mouse event occurs.
Syntax
onEvent(event)
Parameters
MouseEvent object representing the event.Returns
undefined
data-id=node
Node
An object within the Scene hierarchy (a SceneObject) that has a 3D representation. The following objects are considered Node objects:
To obtain a Node object’s type, use the standard JavaScript constructor property. For example, the following syntax prints the Node object’s type to the console:
console.println(myNode.constructor.name);
In addition to the methods and properties below, it contains the same methods and properties as a SceneObject.
Properties
Node object’s first child.Node is included in hit tests. The default value is true.Node.Node -specific metadata.Node opacity. A value from 0 to 1, where 1 is completely opaque.Node object’s parent Node or Scene.Node.Color object used to determine the wireframe appearance.Node object should be shown. This property applies to mesh notes only. For example, modifying the empty parent node of a mesh tree has no effect on the child mesh tree items. In such cases it is recommended that you modify a parent node that is also a mesh node, and the child mesh items will have the same value for this property.data-id=detachfromcurrentanimation
detachFromCurrentAnimation
Removes the ability of the currently active Animation of the Node object to transform the Node.
Syntax
detachFromCurrentAnimation()
Returns
undefined
data-id=procedural
Procedural
Deprecated
A Node object used to represent procedurally created geometry, such as constructive solid geometry (CSG) solids, procedural spheres, or NURB objects (a 3D curve or surface). A Procedural object contains the same methods and properties as a Node.
data-id=quaternion
Quaternion
Represents a rotation in 3D space, and allows for smooth interpolation (blending) between orientations of subjects. A Quaternion is typically used for animating a Camera or Mesh over time, and can be converted to and from angles of rotation about the axes.
data-id=quaternion-1
data-id=id21
Quaternion
A constructor that initializes the object with the identity matrix.
Syntax
new Quaternion()
Returns
A Quaternion object.
data-id=quaternion-2
data-id=id22
Quaternion
A constructor that initializes the object with the specified rotation matrix.
Syntax
new Quaternion(matrix)
Parameters
Matrix4x4 object representing the rotation matrix.Returns
A Quaternion object.
data-id=quaternion-3
data-id=id23
Quaternion
A constructor that initializes the object with the specified Quaternion.
Syntax
new Quaternion(quaternion)
Parameters
Quaternion object used to initialize the new object.Returns
A Quaternion object.
data-id=interpolate
interpolate
Creates a Quaternion object interpolated from the current and specified Quaternion objects and a.
Syntax
interpolate(quaternion, a)
Parameters
Quaternion object used to interpolate the new object.0.0 to 1.0, that specifies the degree (percentage) of interpolation. A value of 0.5 represents an interpolation halfway between the current and specified Quaternion objects.Returns
A Quaternion object.
data-id=interpolateinplace
interpolateInPlace
Creates a Quaternion object interpolated from the current and specified Quaternion objects and a, and updates the current Quaternion object with the new value.
Syntax
interpolateInPlace(quaternion, a)
Parameters
Quaternion object used to interpolate the new object.0.0 to 1.0, that specifies the degree (percentage) of interpolation. A value of 0.5 represents an interpolation halfway between the current and specified Quaternion objects.Returns
A Quaternion object.
data-id=normalize
normalize
Normalizes the Quaternion object
Syntax
normalize()
Returns
undefined
data-id=renderevent
RenderEvent
An object that is passed as an argument to the onEvent method of the RenderEventHandler object.
Properties
Canvas that is the target of the RenderEvent.Canvas for which the RenderEvent is intended.Canvas for which the RenderEvent is intended.data-id=rendereventhandler
RenderEventHandler
An object that exposes a callback mechanism that allows a function to be evaluated when an event occurs. Event handlers are registered with the Runtime addEventHandler method. It issues a callback just before each Canvas is rendered.
data-id=rendereventhandler-1
data-id=id24
RenderEventHandler
A constructor that creates a new RenderEventHandler object.
Syntax
new RenderEventHandler()
Returns
A RenderEventHandler object.
data-id=onevent-5
data-id=id25
onEvent
A method that is called immediately before the Canvas is rendered.
Syntax
onEvent(event)
Parameters
RenderEvent object representing the event.Returns
undefined
data-id=renderoptions
RenderOptions
An object that describes the style with which to render Node objects in the Scene.
Properties
Color object to be applied to the bounding box.Color object to be applied to the clipping plane.Color object to be applied to the clipping plane intersection.Color object to be applied to the default ambient Material.Color object to be applied to the default diffuse Material.Color object to be applied to the default emissive Material.Color object to be applied to the default specular Material.Color object to be applied to the illustration lines.Color object to be applied to the vertices in point render mode.Color object to be applied to the shaded illustration lines.Color object to be applied to the solid or transparent lines in render mode.Color object to be applied to the transparent bounding box.data-id=resource
Resource
An object that creates an abstraction for loading behavior in files and streams.
Properties
Resource object, which can be one of the following values: * "image" * "model" * "flash" (Acrobat 9.0) * "unknown"Resource type of "image".Resource type of "model".Resource type of "unknown"."flash".data-id=resource-1
data-id=id26
Resource
A constructor that creates a new Resource.
Syntax
new Resource(pathname)
Parameters
Returns
A Resource object.
data-id=runtime
Runtime
An object that represents the run-time instance of the player. Each Runtime object can have its own unique script engine and set of annotations. The variable runtime is a global reference to this object.
Properties
addCustomToolButton method.addCustomToolButton method.Annot3D objects that are attached to the 3D script context.addCustomMenuItem method.addCustomMenuItem method."Fly"."Measure".Pan"."Rotate"."Spin"."Walk"."Zoom".Runtime system.data-id=addcustommenuitem
addCustomMenuItem
Creates a custom menu item in the 3D annotation context menu.
Syntax
addCustomMenuItem(name, label, type, checkedState)
Parameters
"default" - "checked"Returns
undefined
data-id=addcustomtoolbutton
addCustomToolButton
Creates a custom tool button in the 3D toolbar.
Syntax
addCustomToolButton(name, label, type)
Parameters
"tool button" - "push button"Returns
undefined
data-id=addeventhandler
addEventHandler
Registers the provided event handler.
Syntax
addEventHandler(eventHandler)
Parameters
Returns
undefined
data-id=disabletool
disableTool
Disables the tool with the specified ID.
Syntax
disableTool(toolName)
Parameters
Returns
undefined
data-id=enabletool
enableTool
Enables the tool with the specified ID.
Syntax
enableTool(toolName)
Parameters
Returns
undefined
data-id=geteventhandler
getEventHandler
Obtains the event handler corresponding to the specified index.
Syntax
getEventHandler(index)
Parameters
Returns
An event handler object.
data-id=getrenderername
getRendererName
Obtains the name of the current renderer.
Syntax
getRendererName()
Returns
A string containing the current renderer’s name.
data-id=getview
getView
Acrobat 9.0
Gets the indicated view for the annotation by its index.
See the related method, setView, for setting the view by its index.
Syntax
getView( index )
Parameters
Returns
View
data-id=getview-1
data-id=id27
getView
Acrobat 9.0
Gets the indicated view for the annotation by its name.
See the related method, setView, for setting the view by its name.
Syntax
getView( name )
Parameters
Returns
View
data-id=pause
pause
Acrobat 9.0
Pauses the runtime. This is the same as selecting the Pause toolbar button or menu item.
Syntax
pause()
Returns
undefined
data-id=play-1
data-id=id28
play
Acrobat 9.0
Resumes playback of the runtime. This is the same as selecting the Play toolbar button or menu item.
Syntax
play()
Returns
undefined
data-id=refresh
refresh
Version 7.0.1
Marks the render area dirty so that it is redrawn. This is useful when something changes in the scene but the annotation is in a Loaded and not Live state.
Syntax
refresh()
Returns
undefined
data-id=removeeventhandler
removeEventHandler
Unregisters the specified event handler.
Syntax
removeEventHandler(handler)
Parameters
Returns
undefined
data-id=removecustommenuitem
removeCustomMenuItem
Removes the custom menu item with the specified ID.
Syntax
removeCustomMenuItem(menuName)
Parameters
Returns
undefined
data-id=removecustomtoolbutton
removeCustomToolButton
Removes the custom tool button with the specified ID.
Syntax
removeCustomToolButton(toolName)
Parameters
Returns
undefined
data-id=setcurrenttool
setCurrentTool
Sets the current tool to the one with the specified ID.
Syntax
setCurrentTool(toolName)
Parameters
Returns
undefined
data-id=setcustommenuitemchecked
setCustomMenuItemChecked
Acrobat 7.0.7
Sets the checked state of the provided custom menu item.
Syntax
setCustomMenuItemChecked( menuItemName, checkedState )
Parameters
Returns
undefined
data-id=setview-1
data-id=id29
setView
Acrobat 9.0.
Sets the current view for the annotation.
See the related method, getView, for getting the view by its index.
Syntax
setView( index, animate)
Parameters
true, indicates that the view should be animated to when set.Returns
undefined
data-id=setview-2
data-id=id30
setView
Acrobat 9.0
Sets the current view for the annotation.
See the related method, getView, for getting the view by its name.
Syntax
setView( name, animate)
Parameters
true, indicates that the view should be animated to when set.Returns
undefined
data-id=scene
Scene
An object that represents the hierarchy of the 3D related content, including Animation, Light, Material, and Mesh objects. The variable scene is a global reference to this object.
Related objects are Animation, Light, Material and Mesh.
Properties
Color of all materials.Animation objects.Camera objects in the Scene.Scene.Scene. It can have one of the following values: * "off" (no grid) * "wire" (a wireframe grid) * "solid"( a solid checkerboard grid) * "transparent" (a semi-transparent checkerboard grid)"off"."solid"."transparent"."wire"."file"."none"."white"."day"."bright"."rgb"."night"."blue"."red"."cube"."cad"."headlamp".Light objects in the Scene.Light objects in the Scene.Scene. It can take one of the following values: * "file" * "none" * "white" * "day" * "bright" * "rgb" * "night" * "blue" * "red" * "cube" * "cad" * "headlamp"Material objects.Mesh objects in the Scene.Node objects except the default Camera and default Light objects.Scene, which can be one of the following values: * "default" * "bounding box" * "transparent bounding box" * "transparent bounding box outline" * "vertices" * "shaded vertices" * "wireframe" * "shaded wireframe" * "solid" * "transparent" * "solid wireframe" * "transparent wireframe" * "illustration" * "solid outline" * "shaded illustration" * "hidden wireframe""default"."bounding box"."transparent bounding box"."transparent bounding box outline"."vertices"."shaded vertices"."wireframe"."shaded wireframe"."solid"."transparent"."solid wireframe"."transparent wireframe"."illustration"."solid outline"."shaded illustration"."hidden wireframe".true, smoothing is enabled for meshes in the scene.true, overrides the smoothing values from the loaded model file.data-id=activateanimation
activateAnimation
Sets the given Animation to be active on its Node objects.
Syntax
activateAnimation(animation)
Parameters
Animation object to be activated.Returns
undefined
data-id=addflashforeground
addFlashForeground
Acrobat 9.0
Adds the provided FlashMovie as a foreground element within the 3D scene.
Syntax
addFlashForeground(movie)
Parameters
FlashMovie to be added as a foreground element.Returns
undefined
data-id=addmodel
addModel
Adds a model Resource to the top level of the Scene.
Syntax
addModel(modelRes)
Parameters
Resource object to be added.Returns
A Node object representing the top-level Mesh of the loaded model.
data-id=createclippingplane
createClippingPlane
Creates a new clipping plane.
Syntax
createClippingPlane()
Returns
A ClippingPlane object.
data-id=createlight
createLight
Creates a new Light and attaches it to the Scene.
Syntax
createLight()
Returns
A Light object.
data-id=createsquaremesh
createSquareMesh
Creates a Mesh that is a unit square. The default UV parameterization fits once in U and V.
Syntax
createSquareMesh(sizeX, sizeY, name)
Parameters
Mesh.Mesh.Mesh.Returns
A Mesh object.
data-id=computeboundingbox-1
data-id=id31
computeBoundingBox
Computes the BoundingBox of the Scene.
Syntax
computeBoundingBox()
Returns
A BoundingBox object.
data-id=update
update
Applies all changes to the Scene.
Syntax
update()
Returns
undefined
data-id=sceneobject
SceneObject
The base type for objects within the Scene, including Animation, Material, and Node objects.
Related objects are Scene, Animation, Light, Material, and Mesh.
Properties
SceneObject object.SceneObject in custom data. This property has a default value.SceneObject. This property can be assigned, but it does not have a default value. It always returns 0.data-id=sceneobjectlist
SceneObjectList
A structure that contains references to several SceneObject objects.
Properties
SceneObjectList.data-id=getbyguid
getByGUID
Deprecated
Obtains the specified SceneObject object from the list.
Syntax
getByGUID(guid)
Parameters
Returns
A SceneObject object.
data-id=getbyid
getByID
Obtains the specified SceneObject object from the list
Syntax
getByID(id)
Parameters
SceneObject object.Returns
A SceneObject object.
data-id=getbyindex
getByIndex
Obtains the specified SceneObject object from the list.
Syntax
getByIndex(index)
Parameters
SceneObject object.Returns
A SceneObject object.
data-id=getbyname
getByName
Obtains the specified SceneObject object from the list.
Syntax
getByName(name)
Parameters
SceneObject object.Returns
A SceneObject object.
data-id=removeall
removeAll
Deprecated
Removes all the SceneObject objects from the list, but does not delete them from the Scene.
Syntax
removeAll()
Returns
undefined
data-id=removebyindex
removeByIndex
Deprecated
Removes the specified SceneObject object from the list, but does not delete it from the Scene.
Syntax
removeByIndex(index)
Parameters
Returns
undefined
data-id=removeitem
removeItem
Deprecated
Removes a SceneObject object from the list, but does not delete it from the Scene.
Syntax
removeItem(scene)
Parameters
Returns
undefined
data-id=scrollwheelevent
ScrollWheelEvent
(Acrobat 8.1) An object that is passed as an argument to the onEvent method of the ScrollWheelEventHandler object. A ScrollWheelEvent object is created when the mouse scroll wheel is activated over an active 3D Canvas object.
Properties
Canvas in which the ScrollWheelEvent took place.Canvas in which the ScrollWheelEvent took place.Canvas in which the ScrollWheelEvent took place.data-id=scrollwheeleventhandler
ScrollWheelEventHandler
(Acrobat 8.1) An object that exposes a callback mechanism that allows a function to be evaluated when an event occurs. Event handlers are registered with the Runtime method addEventHandler.
data-id=scrollwheeleventhandler-1
data-id=id32
ScrollWheelEventHandler
A constructor that creates a new ScrollWheelEventHandler.
Syntax
new ScrollWheelEventHandler()
Returns
A ScrollWheelEventHandler object.
data-id=onevent-6
data-id=id33
onEvent
A method that is called when the scroll wheel is used in an active 3D annotation.
Syntax
onEvent(event)
Parameters
ScrollWheelEvent object representing the event.Returns
undefined
data-id=selectionevent
SelectionEvent
(Acrobat 8.1) An object that is passed as an argument to the onEvent method of the SelectionEventHandler object.
A SelectionEvent object is created when an object is selected from an active 3D Canvas object or from a model tree. If the selection is made from a Canvas object, a MouseEvent is also created.
Properties
data-id=selectioneventhandler
SelectionEventHandler
(Acrobat 8.1) An object that exposes a callback mechanism that allows a function to be evaluated when an event occurs. Event handlers are registered with the Runtime method addEventHandler.
data-id=selectioneventhandler-1
data-id=id34
SelectionEventHandler
A constructor that creates a new SelectionEventHandler object.
Syntax
new SelectionEventHandler()
Returns
A SelectionEventHandler object.
data-id=onevent-7
data-id=id35
onEvent
A method that is called when the selection state changes in an active 3D annotation.
Syntax
onEvent(event)
Parameters
ScrollWheelEvent object representing the event.Returns
undefined
data-id=stateevent
StateEvent
Acrobat 9.0
An object that is passed as an argument to the onEvent method of the StateEventHandler object. A StateEvent object is created when state data must be stored or loaded for the scene, such as when a new comment view is created or invoked for the annotation.
Properties
SaveEvent type is "load", this property contains the state data that was stored as part of the corresponding "save" StateEvent. If the SaveEvent type is "save", the stateString is undefined.StateEvent, this property has a value of either "load" or "save".StateEvent type of "load". The state data that was stored as part of the original stateEvent.StateEvent type of "save".data-id=stateeventhandler
StateEventHandler
Acrobat 9.0
An object that exposes a callback mechanism that allows a function to be evaluated when a state event occurs. Event handlers are registered with the Runtime method addEventHandler.
data-id=onevent-8
data-id=id36
onEvent
A method that is called when state data must be stored or loaded for the annotation. The return value is stored as the stateString for the given StateEvent.
Syntax
onEvent(event)
Parameters
StateEvent object representing the event.Returns
string or undefined
data-id=stateeventhandler-1
data-id=id37
StateEventHandler
The constructor that creates a new StateEventHandler.
Syntax
new StateEventHandler()
Returns
A StateEventHandler
object.
data-id=texture
Texture
A Texture object represents the mapping of a texture. All Texture properties have read-write permissions.
Properties
Texture is applied, which can be a value from 0.0 to 1.0.Image to be used by the Texture.Texture with its corresponding color.data-id=getimage-1
data-id=id38
getImage
Deprecated
Gets the Image currently used by the Texture.
Syntax
getImage()
Returns
The Image currently being used.
data-id=setimage-1
data-id=id39
setImage
Deprecated
Sets the Image to be used by the Texture.
Syntax
setImage(image)
Parameters
Image to be used.Returns
undefined
data-id=timeevent
TimeEvent
An object that is passed as an argument to the TimeEventHandler object’s onEvent method.
Properties
data-id=timeeventhandler
TimeEventHandler
An object that exposes a callback mechanism that allows a function to be evaluated when an event occurs. Event handlers are registered with the Runtime addEventHandler method.
data-id=timeeventhandler-1
data-id=id40
TimeEventHandler
A constructor that creates a new TimeEventHandler object.
Syntax
new TimeEventHandler()
Returns
A TimeEventHandler object.
data-id=onevent-9
data-id=id41
onEvent
A method that is called when simulation time is incremented in an active 3D annotation.
Syntax
onEvent(event)
Parameters
TimeEvent object representing the event.Returns
undefined
data-id=toolevent
ToolEvent
An object that is passed as an argument to the onEvent method of the ToolEventHandler object.
Properties
Canvas that is the target of the ToolEvent.Canvas for which the ToolEvent is intended.Canvas for which the ToolEvent is intended.data-id=tooleventhandler
ToolEventHandler
An object that exposes a callback mechanism that allows a function to be evaluated when an event occurs. Event handlers are registered with the Runtime addEventHandler method.
data-id=tooleventhandler-1
data-id=id42
ToolEventHandler
A constructor that creates a new ToolEventHandler object.
Syntax
new ToolEventHandler()
Returns
A ToolEventHandler object.
data-id=onevent-10
data-id=id43
onEvent
A method that is called when a tool button is pressed on the 3D toolbar.
Syntax
onEvent(event)
Parameters
ToolEvent object representing the event.Returns
undefined
data-id=vector3
Vector3
An object comprised of three values that represent a point in space or a direction and magnitude.
Properties
Vector3 object.Vector3 object.Vector3 object.Vector3 object.data-id=vector3-1
data-id=id44
Vector3
A constructor that initializes the new object to (0.0, 0.0, 0.0).
Syntax
new Vector3()
Returns
A Vector3 object.
data-id=vector3-2
data-id=id45
Vector3
A constructor that initializes the new object to the specified components.
Syntax
new Vector3(x, y, z)
Parameters
Returns
A Vector3 object.
data-id=add
add
Adds the specified Vector3 to the current one.
Syntax
add(offset)
Parameters
Vector3 object to be added to the current one.Returns
A Vector3 object.
data-id=addinplace
addInPlace
Adds the specified Vector3 to the current one, and updates the current Vector3 with the resulting value.
Syntax
addInPlace(offset)
Parameters
Vector3 object to be added to the current one.Returns
undefined
data-id=addscaled
addScaled
Adds the specified Vector3 with the scaled offset to the current one.
Syntax
addScaled(offset, scale)
Parameters
Vector3 object to be added to the current one.offset.Returns
A Vector3 object.
data-id=addscaledinplace
addScaledInPlace
Adds the specified Vector3 with the scaled offset to the current one, and updates the current Vector3 with the resulting value.
Syntax
addScaledInPlace(offset, scale)
Parameters
Vector3 object to be added to the current one.offset.Returns
undefined
data-id=blend
blend
Blends the current and specified Vector3 by the specified degree.
Syntax
blend(vec, blendFactor)
Parameters
Vector3 object to be blended with the current one.0.0 to 1.0.Returns
A Vector3 object.
data-id=blendinplace
blendInPlace
Blends the current and specified Vector3 by the specified degree, and updates the current Vector3 with the resulting value.
Syntax
blendInPlace(vec, blendFactor)
Parameters
Vector3 object to be blended with the current one.0.0 to 1.0.Returns
undefined
data-id=cross
cross
Calculates the cross product between the specified Vector3 and the current one.
Syntax
cross(vec)
Parameters
Vector3 object to be used in calculating the cross product.Returns
A Vector3 object.
data-id=dot
dot
Calculates the dot product between the specified Vector3 and the current one.
Syntax
dot(vec)
Parameters
Vector3 object to be used in calculating the dot product.Returns
A number value representing the scalar dot product.
data-id=normalize-1
data-id=id46
normalize
Normalizes the current Vector3.
Syntax
normalize()
Returns
undefined
data-id=scale-1
data-id=id47
scale
Scales the current Vector3.
Syntax
scale(scale)
Parameters
Vector3.Returns
A Vector3 object.
data-id=scaleinplace-1
data-id=id48
scaleInPlace
Scales the current Vector3, and updates the current Vector3 with the resulting value.
Syntax
scaleInPlace(scale)
Parameters
Vector3.Returns
undefined
data-id=set-5
data-id=id49
set
Sets the current Vector3 to the value contained in the specified Vector3.
Syntax
set(vec)
Parameters
Vector3.Returns
undefined
data-id=set-6
data-id=id50
set
Acrobat 7.0.7
Sets the current Vector3 to the values contained in the specified components.
Syntax
set(x, y, z)
Parameters
Vector3.Vector3.Vector3.Returns
undefined
data-id=set3-1
data-id=id51
set3
Deprecated
Sets the current Vector3 to the values contained in the specified components.
Syntax
set3(x, y, z)
Parameters
Vector3.Vector3.Vector3.Returns
undefined
data-id=subtract
subtract
Subtracts the specified Vector3 from the current one.
Syntax
subtract(offset)
Parameters
Vector3 object to be subtracted from the current one.Returns
A Vector3 object.
data-id=subtractinplace
subtractInPlace
Subtracts the specified Vector3 from the current one, and updates the current Vector3 with the resulting value.
Syntax
subtractInPlace(offset)
Parameters
Vector3 object to be subtracted from the current one.Returns
undefined
data-id=view
View
Acrobat 9.0
An object that represents a named view for the annotation.
See the viewCount property and the getView and setView methods of the Runtime object.
Properties