View
15
Download
0
Category
Preview:
Citation preview
Acrobat 3D JavaScript Reference 1
Adobe Acrobat 7.0.7
3D JavaScript Reference
January 17, 2006
Adobe Solutions Network — http://partners.adobe.com
2 Acrobat 3D JavaScript Reference
Copyright 2005 Adobe Systems Incorporated. All rights reserved.
NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of the Adobe Systems Incorporated.
PostScript is a registered trademark of Adobe Systems Incorporated. All instances of the name PostScript in the text are references to the PostScript language as defined by Adobe Systems Incorporated unless otherwise stated. The name PostScript also is used as a product trademark for Adobe Systems’ implementation of the PostScript language interpreter.
Except as otherwise stated, any reference to a “PostScript printing device,” “PostScript display device,” or similar item refers to a printing device, display device or item (respectively) that contains PostScript technology created or licensed by Adobe Systems Incorporated and not to devices or items that purport to be merely compatible with the PostScript language.
Adobe, the Adobe logo, Acrobat, the Acrobat logo, Acrobat Capture, Distiller, PostScript, the PostScript logo and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Apple, Macintosh, and Power Macintosh are trademarks of Apple Computer, Inc., registered in the United States and other countries. HP-UX is a registered trademark of Hewlett-Packard Company. AIX is a trademark of International Business Machines Corporation in the United States and/or other countries, and PowerPC is a registered trademark of IBM Corporation in the United States. Lextek is a trademark of Lextek International. ActiveX, Microsoft, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group. Solaris is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. Verity is a registered trademark of Verity, Incorporated. All other trademarks are the property of their respective owners.
This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes, and noninfringement of third party rights.
Acrobat 3D JavaScript Reference 3
Contents
Contents
Acrobat 3D JavaScript API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Object Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Acrobat 3D JavaScript Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Animation Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Animation Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
currentTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20endTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20framesPerSecond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20startTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Background Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Background Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Background Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
getColor() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21getImage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21setColor( topColor, bottomColor ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21setImage( image ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Bone Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22BoundingBox Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22BoundingBox Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22max . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23min . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Camera Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Camera Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23BINDING_MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23BINDING_MIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24BINDING_HORIZONTAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24BINDING_VERTICAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24far . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24fov . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24near . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25positionLocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25projectionType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25roll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25targetPosition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25targetPositionLocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25TYPE_ORTHOGRAPHIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26TYPE_PERSPECTIVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Contents
4 Acrobat 3D JavaScript Reference
up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26upLocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26viewPlaneSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Camera Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26getScreenFromPosition( position, canvasWidth, canvasHeight ) . . . . . . . . . . . . . 26getDirectionFromScreen( x, y, canvasWidth, canvasHeight ) . . . . . . . . . . . . . . . 27
CameraEvent Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27CameraEvent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28currentTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28far . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28fov . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28isNewCanvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28near . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28projectionType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29targetDistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29viewPlaneSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
CameraEventHandler Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29CameraEventHandler Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
CameraEventHandler() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30CameraEventHandler Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
onEvent( event ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Canvas Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Canvas Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Canvas Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
getCamera() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31setCamera( camera ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
ClippingPlane Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31ClippingPlane Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
remove() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Color Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Color Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Color Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Color() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Color( r, g, b ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32set( color ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33set( r, g, b ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33set3( r, g, b ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Console Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Console Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
print( string ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34println( string ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Dummy Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Acrobat 3D JavaScript Reference 5
Contents
HitInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35HitInfo Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Host Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Image Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Image Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Image Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Image( resource ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
KeyEvent Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37KeyEvent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37canvasPixelHeight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37canvasPixelWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37currentTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37characterCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37ctrlKeyDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38shiftKeyDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
KeyEventHandler Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38KeyEventHandler Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
KeyEventHandler() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38KeyEventHandler Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
onEvent( event ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Light Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Light Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
attenuationA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39attenuationB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39attenuationC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40attenuationType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40ATTENUATION_ABC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40ATTENUATION_NONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40brightness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41innerConeAngle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41innerRadius . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41TYPE_INFINITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41TYPE_POINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41TYPE_SPOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42outerConeAngle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42outerRadius . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42positionLocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Material Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42Material Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
ambientColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Contents
6 Acrobat 3D JavaScript Reference
ambientTexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43bumpTexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43diffuseColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43diffuseTexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43emissiveColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43emissiveTexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44opacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44opacityTexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44phongExponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44reflectionStrength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44reflectionTexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44specularColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44specularStrength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Matrix4x4 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45Matrix4x4 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45scaleComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Matrix4x4 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Matrix4x4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Matrix4x4( matrix ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46invertInPlace() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46isEqual( matrix ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46multiply( matrix ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47multiplyInPlace( matrix ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47rotateWithQuaternion( quaternion ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47rotateWithQuaternionInPlace( quaternion ) . . . . . . . . . . . . . . . . . . . . . . . . . . 47rotateAboutLine( angle, start, end ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48rotateAboutLineInPlace( angle, start, end ) . . . . . . . . . . . . . . . . . . . . . . . . . . 48rotateAboutX( angle ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48rotateAboutXInPlace( angle ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49rotateAboutVector( angle, axis ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49rotateAboutVectorInPlace( angle, axis ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49rotateAboutY( angle ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50rotateAboutYInPlace( angle ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50rotateAboutZ( angle ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50rotateAboutZInPlace( angle ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51scale( x, y, z ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51scaleInPlace( x, y, z ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51set( matrix ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51setIdentity() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52setView( position, direction, up ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52transformDirection( vector ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52transformDirection( position ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53translate( translation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53translateInPlace( translation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53transposeInPlace() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
MenuEvent Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Acrobat 3D JavaScript Reference 7
Contents
MenuEvent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54currentTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54menuItemChecked . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54menuItemName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
MenuEventHandler Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54MenuEventHandler Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
MenuEventHandler() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55MenuEventHandler Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
onEvent( event ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Mesh Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Mesh Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55renderMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
MouseEvent Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56MouseEvent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56canvasPixelHeight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56canvasPixelWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57ctrlKeyDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57currentTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57hits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57isDoubleClick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57isMouseDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57isMouseHit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58isMouseMove . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58isMouseOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58isMouseOver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58isMouseUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58leftButtonDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58rightButtonDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58mouseX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59mouseY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59shiftKeyDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
MouseEventHandler Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59MouseEventHandler Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
MouseEventHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59MouseEventHandler Callbacks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
onEvent( event ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60MouseEventHandler Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
onMouseDoubleClick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60onMouseDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60onMouseHit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60onMouseMove . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61onMouseOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61onMouseOver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61onMouseUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61reportAllTargets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Node Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Contents
8 Acrobat 3D JavaScript Reference
Node Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62firstChild . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62hitEnabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62nextSibling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63parent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63wireframeColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63visible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Node Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63computeBoundingBox() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63detachFromCurrentAnimation() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Procedural Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Quaternion Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Quaternion Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Quaternion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Quaternion( matrix ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Quaternion( quaternion ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65interpolate( quaternion, a ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65interpolateInPlace( quaternion, a ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65normalize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
RenderEvent Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66RenderEvent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66canvasPixelHeight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66canvasPixelWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67currentTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
RenderEventHandler Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67RenderEventHandler Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
RenderEventHandler() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67RenderEventHandler Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
onEvent( event ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67RenderOptions Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68RenderOptions Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
boundingBoxColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68clippingPlaneColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68clippingPlaneIntersectionColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68defaultAmbientColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68defaultDiffuseColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69defaultEmissiveColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69defaultSpecularColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69illustrationRenderModeFaceColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69illustrationRenderModeLineColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69pointsRenderModeColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69shadedIllustrationRenderModeLineColor . . . . . . . . . . . . . . . . . . . . . . . . . . . 69solidGridColorEven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70solidGridColorOdd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70solidRenderModeLineColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70transparentBoundsRenderModeColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70transparentGridColorEven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Acrobat 3D JavaScript Reference 9
Contents
transparentGridColorOdd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70wireframeRenderModeColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71xAxisColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71yAxisColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71zAxisColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Resource Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Resource Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72TYPE_IMAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72TYPE_MODEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72TYPE_UNKNOWN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Resource Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72Resource( pathname ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Runtime Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73Runtime Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
BUTTON_TYPE_PUSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73BUTTON_TYPE_TOOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73ctrlKeyDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73eventHandlerCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74MENU_ITEM_TYPE_CHECKED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74MENU_ITEM_TYPE_DEFAULT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74overrideNavTools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74overridePanTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74overrideRotateTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75overrideSelection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75overrideViewChange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75overrideWalkTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75overrideZoomTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75shiftKeyDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75TOOL_NAME_MEASURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75TOOL_NAME_PAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76TOOL_NAME_ROTATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76TOOL_NAME_WALK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76TOOL_NAME_ZOOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Runtime Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76addEventHandler( eventHandler ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76addCustomMenuItem( name, label, type, checkedState ) . . . . . . . . . . . . . . . . . 77addCustomToolButton( name, label, type ) . . . . . . . . . . . . . . . . . . . . . . . . . . 77enableTool( toolName ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78disableTool( toolName ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78getEventHandler( index ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78getRendererName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78refresh() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79removeEventHandler( index ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79removeCustomMenuItem( menuName ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79removeCustomToolButton( toolName ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79setCurrentTool( toolName ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Scene Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Contents
10 Acrobat 3D JavaScript Reference
Scene Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80ambientIlluminationColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80cameras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80defaultRenderOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80gridMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81GRID_MODE_OFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81GRID_MODE_SOLID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81GRID_MODE_TRANSPARENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81GRID_MODE_WIRE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81gridScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82lengthUnits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82LIGHT_MODE_FILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82LIGHT_MODE_NONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82LIGHT_MODE_WHITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82LIGHT_MODE_DAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82LIGHT_MODE_BRIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83LIGHT_MODE_RGB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83LIGHT_MODE_NIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83LIGHT_MODE_BLUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83LIGHT_MODE_RED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83LIGHT_MODE_CUBE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83LIGHT_MODE_CAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84LIGHT_MODE_HEADLAMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84lights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84lightScaleFactor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84lightScheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85outlineAngle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85showGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85renderMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86RENDER_MODE_DEFAULT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86RENDER_MODE_BOUNDING_BOX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86RENDER_MODE_TRANSPARENT_BOUNDING_BOX . . . . . . . . . . . . . . . . . . . . . 87RENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE . . . . . . . . . . . . . . . 87RENDER_MODE_VERTICES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87RENDER_MODE_SHADED_VERTICES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87RENDER_MODE_WIREFRAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87RENDER_MODE_SHADED_WIREFRAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87RENDER_MODE_SOLID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88RENDER_MODE_TRANSPARENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88RENDER_MODE_SHADED_SOLID_WIREFRAME . . . . . . . . . . . . . . . . . . . . . . . . 88RENDER_MODE_TRANSPARENT_WIREFRAME . . . . . . . . . . . . . . . . . . . . . . . . . 88RENDER_MODE_ILLUSTRATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88RENDER_MODE_SOLID_OUTLINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89RENDER_MODE_SHADED_ILLUSTRATION . . . . . . . . . . . . . . . . . . . . . . . . . . . 89RENDER_MODE_HIDDEN_WIREFRAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89showAxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Acrobat 3D JavaScript Reference 11
Contents
smoothingAngle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89smoothingOverride . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Scene Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90activateAnimation( animation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90addModel( modelRes ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90createClippingPlane() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90createLight() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90createSquareMesh( sizeX, sizeY, name ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91computeBoundingBox() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91update() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
SceneObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92SceneObject Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92objectGUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92objectID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
SceneObjectList Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92SceneObjectList Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92SceneObjectList Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
removeAll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93removeItem( item ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93removeByIndex( index ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93getByID( id ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93getByGUID( guid ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94getByIndex( index ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94getByName( name ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Texture Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94Texture Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
amount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95clampU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95clampV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95modulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95uOffset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95uScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96use3DSStyleMapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96vOffset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96vScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Texture Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96getImage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96setImage( image ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
TimeEvent Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97TimeEvent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
deltaTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
TimeEventHandler Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97TimeEventHandler Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
TimeEventHandler() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97TimeEventHandler Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Contents
12 Acrobat 3D JavaScript Reference
onEvent( event ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98ToolEvent Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98ToolEvent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98canvasPixelHeight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98canvasPixelWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99currentTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99toolName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
ToolEventHandler Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99ToolEventHandler Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
ToolEventHandler() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99ToolEventHandler Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
onEvent( event ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100Vector3 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100Vector3 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
Vector3 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101Vector3() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101Vector3( x, y, z ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101addInPlace( offset ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101addScaled( offset, scale ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102addScaledInPlace( offset, scale ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102blend( vec, blendFactor ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102blendInPlace( vec, blendFactor ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103cross( vec ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103dot( vec ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103normalize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104scale( scale ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104scaleInPlace( scale ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104set( vec ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104set( x, y, z ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105set3( x, y, z ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105subtract( offset ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106subtractInPlace( offset ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Acrobat 3D JavaScript Reference 13
1 Acrobat 3D JavaScript API
Introduction
This guide provides a listing of the JavaScript APIs specific to adding interactivity to 3D annotations within PDF. To create 3D annotations and attach scripts to them using this API you will need Adobe® Acrobat® 7.0 Professional, and those scripts can run on Acrobat Professional 7.0, Acrobat Standard 7.0, and Adobe Reader® 7.0 for Windows® and Macintosh® platforms. Unless otherwise noted, all JavaScript objects, properties, and methods have support starting in version 7.0.
The 3D JavaScript engine, which is distinct from Acrobat JavaScript, can be accessed one of two ways. The primaryway is by attaching a default script to the 3D annotation. This can be accomplished while placing a 3D annotation using the 3D Tool or on an existing 3D annotation by accessing its properties dialog using the Select Object Tool. This script will be run directly by the 3D JavaScript engine.
In addition, Acrobat provides a mechanism to directly access the entire 3D JavaScript engine API from within Acrobat’s own scripting engine by means of the JavaScript Annot3D.context3D property. For more details about Acrobat JavaScript and its Annot3D object, see the Acrobat JavaScript Scripting Reference and Acrobat JavaScript Scripting Guide.
The following example illustrates how to access the 3D JavaScript engine from Acrobat JavaScript. In this example, a button contains Acrobat JavaScript code that rotates the U3D object named "Axes" on that page:
// get index of page containing the Annot3D object (count starts at 0)pageIndex = this.pageNum;
// index of the Annot3D (count starts at 0)annotIndex = 0;
// get a reference to the Annot3D script contextc3d = this.getAnnots3D( pageIndex )[ annotIndex ].context3D;
// get a reference to the node in the scene named "Axes"axes = c3d.scene.nodes.getByName( "Axes" );
// rotate the object about the X-Axis PI/6 radians (30 degrees)axes.transform.rotateAboutXInPlace( Math.PI / 6 );
Acrobat 3D JavaScript APIObject Overview
1
14 Acrobat 3D JavaScript Reference
Object Overview
Basic Objects
There are several basic objects, such as Color, Matrix4x4, and Vector3, that are used to create general-purpose objects. The basic objects are used throughout the API and are only meaningful when attached to objects such as a Scene or Runtime. For example, you could create a Color object and use it to set the Background color of a Canvas.
Vector3 Examples
v1 = new Vector3( 1.2, 3, 4.5 );v2 = new Vector3( 5, 8, 13 );v3 = new Vector3();
Matrix4x4 Examples
m1 = new Matrix4x4().rotateAboutX(Math.PI/1.5).rotateAboutY(Math.PI/3);m2 = new Matrix4x4().rotateAboutZ(Math.PI/4).translate(new Vector3(0,5,0));m3 = new Matrix4x4(m1);
Color Examples
c1 = new Color( 0.6, 0.8, 1.0 ); // light bluec2 = new Color( 0.5, 0.5, 0.5 ); // middle greyc3 = new Color(); //black
// function to blend two ColorsColor.prototype.blend = function( color, amount ){
red = ( this.r * ( 1 - amount ) ) + ( color.r * amount );green = ( this.g * ( 1 - amount ) ) + ( color.g * amount );blue = ( this.b * ( 1 - amount ) ) + ( color.b * amount );return( new Color( red, green, blue ) );
}c4 = c1.blend( c2, 0.25 );
Acrobat 3D JavaScript Reference 15
Acrobat 3D JavaScript APIObject Overview
1
Scene Object
The Scene is an object that contains all of the 3D-related content. It can be accessed using the global variable scene, which is a reference to the main Scene object. Most of the contents of the Scene are structured into a hierarchy of Node objects, and maintains lists of all these objects in the form of a SceneObjectList.
Runtime Object
The Runtime object is used to represent the instance of the playback engine. It manages all event processing and places where the graphic and textual content is rendered. It is accessed via the global variable runtime, which is a reference to the main Runtime object.
Console Object
The Console is Acrobat’s text output area. It is helpful in debugging scripts.
Resource Objects
Some objects, such as Image, are driven by content that is streamed from a file or over a network. To create an Image, load a .png, jpg, or .gif file as a Resource, which you may subsequently use to create a new Image object, as shown in the following example:
faceRes = new Resource("pdf://picture.jpg");faceImage = new Image( faceRes );aMaterial = scene.meshes.getByIndex(0).material;aMaterial.diffuseTexture.setImage( faceImage );
Acrobat 3D JavaScript APIObject Overview
1
16 Acrobat 3D JavaScript Reference
Event Handlers
There are several types of event handlers:
● CameraEventHandler
● KeyEventHandler
● MenuEventHandler
● MouseEventHandler
● RenderEventHandler
● TimeEventHandler
● ToolEventHandler
Each one responds to a different type of event during simulation. They use a callback mechanism to run a function when an event occurs. The event is passed as an argument to the event handler’s onEvent function so that it can be queried when the function runs. Event handlers are registered via the Runtime object’s addEventHandler method.
KeyEvent
A KeyEvent is created when a key is pressed or released while the 3D Canvas is in focus. The following examples illustrates how to handle a key event:
myKeyHandler = new KeyEventHandler();myKeyHandler.onEvent = function( event ){
console.print( "Key pressed with code: " + event.characterCode );}runtime.addEventHandler( myKeyHandler );
MenuEvent
A MenuEvent is created when a custom menu item is selected. To create a custom menu item on the context menu, invoke the Runtime object’s addCustomMenuItem method, which allows a script to be attached to the item selection event.
MouseEvent
A MouseEvent is created when the mouse is clicked on an active 3D Canvas or the cursor moves over an active 3D Canvas. The following syntax could be used to handle a mouse event:
myMouseHandler = new MouseEventHandler();myMouseHandler.onMouseDown = true;myMouseHandler.target = scene.meshes.getByIndex(0);myMouseHandler.onEvent = function( event ){
console.print( "Mouse down at pixel " + event.mouseX );console.print( ", " + event.mouseY );
}runtime.addEventHandler( myMouseHandler );
Acrobat 3D JavaScript Reference 17
Acrobat 3D JavaScript APIObject Overview
1
RenderEvent
A RenderEvent is created immediately before an instance of the Canvas is drawn. If there is a split view in Acrobat resulting in two visible 3D rendered areas, a unique RenderEvent will be called for each of them. This is necessary in the case of a camera-aligned image (sprite) in the 3D content that needs to be pixel-aligned. Since the pixel dimensions of the two areas are possibly different, there are two callbacks that pass the different dimensions. This makes it possible to modify the Scene in the appropriate manner before it is drawn.
TimeEvent
A TimeEvent is created when the 3D annotation is enabled and simulation is active. The time and deltaTime properties are measured in terms of simulation time, not real time. TimeEvent objects are used to drive animation. If you need an accurate, real-time measurement, use the JavaScript Date object. The following syntax is used to handle a time event:
myTimeHandler = new TimeEventHandler();myTimeHandler.onEvent = function( event ){
console.print( "Current simulation time is:" + event.time );console.print( " second(s)" );
}runtime.addEventHandler( myTimeHandler);
ToolEvent
A ToolEvent is created when a tool is clicked in the Acrobat 3D toolbar. The Runtime object’s addCustomToolButton method allows you to add a custom tool to the toolbar which will also be generated, and allows a script to be attached to the tool selection event.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
18 Acrobat 3D JavaScript Reference
Acrobat 3D JavaScript Objects
This section describes the following 3D JavaScript objects:
N O T E : A property labeled as read-only is one whose value cannot be set. An object labeled as 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 are assumed to have read/write access.
● Animation
● Background
● Bone
● BoundingBox
● Camera
● CameraEvent
● CameraEventHandler
● Canvas
● ClippingPlane
● Color
● Console
● Dummy
● HitInfo
● Host
● Image
● KeyEvent
● KeyEventHandler
● Light
● Material
● Matrix4x4
● MenuEvent
● MenuEventHandler
● Mesh
● MouseEvent
● MouseEventHandler
● Node
Acrobat 3D JavaScript Reference 19
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
● Procedural
● Quaternion
● RenderEvent
● RenderEventHandler
● RenderOptions
● Resource
● Runtime
● Scene
● SceneObject
● SceneObjectList
● Texture
● TimeEvent
● TimeEventHandler
● ToolEvent
● ToolEventHandler
● Vector3
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
20 Acrobat 3D JavaScript Reference
Animation Object
The Animation object is 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.
Animation Properties
currentTime
The current time measured in seconds.
Type: number
endTime
The end time of the sequence, measured in seconds.
Type: number
Access: read-only
framesPerSecond
The number of frames per second used to author the sequence.
Type: number
Access: read-only
length
The length of the Animation, measured in seconds.
Type: number
Access: read-only
startTime
The start time of the sequence, measured in seconds.
Type: number
Access: read-only
Acrobat 3D JavaScript Reference 21
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Background Object
The Background object represents the background of a Canvas. It can be used as a target of a MouseEventHandler.
Background Properties
image
Version 7.0.7
The Image to be used by the Background.
Type: Image
Background Methods
getColor()
Obtains the background Color.
Parameters
None
Returns
A Color object representing the background color of the Canvas.
getImage()
Deprecated.
Obtains the background Image.
Parameters
None
Returns
An Image object representing the background image of the Canvas.
setColor( topColor, bottomColor )
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 will be a linear
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
22 Acrobat 3D JavaScript Reference
gradient from top to bottom, with the first color argument representing the top color and the second representing the bottom color.
Parameters
Returns
undefined
setImage( image )
Deprecated.
Sets the background Image.
Parameters
Returns
undefined
Bone Object
A Bone object is 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.
BoundingBox Object
A BoundingBox object represents an axis-aligned bounding box.
BoundingBox Properties
center
Version 7.0.7
topColor A Color object representing the desired background color. If bottomColor is used, topColor represents the top background color used in a linear gradient.
bottomColor (Optional) A Color object representing the bottom background color used in a linear gradient.
image An Image object representing the desired background image.
Acrobat 3D JavaScript Reference 23
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
The coordinates of the BoundingBox center.
Type: Vector3
Access: read-only
max
The coordinates of the BoundingBox corner with the greatest x, y, and z values.
Type: Vector3
Access: read-only
min
The coordinates of the BoundingBox corner with the smallest x, y, and z values.
Type: Vector3
Access: read-only
Camera Object
A Camera object is 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.
Camera Properties
binding
The view plane calculation type, which can take one of the following values:
● "min"
● "max"
● "horizontal"
● "vertical"
Type: string
BINDING_MAX
Version 7.0.7
A string constant for the binding value of "max".
Type: string
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
24 Acrobat 3D JavaScript Reference
Access: read-only
BINDING_MIN
Version 7.0.7
A string constant for the binding value of "min".
Type: string
Access: read-only
BINDING_HORIZONTAL
Version 7.0.7
A string constant for the binding value of "horizontal".
Type: string
Access: read-only
BINDING_VERTICAL
Version 7.0.7
A string constant for the binding value of "vertical".
Type: string
Access: read-only
far
The distance from the Camera to the far clipping plane. A value of -1 for both near and far signifies to use auto clipping plane calculations.
Type: number
fov
The size of the field of view for perspective Camera objects, measured in radians.
Type: number
near
The distance from the Camera to the near clipping plane. A value of -1 for both near and far signifies to use auto clipping plane calculations.
Type: number
Acrobat 3D JavaScript Reference 25
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
position
The position of the origin of the Camera in world space.
Type: Vector3
Access: read-only
positionLocal
The position of the origin of the Camera in local space.
Type: Vector3
Access: read-only
projectionType
The type of projection, which can take one of the following values:
● "perspective"
● "orthographic"
Type: string
roll
The roll angle of the Camera, measured in radians.
Type: number
target
The current Node used as the Camera object’s target.
Type: Node
Access: read-only
targetPosition
The position of the Camera object’s target in world space.
Type: Vector3
Access: read-only
targetPositionLocal
The position of the Camera object’s target in local space.
Type: Vector3
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
26 Acrobat 3D JavaScript Reference
TYPE_ORTHOGRAPHIC
Version 7.0.7
A string constant for the camera projection type of "orthographic".
Type: string
Access: read-only
TYPE_PERSPECTIVE
Version 7.0.7
A string constant for the camera projection type of "perspective".
Type: string
Access: read-only
up
The up direction in world space.
Type: Vector3
Access: read-only
upLocal
The up direction in local space.
Type: Vector3
Access: read-only
viewPlaneSize
The size of the view plane for orthographic Camera objects, measured in scene units.
Type: number
Camera Methods
getScreenFromPosition( position, canvasWidth, canvasHeight )
Obtains the screen coordinates of the provided 3D position.
Acrobat 3D JavaScript Reference 27
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
A Vector3 object representing the screen coordinates, with x and y as pixel positions and z equal to zero.
getDirectionFromScreen( x, y, canvasWidth, canvasHeight )
Obtains the direction from the normalized coordinates.
Parameters
Returns
A Vector3 object representing the direction.
CameraEvent Object
A CameraEvent object describes the format of the object that is passed as an argument to the CameraEventHandler object’s onEvent method.
CameraEvent Properties
binding
The view plane calculation type, which can take one of the following values:
● "min"
● "max"
● "horizontal"
position A Vector3 object representing the 3D position.
canvasWidth The width of the Canvas, measured in pixels.
canvasHeight The height of the Canvas, measured in pixels.
x The x-coordinate, measured in pixels.
y The y-coordinate, measured in pixels.
canvasWidth The width of the Canvas, measured in pixels.
canvasHeight The height of the Canvas, measured in pixels.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
28 Acrobat 3D JavaScript Reference
● "vertical"
Type: string
Access: read-only
canvas
The Canvas in which the event took place.
Type: Canvas
Access: read-only
currentTool
The name of the current tool.
Type: string
Access: read-only
far
The distance from the Camera to the far clipping plane. A value of -1 for both near and far signifies to use auto clipping plane calculations.
Type: number
Access: read-only
fov
The size of the field of view for perspective Camera objects, measured in radians.
Type: number
Access: read-only
isNewCanvas
Determines whether this is the first event for this Canvas.
Type: boolean
Access: read-only
near
The distance from the Camera to the near clipping plane. A value of -1 for both near and far signifies to use auto clipping plane calculations.
Acrobat 3D JavaScript Reference 29
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Type: number
Access: read-only
projectionType
The type of projection, which can take one of the following values:
● "perspective"
● "orthographic"
Type: string
Access: read-only
targetDistance
The distance from the Camera to its target.
Type: Vector3
Access: read-only
transform
The Camera object’s transformation matrix.
Type: Matrix4x4
Access: read-only
viewPlaneSize
The size of the view plane, measured in scene units.
Type: number
Access: read-only
CameraEventHandler Object
A CameraEventHandler object 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.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
30 Acrobat 3D JavaScript Reference
CameraEventHandler Methods
CameraEventHandler()
Constructor.
Parameters
None
Returns
A CameraEventHandler object.
CameraEventHandler Callbacks
onEvent( event )
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.
Parameters
Returns
undefined
Canvas Object
A Canvas object is a rectangular region into which the Scene is rendered from the viewpoint of the attached Camera.
Canvas Properties
background
The Background object representing the Canvas.
Type: string
Access: read-only
event A CameraEvent object representing the event.
Acrobat 3D JavaScript Reference 31
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Canvas Methods
getCamera()
Obtains the Camera object attached to the Canvas.
Parameters
None
Returns
A Camera object.
setCamera( camera )
Sets the Camera object attached to the Canvas.
Parameters
Returns
undefined
ClippingPlane Object
A ClippingPlane object is used to represent a plane, within the Scene, that clips all geometry on one side of it. It is created by invoking the Scene object’s createClippingPlane method.
ClippingPlane Methods
remove()
Removes the ClippingPlane object from the Scene.
Parameters
None
Returns
undefined
camera The Camera object used to set the object’s value.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
32 Acrobat 3D JavaScript Reference
Color Object
A Color object represents an RGB encoded color.
Color Properties
b
The blue component, which may contain a value from 0.0 to 1.0.
Type: number
g
The green component, which may contain a value from 0.0 to 1.0.
Type: number
r
The red component, which may contain a value from 0.0 to 1.0.
Type: number
Color Methods
Color()
Constructor.
Parameters
None
Returns
A Color object, initialized to black.
Color( r, g, b )
Constructor.
Acrobat 3D JavaScript Reference 33
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
A Color object, initialized to the supplied RGB values.
set( color )
Sets the Color object’s value using an existing Color object.
Parameters
Returns
undefined
set( r, g, b )
Version 7.0.7
Sets the Color object’s value using the given RGB components.
Parameters
Returns
undefined
r The red component, which may contain a value from 0.0 to 1.0.
g The green component, which may contain a value from 0.0 to 1.0.
b The blue component, which may contain a value from 0.0 to 1.0.
color The Color object used to set the object’s value.
r The red component, which may contain a value from 0.0 to 1.0.
g The green component, which may contain a value from 0.0 to 1.0.
b The blue component, which may contain a value from 0.0 to 1.0.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
34 Acrobat 3D JavaScript Reference
set3( r, g, b )
Deprecated.
Sets the Color object’s value using the given RGB components.
Parameters
Returns
undefined
Console Object
This object can direct output to the Acrobat console for debugging purposes. The variable console is a global reference to this object.
Console Methods
print( string )
Prints a string to the console.
Parameters
Returns
undefined
println( string )
Prints a string with an accompanying newline to the console.
r The red component, which may contain a value from 0.0 to 1.0.
g The green component, which may contain a value from 0.0 to 1.0.
b The blue component, which may contain a value from 0.0 to 1.0.
string The text to be printed to the console.
Acrobat 3D JavaScript Reference 35
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
undefined
Dummy Object
This is a Node object used as an empty placeholder or a group within a Scene.
HitInfo Object
This object is returned when a hit test occurs during a MouseEvent.
HitInfo Properties
distance
The distance from the Camera to the HitInfo object’s position.
Type: number
Access: read-only
position
The position of the point where the hit occurred.
Type: Vector3
Access: read-only
target
The target of the hit test.
Type: Node
Access: read-only
string The text to be printed to the console.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
36 Acrobat 3D JavaScript Reference
Host Object
Version 7.0.7
An object that provides access to the Acrobat JavaScript engine context and pertinent objects within it. The variable host is a global reference to this object. It is a reference to the Acrobat JavaScript Document object in which the 3D annotation is contained.
Image Object
An object that represents an image.
Image Properties
height
The image’s height, measured in pixels.
Type: number
Access: read-only
width
The image’s width, measured in pixels.
Type: number
Access: read-only
Image Methods
Image( resource )
Constructor.
Parameters
Returns
An Image object.
resource An Image object used to create the new object.
Acrobat 3D JavaScript Reference 37
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
KeyEvent Object
An object that is passed as an argument to the KeyEventHandler object’s onEvent method.
KeyEvent Properties
canvas
The Canvas in which the KeyEvent took place.
Type: Canvas
Access: read-only
canvasPixelHeight
The height, measured in pixels, of the Canvas.
Type: integer
Access: read-only
canvasPixelWidth
The width, measured in pixels, of the Canvas.
Type: integer
Access: read-only
currentTool
The name of the current tool.
Type: string
Access: read-only
characterCode
The value of the character pressed according to Acrobat’s character mapping, as shown in Figure 1.1.
Type: integer
Access: read-only
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
38 Acrobat 3D JavaScript Reference
FIGURE 1.1 Acrobat Character Codes
ctrlKeyDown
Determines whether the Ctrl key was pressed on Windows or the Command key was pressed on a Macintosh.
Type: boolean
Access: read-only
shiftKeyDown
Determines whether the Shift key was pressed.
Type: boolean
Access: read-only
KeyEventHandler Object
A KeyEventHandler object 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.
KeyEventHandler Methods
KeyEventHandler()
Constructor.
# Key # Key # Key # Key # Key # Key
11 12 28 29 30 31 32
Pg Up Pg Dn Left Right Down Up Space
48 49 50 51 52 53 54 55 56 57
0 1 2 3 4 5 6 7 8 9
65 66 67 68 69 70 71 72 73 74 75 76 77
A B C D E F G H I J K L M
78 79 80 81 82 83 84 85 86 87 88 89 90
N O P Q R S T U V W X Y Z
97 98 99 100 101 102 103 104 105 106 107 108 109
a b c d e f g h I j k l m
110 111 112 113 114 115 116 117 118 119 120 121 122
n o p q r s t u v w x y z
Acrobat 3D JavaScript Reference 39
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
None
Returns
A KeyEventHandler object.
KeyEventHandler Callbacks
onEvent( event )
A method that is called when a key is pressed
Parameters
Returns
undefined
Light Object
A Light object is a Node 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 lightbulb, 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 below, it also contains the same methods and properties as a Node.
Light Properties
attenuationA
The a coefficient for attenuationType "abc".
Type: number
attenuationB
The b coefficient for attenuationType "abc".
Type: number
event A KeyEvent object representing the event.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
40 Acrobat 3D JavaScript Reference
attenuationC
The c coefficient for attenuationType "abc".
Type: number
attenuationType
The style of attenutaion for the 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"
Type: string
ATTENUATION_ABC
Version 7.0.7
A string constant for the attenuationType of "abc".
Type: string
Access: read-only
ATTENUATION_NONE
Version 7.0.7
A string constant for theattenuationType of "none".
Type: string
Access: read-only
brightness
Specifies the brightness of the emission from the Light. A value of 1 represents a brightness of 100%, though the property may be assigned higher values.
Type: number
color
Specifies the color of the light.
Type: Color
Access: read-only
Acrobat 3D JavaScript Reference 41
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
direction
The direction toward which the light is pointing.
Type: Vector3
Access: read-only
innerConeAngle
The angle, measured in radians, about the direction in which the light is of uniform full density.
Type: number
innerRadius
The distance within which the light is of uniform full density..
Type: number
type
The type of Light object being represented. One of the following values may be assigned:
● "point"
● "spot"
● "infinite"
Type: string
TYPE_INFINITE
Version 7.0.7
A string constant for the Light type of "infinite".
Type: string
Access: read-only
TYPE_POINT
Version 7.0.7
A string constant for the Light type of "point".
Type: string
Access: read-only
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
42 Acrobat 3D JavaScript Reference
TYPE_SPOT
Version 7.0.7
A string constant for the Light type of "point".
Type: string
Access: read-only
outerConeAngle
The angle, measured in radians, about the direction outside of which the light’s intensity is zero.
Type: number
outerRadius
The distance beyond which the light’s intensity is zero.
Type: number
position
The position of the Light object in world-space coordinates.
Type: Vector3
Access: read-only
positionLocal
The position of the Light object relative to its parent Node.
Type: Vector3
Access: read-only
Material Object
A Material object is a SceneObject that controls the appearance of materials using the fixed function shader. In addition to the properties below, it also contains the same methods and properties as a SceneObject.
Acrobat 3D JavaScript Reference 43
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Material Properties
ambientColor
The ambient color.
Type: Color
Access: read-only
ambientTexture
The ambient texture.
Type: Texture
Access: read-only
bumpTexture
A texture map whose value is used to describe the roughness of the object
Type: Texture
Access: read-only
diffuseColor
The matte color of an object.
Type: Color
Access: read-only
diffuseTexture
A texture map that is used for the matte color of the object.
Type: Color
Access: read-only
emissiveColor
The emissive color.
Type: Color
Access: read-only
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
44 Acrobat 3D JavaScript Reference
emissiveTexture
The emissive texture.
Type: Texture
Access: read-only
opacity
The total opacity of the material.
Type: number
opacityTexture
A texture map whose brightness is used for the level of opacity of the object. White signifies completely opaque while black signifies completely transparent.
Type: Texture
Access: read-only
phongExponent
The phong exponent.
Type: number
reflectionStrength
The reflection level, which may contain a value from 0.0 to 1.0..
Type: Color
reflectionTexture
The reflection texture.
Type: Texture
Access: read-only
specularColor
The specular color.
Type: Color
Access: read-only
Acrobat 3D JavaScript Reference 45
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
specularStrength
The specular strength, which is a measure of how shiny the material is.
Type: number
Matrix4x4 Object
A four by four matrix commonly used for transformations.
Matrix4x4 Properties
determinant
The determinant of the matrix.
Type: number
inverse
The inverse of the matrix.
Type: Matrix4x4
Access: read-only
scaleComponent
The scale component of the transformation.
Type: Vector3
Access: read-only
translation
The translation component of the transformation.
Type: Vector3
Access: read-only
transpose
The transpose of the matrix.
Type: Matrix4x4
Access: read-only
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
46 Acrobat 3D JavaScript Reference
Matrix4x4 Methods
Matrix4x4()
Constructor.
Parameters
None
Returns
A Matrix4x4 object initialized to the identity matrix.
Matrix4x4( matrix )
Constructor.
Parameters
Returns
A Matrix4x4 object initialized to the specified matrix.
invertInPlace()
Inverts the matrix.
Parameters
None
Returns
undefined
isEqual( matrix )
Determines whether the current matrix is equal to the specified matrix.
Parameters
Returns
True if the matrices are equal, false otherwise.
matrix A Matrix4x4 object used to initialize the new matrix.
matrix A Matrix4x4 object used for the comparison.
Acrobat 3D JavaScript Reference 47
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
multiply( matrix )
Multiplies the current matrix by the specified matrix.
Parameters
Returns
A Matrix4x4 object.
multiplyInPlace( matrix )
Multiplies the current matrix by the specified matrix, and updates the current matrix with the resulting value.
Parameters
Returns
undefined
rotateWithQuaternion( quaternion )
Rotates the current matrix using the specified Quaternion.
Parameters
Returns
A Matrix4x4 object.
rotateWithQuaternionInPlace( quaternion )
Rotates the current matrix using the specified quaternion, and updates the current matrix with the resulting value.
matrix A Matrix4x4 object used for the multiplication.
matrix A Matrix4x4 object used for the multiplication.
quaternion A Quaternion object used for the rotation.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
48 Acrobat 3D JavaScript Reference
Parameters
Returns
undefined
rotateAboutLine( angle, start, end )
Rotates the current matrix about the specified line.
Parameters
Returns
A Matrix4x4 object.
rotateAboutLineInPlace( angle, start, end )
Rotates the current matrix about the specified line, and updates the current matrix with the resulting value.
Parameters
Returns
undefined
rotateAboutX( angle )
Rotates the current matrix about the x-axis.
quaternion A Quaternion object used for the rotation.
angle The angle of rotation, in radians.
start A point described by a Vector3 object used to specify the beginning of the line of rotation (which is represented by start - end).
end A point described by a Vector3 object used to specify the end of the line of rotation (which is represented by start - end).
angle The angle of rotation, in radians.
start A Vector3 object used to specify the line of rotation (which is represented by start - end.
end A Vector3 object used to specify the line of rotation (which is represented by start - end.
Acrobat 3D JavaScript Reference 49
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
A Matrix4x4 object.
rotateAboutXInPlace( angle )
Rotates the current matrix about the x-axis, and updates the current matrix with the resulting value.
Parameters
Returns
undefined
rotateAboutVector( angle, axis )
Rotates the current matrix about the specified vector.
Parameters
Returns
A Matrix4x4 object.
rotateAboutVectorInPlace( angle, axis )
Rotates the current matrix about the specified vector, and updates the current matrix with the resulting value.
angle The angle of rotation, in radians.
angle The angle of rotation, in radians.
angle The angle of rotation, in radians.
axis A Vector3 object about which the matrix is rotated.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
50 Acrobat 3D JavaScript Reference
Parameters
Returns
undefined
rotateAboutY( angle )
Rotates the current matrix about the y-axis.
Parameters
Returns
A Matrix4x4 object.
rotateAboutYInPlace( angle )
Rotates the current matrix about the y-axis, and updates the current matrix with the resulting value.
Parameters
Returns
undefined
rotateAboutZ( angle )
Rotates the current matrix about the z-axis.
Parameters
Returns
A Matrix4x4 object.
angle The angle of rotation, in radians.
axis A Vector3 object about which the matrix is rotated.
angle The angle of rotation, in radians.
angle The angle of rotation, in radians.
angle The angle of rotation, in radians.
Acrobat 3D JavaScript Reference 51
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
rotateAboutZInPlace( angle )
Rotates the current matrix about the z-axis, and updates the current matrix with the resulting value.
Parameters
Returns
undefined
scale( x, y, z )
Scales the current matrix using the specified scaling components.
Parameters
Returns
A Matrix4x4 object.
scaleInPlace( x, y, z )
Scales the current matrix using the specified scaling components, and updates the current matrix with the resulting value.
Parameters
Returns
undefined
set( matrix )
Sets the value of the current matrix using the specified matrix.
angle The angle of rotation, in radians.
x The scaling component in the x-direction.
y The scaling component in the y-direction.
z The scaling component in the z-direction.
x The scaling component in the x-direction.
y The scaling component in the y-direction.
z The scaling component in the z-direction.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
52 Acrobat 3D JavaScript Reference
Parameters
Returns
undefined
setIdentity()
Sets the value of the current matrix to the identity matrix.
Parameters
None
Returns
undefined
setView( position, direction, up )
Sets the current matrix according to the specified component vectors.
Parameters
Returns
undefined
transformDirection( vector )
Transforms the specified vector by the current matrix.
Parameters
Returns
A Vector3 object.
matrix The matrix whose value is copied into the current matrix.
position A Vector3 object used to specify the position component.
direction A Vector3 object used to specify the direction component.
up A Vector3 object used to specify the upward component.
vector The Vector3 object to be transformed.
Acrobat 3D JavaScript Reference 53
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
transformDirection( position )
Transforms the specified position by the current matrix.
Parameters
Returns
A Vector3 object.
translate( translation )
Translates the current matrix by the components of the specified vector.
Parameters
Returns
A Matrix4x4 object.
translateInPlace( translation )
Translates the current matrix by the components of the specified vector, and updates the current matrix with the resulting value.
Parameters
Returns
undefined
transposeInPlace()
Sets the value of the current matrix to its transpose.
Parameters
None
Returns
undefined
position A Vector3 object representing the position to be transformed.
translation The Vector3 object whose components are used to perform the matrix translation.
translation The Vector3 object whose components are used to perform the matrix translation.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
54 Acrobat 3D JavaScript Reference
MenuEvent Object
An object that is passed as an argument to the MenuEventHandler object’s onEvent method.
MenuEvent Properties
canvas
The Canvas in which the MenuEvent took place.
Type: Canvas
Access: read-only
currentTool
The name of the current tool.
Type: string
Access: read-only
menuItemChecked
Determines whether the menu item was selected.
Type: boolean
Access: read-only
menuItemName
The name of the selected menu item.
Type: string
Access: read-only
MenuEventHandler Object
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.
Acrobat 3D JavaScript Reference 55
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
MenuEventHandler Methods
MenuEventHandler()
Constructor.
Parameters
None
Returns
A MenuEventHandler object.
MenuEventHandler Callbacks
onEvent( event )
A method that is called when a custom menu item is selected on the context menu for an active 3D annotation.
Parameters
Returns
undefined
Mesh Object
A Mesh object is a Node that contains geometry. A Mesh object with no geometry will have children Node objects that may be transformed as a group. In addition to the methods and properties below, it also contains the same methods and properties as a Node.
Mesh Properties
material
The Mesh object’s default Material.
Type: Material
event A MenuEvent object representing the event.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
56 Acrobat 3D JavaScript Reference
renderMode
The 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"
Type: string
MouseEvent Object
An object that is passed as an argument to the MouseEventHandler object’s onEvent method.
MouseEvent Properties
canvas
The Canvas in which the MouseEvent took place.
Type: Canvas
Access: read-only
canvasPixelHeight
The height, measured in pixels, of the Canvas in which the MouseEvent took place.
Acrobat 3D JavaScript Reference 57
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Type: integer
Access: read-only
canvasPixelWidth
The width, measured in pixels, of the Canvas in which the MouseEvent took place.
Type: integer
Access: read-only
ctrlKeyDown
Determines whether the Ctrl key was pressed on Windows or the Command key was pressed on a Macintosh.
Type: boolean
Access: read-only
currentTool
The name of the current tool.
Type: string
Access: read-only
hits
A set of HitInfo objects ordered by distance from nearest to furthest.
Type: Array
Access: read-only
isDoubleClick
Determines whether the a double-click event occurred.
Type: boolean
Access: read-only
isMouseDown
Determines whether the mouse button has been pressed.
Type: boolean
Access: read-only
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
58 Acrobat 3D JavaScript Reference
isMouseHit
Determines whether the target is under the mouse cursor.
Type: boolean
Access: read-only
isMouseMove
Determines whether the mouse position has changed.
Type: boolean
Access: read-only
isMouseOut
Determines whether the mouse position has moved off the target.
Type: boolean
Access: read-only
isMouseOver
Determines whether the mouse position has moved onto the target.
Type: boolean
Access: read-only
isMouseUp
Determines whether the mouse button has been released.
Type: boolean
Access: read-only
leftButtonDown
Determines whether the left mouse button has been pressed.
Type: boolean
Access: read-only
rightButtonDown
Version 7.0.1
Determines whether the right mouse button has been pressed.
Acrobat 3D JavaScript Reference 59
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Type: boolean
Access: read-only
mouseX
The x position of the mouse cursor in the Canvas.
Type: integer
Access: read-only
mouseY
The y position of the mouse cursor in the Canvas.
Type: integer
Access: read-only
shiftKeyDown
Determines whether the Shift key has been pressed.
Type: boolean
Access: read-only
MouseEventHandler Object
A MouseEventHandler object exposes a callback mechanism that allows a function to be evaluated when mouse event occurs. The handler may be customized to filter out certain event types. Event handlers are registered with the Runtime addEventHandler. method.
MouseEventHandler Methods
MouseEventHandler
Constructor.
Parameters
None
Returns
A MouseEventHandler object.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
60 Acrobat 3D JavaScript Reference
MouseEventHandler Callbacks
onEvent( event )
A method that is called when a mouse event occurs.
Parameters
Returns
undefined
MouseEventHandler Properties
onMouseDoubleClick
When set to true the handler will be called back when a mouse button is clicked twice on the target object in rapid succession. If no target is specified the handler will call back on any double-click.
Type: boolean
onMouseDown
When set to true the handler will be called back when a mouse button is initially pressed while the cursor is over the target object. If no target is specified the handler will call back on any button press.
Type: boolean
onMouseHit
When set to true the handler will be called back continously when the mouse cursor is over the target object. In the case of onMouseHit it doesn’t matter if the target object is behind another object in the scene. The list of resultant hit objects are provided in the MouseEvent hits property.
Type: boolean
event A MouseEvent object representing the event.
Acrobat 3D JavaScript Reference 61
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
onMouseMove
When set to true the handler will be called back when the mouse cursor moves over the target object. If no target is specified the handler will call back on any mouse movement over the 3D annotation.
Type: boolean
onMouseOut
When set to true the handler will be called back once when the mouse cursor moves off of the target object. In order to be called back the target must be the frontmost object. To disclude objects use Node hitEnabled property.
Type: boolean
onMouseOver
When set to true the handler will be called back once when the mouse cursor moves over of the target object.
Type: boolean
onMouseUp
When set to true the handler will be called back when a mouse button is initially released. If a target is specified it will only call back when the cursor is over the handler’s target.
Type: boolean
reportAllTargets
Determines whether the a hit test will be performed. When set to false, a hit test will not be 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 the following events will not be reported because they depend on hit testing:
● mouse-hit
● mouse-move
● mouse-out
● mouse-over
Type: boolean
target
The Mesh or Background object on which the mouse event occurs.
Type: Object
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
62 Acrobat 3D JavaScript Reference
Access: read-only
Node Object
A Node is an object within the Scene hierarchy (a SceneObject) that has a 3D representation. The following objects are considered Node objects:
● Bone
● Camera
● ClippingPlane
● Dummy
● Light
● Mesh
● Procedural
To obtain a Node object’s type, use the standard JavaScript constructor property. For example, the following syntax would print the Node object’s type to the console:
console.println(myNode.constructor.name);
In addition to the methods and properties below, it also contains the same methods and properties as a SceneObject.
Node Properties
firstChild
The Node object’s first child.
Type: Node (if the first child exists), None otherwise
Access: read-only
hitEnabled
Determines whether the Node is included in hit tests. The default value is true.
Type: boolean
info
Version 7.0.7
Information associated with the Node.
Type: String
Acrobat 3D JavaScript Reference 63
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Access: read-only
nextSibling
The next sibling.
Type: Node (if the next sibling exists), None otherwise.
Access: read-only
parent
The Node object’s parent Node or Scene.
Type: Object
Access: read-only
transform
The local to world transformation matrix for the Node.
Type: Matrix4x4
Access: read-only
wireframeColor
The Color object used to determine the wireframe appearance.
Type: Color
Access: read-only
visible
Determines whether the Node object should be shown.
Type: boolean
Node Methods
computeBoundingBox()
Version 7.0.7
Computes the bounds of the Node object.
Parameters
None
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
64 Acrobat 3D JavaScript Reference
Returns
A BoundingBox object.
detachFromCurrentAnimation()
Removes the ability of the Node object’s currently active Animation to transform the Node.
Parameters
None
Returns
undefined
Procedural Object
A Procedural is a Node 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.
Quaternion Object
A 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.
Quaternion Methods
Quaternion()
Constructor that initializes the object with the identity matrix.
Parameters
None
Returns
A Quaternion object.
Quaternion( matrix )
Constructor that initializes the object with the specified rotation matrix.
Acrobat 3D JavaScript Reference 65
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
A Quaternion object.
Quaternion( quaternion )
Constructor that initializes the object with the specified Quaternion.
Parameters
Returns
A Quaternion object.
interpolate( quaternion, a )
Creates a Quaternion object interpolated from the current and specified Quaternion objects and a.
Parameters
Returns
A Quaternion object.
interpolateInPlace( quaternion, a )
Creates a Quaternion object interpolated from the current and specified Quaternion objects and a, and updates the current Quaternion object with the new value.
matrix A Matrix4x4 object representing the rotation matrix.
quaternion A Quaternion object used to initialize the new object.
quaternion A Quaternion object used to interpolate the new object.
a A number value, from 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.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
66 Acrobat 3D JavaScript Reference
Parameters
Returns
A Quaternion object.
normalize()
Normalizes the Quaternion object.
Parameters
None
Returns
undefined
RenderEvent Object
An object that is passed as an argument to the RenderEventHandler object’s onEvent method.
RenderEvent Properties
canvas
The Canvas that is the target of the RenderEvent.
Type: Canvas
Access: read-only
canvasPixelHeight
The height, measured in pixels, of the Canvas for which the RenderEvent is intended.
Type: integer
Access: read-only
quaternion A Quaternion object used to interpolate the new object.
a A number value, from 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.
Acrobat 3D JavaScript Reference 67
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
canvasPixelWidth
The width, measured in pixels, of the Canvas for which the RenderEvent is intended.
Type: integer
Access: read-only
currentTool
The name of the current tool.
Type: string
Access: read-only
RenderEventHandler Object
A RenderEventHandler 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. It issues a callback just before each Canvas is rendered.
RenderEventHandler Methods
RenderEventHandler()
Constructor.
Parameters
None
Returns
A RenderEventHandler object.
RenderEventHandler Callbacks
onEvent( event )
A method that is called immediately before the Canvas is rendered.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
68 Acrobat 3D JavaScript Reference
Parameters
Returns
undefined
RenderOptions Object
A RenderOptions object describes the style with which to render Node objects in the Scene.
RenderOptions Properties
boundingBoxColor
A Color object that to be applied to the bounding box.
Type: Color
Access: read-only
clippingPlaneColor
A Color object that to be applied to the clipping plane.
Type: Color
Access: read-only
clippingPlaneIntersectionColor
A Color object that to be applied to the clipping plane intersection.
Type: Color
Access: read-only
defaultAmbientColor
A Color object that to be applied to the default ambient Material.
Type: Color
Access: read-only
event A RenderEvent object representing the event.
Acrobat 3D JavaScript Reference 69
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
defaultDiffuseColor
A Color object that to be applied to the default diffuse Material.
Type: Color
Access: read-only
defaultEmissiveColor
A Color object that to be applied to the default emissive Material.
Type: Color
Access: read-only
defaultSpecularColor
A Color object that to be applied to the default specular Material.
Type: Color
Access: read-only
illustrationRenderModeFaceColor
Version 7.0.7
The color of the faces when the render mode is Illustration.
Type: Color
Access: read-only
illustrationRenderModeLineColor
A Color object that to be applied to the illustration lines.
Type: Color
Access: read-only
pointsRenderModeColor
A Color object that to be applied to the vertices in point render mode.
Type: Color
Access: read-only
shadedIllustrationRenderModeLineColor
A Color object that to be applied to the shaded illustration lines.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
70 Acrobat 3D JavaScript Reference
Type: Color
Access: read-only
solidGridColorEven
Version 7.0.7
The color of the even squares of the checkered grid when drawn in "solid" mode.
Type: Color
Access: read-only
solidGridColorOdd
Version 7.0.7
The color of the odd squares of the checkered grid when drawn in "solid" mode.
Type: Color
Access: read-only
solidRenderModeLineColor
A Color object that to be applied to the solid or transparent lines in render mode.
Type: Color
Access: read-only
transparentBoundsRenderModeColor
A Color object that to be applied to the transparent bounding box.
Type: Color
Access: read-only
transparentGridColorEven
Version 7.0.7
The color of the even squares of the checkered grid when drawn in "transparent" mode.
Type: Color
Access: read-only
transparentGridColorOdd
Version 7.0.7
Acrobat 3D JavaScript Reference 71
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
The color of the odd squares of the checkered grid when drawn in "transparent" mode.
Type: Color
Access: read-only
wireframeRenderModeColor
Version 7.0.7
The color of the wires when the render mode is Wireframe.
Type: Color
Access: read-only
xAxisColor
Version 7.0.7
The color of the x-axis.
Type: Color
Access: read-only
yAxisColor
Version 7.0.7
The color of the y-axis.
Type: Color
Access: read-only
zAxisColor
Version 7.0.7
The color of the z-axis.
Type: Color
Access: read-only
Resource Object
A Resource object creates an abstraction for loading behavior in files and streams.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
72 Acrobat 3D JavaScript Reference
Resource Properties
type
The type of Resource object, which can be one of the following values:
● "image"
● "model"
● "unknown"
Type: string
Access: read-only
TYPE_IMAGE
Version 7.0.7
A string constant for the Resource type of "image".
Type: string
Access: read-only
TYPE_MODEL
Version 7.0.7
A string constant for the Resource type of "model".
Type: string
Access: read-only
TYPE_UNKNOWN
Version 7.0.7
A string constant for the Resource type of "unknown".
Type: string
Access: read-only
Resource Methods
Resource( pathname )
Constructor.
Acrobat 3D JavaScript Reference 73
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
A Resource object.
Runtime Object
A Runtime object represents the runtime 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.
Runtime Properties
BUTTON_TYPE_PUSH
Version 7.0.7
A string constant for the custom tool button type of "push button". It is used with the addCustomToolButton method.
Type: string
Access: read-only
BUTTON_TYPE_TOOL
Version 7.0.7
A string constant for the custom button type of "tool button". It is used with the addCustomToolButton method.
Type: string
Access: read-only
ctrlKeyDown
Determines whether the Ctrl key was pressed on Windows or the Command key was pressed on a Macintosh.
Type: boolean
Access: read-only
pathname A string representing the pathname of the file or stream. Can currently only load embedded resources from within the PDF file. the pathname string must start with pdf://
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
74 Acrobat 3D JavaScript Reference
eventHandlerCount
The number of registered event handlers.
Type: integer
Access: read-only
instances
Version 7.0.7
An array of Acrobat JavaScript Annot3D objects that are attached to the 3D script context.
Type: Array
Access: read-only
MENU_ITEM_TYPE_CHECKED
Version 7.0.7
A string constant for the custom menu item type of "checked". It is used with the addCustomMenuItem method.
Type: string
Access: read-only
MENU_ITEM_TYPE_DEFAULT
Version 7.0.7
A string constant for the custom menu item type of "default". It is used with the addCustomMenuItem method.
Type: string
Access: read-only
overrideNavTools
Determines whether to disable all default navigation behavior.
Type: boolean
overridePanTool
Determines whether to override the built-in Pan tool behavior.
Type: boolean
Acrobat 3D JavaScript Reference 75
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
overrideRotateTool
Determines whether to override the built-in Rotate tool behavior.
Type: boolean
overrideSelection
Version 7.0.7
Determines whether to override the built-in Selection tool behavior.
Type: boolean
overrideViewChange
Determines whether to override the setting of Views from Acrobat.
Type: boolean
overrideWalkTool
Determines whether to override the built-in Walk tool behavior.
Type: boolean
overrideZoomTool
Determines whether to override the built-in Zoom tool behavior.
Type: boolean
shiftKeyDown
Determines whether the Shift key was pressed.
Type: boolean
Access: read-only
TOOL_NAME_MEASURE
Version 7.0.7
A string constant for the name of the measure tool. It is equal to "measure".
Type: string
Access: read-only
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
76 Acrobat 3D JavaScript Reference
TOOL_NAME_PAN
Version 7.0.7
A string constant for the name of the pan tool. It is equal to "pan".
Type: string
Access: read-only
TOOL_NAME_ROTATE
Version 7.0.7
A string constant for the name of the rotate tool. It is equal to "rotate".
Type: string
Access: read-only
TOOL_NAME_WALK
Version 7.0.7
A string constant for the name of the walk tool. It is equal to "walk".
Type: string
Access: read-only
TOOL_NAME_ZOOM
Version 7.0.7
A string constant for the name of the zoom tool. It is equal to "zoom".
Type: string
Access: read-only
version
The number corresponding to the version of the Runtime system.
Type: number
Access: read-only
Runtime Methods
addEventHandler( eventHandler )
Registers the provided event handler.
Acrobat 3D JavaScript Reference 77
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
undefined
addCustomMenuItem( name, label, type, checkedState )
Creates a custom menu item in the 3D annotation context menu.
Parameters
Returns
undefined
addCustomToolButton( name, label, type )
Creates a custom tool button in the 3D toolbar.
Parameters
Returns
undefined
eventHandler The event handler object to be registered.
name A string identifying the menu item.
label A string appearing on the menu item.
type A string indicating whether it is a checked menu item. A checked menu item has a check mark toggle next to it. Its possible values are:● "default"● "checked"
checkedState A boolean value indicating the state of a checked menu item.
name A string identifying the tool button.
label A string appearing on the tool button.
type A string indicating whether it is a tool button or a push button. Its possible values are:● "tool button"● "push button"
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
78 Acrobat 3D JavaScript Reference
enableTool( toolName )
Enables the tool with the specified ID.
Parameters
Returns
undefined
disableTool( toolName )
Disables the tool with the specified ID.
Parameters
Returns
undefined
getEventHandler( index )
Obtains the event handler corresponding to the specified index.
Parameters
Returns
An event handler object.
getRendererName()
Obtains the name of the current renderer.
Parameters
None
Returns
A String containing the current renderer’s name.
toolName A string identifying the tool.
toolName A string identifying the tool.
index An integer identifying the event handler.
Acrobat 3D JavaScript Reference 79
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
refresh()
Version 7.0.1
Marks the render area dirty so that it will be redrawn. This is useful when something has changed in the scene but the annotation is in a “Loaded” and not “Live” state.
Parameters
None
Returns
undefined
removeEventHandler( index )
Unregisters the specified event handler.
Parameters
Returns
undefined
removeCustomMenuItem( menuName )
Removes the custom menu item with the specified ID.
Parameters
Returns
undefined
removeCustomToolButton( toolName )
Removes the custom tool button with the specified ID.
Parameters
Returns
undefined
index An event handler object representing the event handler.
menuName A string identifying the custom menu item.
toolName A string identifying the custom tool button.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
80 Acrobat 3D JavaScript Reference
setCurrentTool( toolName )
Sets the current tool to the one with the specified ID.
Parameters
Returns
undefined
Scene Object
A Scene object 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.
Scene Properties
ambientIlluminationColor
Modulates the ambient Color of all materials.
Type: Color
Access: read-only
animations
A list of all Animation objects.
Type: SceneObjectList
Access: read-only
cameras
A list of all Camera objects in the Scene.
Type: SceneObjectList
Access: read-only
defaultRenderOptions
A set of all default rendering options for the Scene.
toolName A string identifying the tool.
Acrobat 3D JavaScript Reference 81
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Type: RenderOptions
Access: read-only
gridMode
Version 7.0.7
The display style of the grid that represents a portion of the ground plane in the Scene. It can have one of the following values:
● "wire": a wireframe grid
● "solid": a solid checkerboard grid
● "transparent": a semi-transparent checkerboard grid
Type: string
GRID_MODE_OFF
Version 7.0.7
A string constant for the grid mode of "off".
Type: string
Access: read-only
GRID_MODE_SOLID
Version 7.0.7
A string constant for the grid mode of "solid".
Type: string
Access: read-only
GRID_MODE_TRANSPARENT
Version 7.0.7
A string constant for the grid mode of "transparent".
Type: string
Access: read-only
GRID_MODE_WIRE
Version 7.0.7
A string constant for the grid mode of "wire".
Type: string
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
82 Acrobat 3D JavaScript Reference
Access: read-only
gridScale
Version 7.0.7
The number of squares on the ground plane grid.
Type: number
lengthUnits
The scale of a unit of length, specified in meters.
Type: number
Access: read-only
LIGHT_MODE_FILE
Version 7.0.7
A string constant for the light mode of "file".
Type: string
Access: read-only
LIGHT_MODE_NONE
Version 7.0.7
A string constant for the light mode of "none".
Type: string
Access: read-only
LIGHT_MODE_WHITE
Version 7.0.7
A string constant for the light mode of "white".
Type: string
Access: read-only
LIGHT_MODE_DAY
Version 7.0.7
A string constant for the light mode of "day".
Type: string
Acrobat 3D JavaScript Reference 83
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Access: read-only
LIGHT_MODE_BRIGHT
Version 7.0.7
A string constant for the light mode of "bright".
Type: string
Access: read-only
LIGHT_MODE_RGB
Version 7.0.7
A string constant for the light mode of "rgb".
Type: string
Access: read-only
LIGHT_MODE_NIGHT
Version 7.0.7
A string constant for the light mode of "night".
Type: string
Access: read-only
LIGHT_MODE_BLUE
Version 7.0.7
A string constant for the light mode of "blue".
Type: string
Access: read-only
LIGHT_MODE_RED
Version 7.0.7
A string constant for the light mode of "red".
Type: string
Access: read-only
LIGHT_MODE_CUBE
Version 7.0.7
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
84 Acrobat 3D JavaScript Reference
A string constant for the light mode of "cube".
Type: string
Access: read-only
LIGHT_MODE_CAD
Version 7.0.7
A string constant for the light mode of "cad".
Type: string
Access: read-only
LIGHT_MODE_HEADLAMP
Version 7.0.7
A string constant for the light mode of "headlamp".
Type: string
Access: read-only
lights
A list of all Light objects in the Scene.
Type: SceneObjectList
Access: read-only
lightScaleFactor
A uniform scale factor for all Light objects in the Scene.
Type: number
lightScheme
Version 7.0.7
The current, preconfigured lighting scheme for the Scene.
It can take one of the following values:
● "file"
● "none"
● "white"
● "day"
● "bright"
Acrobat 3D JavaScript Reference 85
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
● "rgb"
● "night"
● "blue"
● "red"
● "cube"
● "cad"
● "headlamp"
Type: string
Access: read-only
materials
A list of all Material objects.
Type: SceneObjectList
Access: read-only
meshes
A list of all Mesh objects in the Scene.
Type: SceneObjectList
Access: read-only
nodes
A list of all Node objects except the default Camera and default Light objects.
Type: SceneObjectList
Access: read-only
outlineAngle
Version 7.0.7
The crease angle (in degrees) for the appearance of lines in Illustration render modes.
Type: number
showGrid
Version 7.0.7
Determines whether the ground plane grid is displayed.
Type: boolean
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
86 Acrobat 3D JavaScript Reference
renderMode
Version 7.0.7
The default rendering stype for all objects in the 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"
Type: string
RENDER_MODE_DEFAULT
Version 7.0.7
A string constant for the render mode of "default".
Type: string
Access: read-only
RENDER_MODE_BOUNDING_BOX
Version 7.0.7
A string constant for the render mode of "bounding box".
Type: string
Access: read-only
Acrobat 3D JavaScript Reference 87
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
RENDER_MODE_TRANSPARENT_BOUNDING_BOX
Version 7.0.7
A string constant for the render mode of "transparent bounding box".
Type: string
Access: read-only
RENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE
Version 7.0.7
A string constant for the render mode of "transparent bounding box outline".
Type: string
Access: read-only
RENDER_MODE_VERTICES
Version 7.0.7
A string constant for the render mode of "vertices".
Type: string
Access: read-only
RENDER_MODE_SHADED_VERTICES
Version 7.0.7
A string constant for the render mode of "shaded vertices".
Type: string
Access: read-only
RENDER_MODE_WIREFRAME
Version 7.0.7
A string constant for the render mode of "wireframe".
Type: string
Access: read-only
RENDER_MODE_SHADED_WIREFRAME
Version 7.0.7
A string constant for the render mode of "shaded wireframe".
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
88 Acrobat 3D JavaScript Reference
Type: string
Access: read-only
RENDER_MODE_SOLID
Version 7.0.7
A string constant for the render mode of "solid".
Type: string
Access: read-only
RENDER_MODE_TRANSPARENT
Version 7.0.7
A string constant for the render mode of "transparent".
Type: string
Access: read-only
RENDER_MODE_SHADED_SOLID_WIREFRAME
Version 7.0.7
A string constant for the render mode of "solid wireframe".
Type: string
Access: read-only
RENDER_MODE_TRANSPARENT_WIREFRAME
Version 7.0.7
A string constant for the render mode of "transparent wireframe".
Type: string
Access: read-only
RENDER_MODE_ILLUSTRATION
Version 7.0.7
A string constant for the render mode of "illustration".
Type: string
Access: read-only
Acrobat 3D JavaScript Reference 89
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
RENDER_MODE_SOLID_OUTLINE
Version 7.0.7
A string constant for the render mode of "solid outline".
Type: string
Access: read-only
RENDER_MODE_SHADED_ILLUSTRATION
Version 7.0.7
A string constant for the render mode of "shaded illustration".
Type: string
Access: read-only
RENDER_MODE_HIDDEN_WIREFRAME
Version 7.0.7
A string constant for the render mode of "hidden wireframe".
Type: string
Access: read-only
showAxes
Version 7.0.7
Determines whether the world axes are displayed.
Type: boolean
smoothing
Version 7.0.7
When true, smoothing is enabled for meshes in the scene.
Type: boolean
smoothingAngle
Version 7.0.7
The default smoothing angle (in degrees ) for meshes in the scene.
Type: number
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
90 Acrobat 3D JavaScript Reference
smoothingOverride
Version 7.0.7
When set to true, overrides the smoothing values from the loaded model file
Type: boolean
Scene Methods
activateAnimation( animation )
Sets the given Animation to be active on its Node objects.
Parameters
Returns
undefined
addModel( modelRes )
Adds a model Resource to the top level of the Scene.
Parameters
Returns
A Node object representing the top-level Mesh of the loaded model.
createClippingPlane()
Creates a new clipping plane.
Parameters
None
Returns
A ClippingPlane object.
createLight()
Creates a new Light and attaches it to the Scene.
animation The Animation object to be activated.
modelRes The Resource object to be added.
Acrobat 3D JavaScript Reference 91
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
None
Returns
A Light object.
createSquareMesh( sizeX, sizeY, name )
Creates a Mesh that is a unit square. The default UV parameterization fits once in U and V.
Parameters
Returns
A Mesh object.
computeBoundingBox()
Computes the BoundingBox of the Scene.
Parameters
None
Returns
A BoundingBox object.
update()
Applies all changes to the Scene.
Parameters
None
Returns
undefined
sizeX Model units in the x-direction used to size the Mesh.
sizeY Model units in the y-direction used to size the Mesh.
name (Optional) The name that will be assigned to the Mesh.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
92 Acrobat 3D JavaScript Reference
SceneObject Object
A SceneObject object is the base type for objects within the Scene, including Animation, , Material, and Node objects.
SceneObject Properties
name
The SceneObject object’s name.
Type: string
objectGUID
A value that uniquely identifies the SceneObject in custom data.
Type: string
objectID
An unsigned 32-bit value that uniquely identifies the SceneObject.
Type: integer
SceneObjectList Object
A structure that contains references to several SceneObject objects.
SceneObjectList Properties
count
The number of elements in the SceneObjectList.
Type: integer
Access: read-only
Acrobat 3D JavaScript Reference 93
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
SceneObjectList Methods
removeAll()
Removes all the elements from the list.
Parameters
None
Returns
undefined
removeItem( item )
Removes the specified element from the list.
Parameters
Returns
undefined
removeByIndex( index )
Removes the specified element from the list.
Parameters
Returns
undefined
getByID( id )
Obtains the specified element from the list.
item A reference to the specified element.
index An index to the specified element.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
94 Acrobat 3D JavaScript Reference
Parameters
Returns
A SceneObject object.
getByGUID( guid )
Obtains the specified element from the list.
Parameters
Returns
A SceneObject object.
getByIndex( index )
Obtains the specified element from the list.
Parameters
Returns
A SceneObject object.
getByName( name )
Obtains the specified element from the list.
Parameters
Returns
A SceneObject object.
Texture Object
A Texture object represents the mapping of a texture.
id An integer representing the identifier for the specified element.
guid A string representing the GUID for the specified element.
index An integer representing the index of the specified element.
name A string representing the name of the specified element.
Acrobat 3D JavaScript Reference 95
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Texture Properties
amount
The degree to which the Texture is applied, which can be a value from 0.0 to 1.0.
Type: number
angle
The rotation angle, measured in degrees, of the map.
Type: number
clampU
Determines whether the map should be clamped in the U direction.
Type: boolean
clampV
Determines whether the map should be clamped in the V direction.
Type: boolean
image
Version 7.0.7
The Image to be used by the Texture.
Type: Image
modulate
Determines whether to set the blend mode of the Texture with its corresponding color.
Type: boolean
uOffset
The U-offset of the given map.
Type: number
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
96 Acrobat 3D JavaScript Reference
uScale
The U-scale of the given map.
Type: number
use3DSStyleMapping
Determines whether to use 3D Studio style map parameterizations.
Type: boolean
vOffset
The V-offset of the given map.
Type: number
vScale
The V-scale of the given map.
Type: number
Texture Methods
getImage()
Deprecated.
Gets the Image currently used by the Texture.
Parameters
None
The Image currently being used.
setImage( image )
Deprecated.
Sets the Image to be used by the Texture.
Acrobat 3D JavaScript Reference 97
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
undefined
TimeEvent Object
An object that is passed as an argument to the TimeEventHandler object’s onEvent method.
TimeEvent Properties
deltaTime
The difference between the current time and the last time.
Type: number
Access: read-only
time
The current time.
Type: number
Access: read-only
TimeEventHandler Object
A TimeEventHandler 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.
TimeEventHandler Methods
TimeEventHandler()
Constructor.
image The Image to be used.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
98 Acrobat 3D JavaScript Reference
Parameters
None
Returns
A TimeEventHandler object.
TimeEventHandler Callbacks
onEvent( event )
A method that is called when simulation time is increamented in an active 3D annotation.
Parameters
Returns
undefined
ToolEvent Object
An object that is passed as an argument to the ToolEventHandler object’s onEvent method.
ToolEvent Properties
canvas
The Canvas that is the target of the ToolEvent.
Type: Canvas
Access: read-only
canvasPixelHeight
The height, measured in pixels, of the Canvas for which the ToolEvent is intended.
Type: integer
Access: read-only
event A TimeEvent object representing the event.
Acrobat 3D JavaScript Reference 99
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
canvasPixelWidth
The width, measured in pixels, of the Canvas for which the ToolEvent is intended.
Type: integer
Access: read-only
currentTool
The name of the current tool.
Type: string
Access: read-only
toolName
The name of the tool that was clicked.
Type: string
Access: read-only
ToolEventHandler Object
A ToolEventHandler 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.
ToolEventHandler Methods
ToolEventHandler()
Constructor.
Parameters
None
Returns
A ToolEventHandler object.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
100 Acrobat 3D JavaScript Reference
ToolEventHandler Callbacks
onEvent( event )
A method that is called when a tool button is pressed on the 3D toolbar.
Parameters
Returns
undefined
Vector3 Object
An object comprised of three values that represent a point in space or a direction and magnitude.
Vector3 Properties
x
The x-component of the Vector3 object.
Type: number
y
The y-component of the Vector3 object.
Type: number
z
The z-component of the Vector3 object.
Type: number
length
The length of the Vector3 object.
Type: number
Access: read-only
event A ToolEvent object representing the event.
Acrobat 3D JavaScript Reference 101
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Vector3 Methods
Vector3()
Constructor that initializes the new object to (0.0, 0.0, 0.0).
Parameters
None
Returns
A Vector3 object.
Vector3( x, y, z )
Constructor that initializes the new object to the specified components.
Parameters
Returns
A Vector3 object.
add
Adds the specified Vector3 to the current one.
Parameters
Returns
A Vector3 object.
addInPlace( offset )
Adds the specified Vector3 to the current one, and updates the current Vector3 with the resulting value.
x The x-component used to initialize the new object.
y The y-component used to initialize the new object.
z The z-component used to initialize the new object.
offset The Vector3 object to be added to the current one.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
102 Acrobat 3D JavaScript Reference
Parameters
Returns
undefined
addScaled( offset, scale )
Adds the specified Vector3 with the scaled offset to the current one.
Parameters
Returns
A Vector3 object.
addScaledInPlace( offset, scale )
Adds the specified Vector3 with the scaled offset to the current one, and updates the current Vector3 with the resulting value.
Parameters
Returns
undefined
blend( vec, blendFactor )
Blends the current and specified Vector3 by the specified degree.
offset The Vector3 object to be added to the current one.
offset The Vector3 object to be added to the current one.
scale The scaling factor for the offset.
offset The Vector3 object to be added to the current one.
scale The scaling factor for the offset.
Acrobat 3D JavaScript Reference 103
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
A Vector3 object.
blendInPlace( vec, blendFactor )
Blends the current and specified Vector3 by the specified degree, and updates the current Vector3 with the resulting value.
Parameters
Returns
undefined
cross( vec )
Calculates the cross product between the specified Vector3 and the current one.
Parameters
Returns
A Vector3 object.
dot( vec )
Calculates the dot product between the specified Vector3 and the current one.
vec The Vector3 object to be blended with the current one.
blendFactor The degree of blending to be applied, which may be a value from 0.0 to 1.0.
vec The Vector3 object to be blended with the current one.
blendFactor The degree of blending to be applied, which may be a value from 0.0 to 1.0.
vec The Vector3 object to be used in calculating the cross product.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
104 Acrobat 3D JavaScript Reference
Parameters
Returns
A number value representing the scalar dot product.
normalize()
Normalizes the current Vector3.
Parameters
None
Returns
undefined
scale( scale )
Scales the current Vector3.
Parameters
Returns
A Vector3 object.
scaleInPlace( scale )
Scales the current Vector3, and updates the current Vector3 with the resulting value.
Parameters
Returns
undefined
set( vec )
Sets the current Vector3 to the value contained in the specified Vector3.
vec The Vector3 object to be used in calculating the dot product.
scale A number value used to scale the current Vector3.
scale A number value used to scale the current Vector3.
Acrobat 3D JavaScript Reference 105
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
Parameters
Returns
undefined
set( x, y, z )
Version 7.0.7
Sets the current Vector3 to the values contained in the specified components.
Parameters
Returns
undefined
set3( x, y, z )
Deprecated.
Sets the current Vector3 to the values contained in the specified components.
Parameters
Returns
undefined
vec The Vector3 used to set the current Vector3.
x The x-component used to set the current Vector3.
y The y-component used to set the current Vector3.
z The z-component used to set the current Vector3.
x The x-component used to set the current Vector3.
y The y-component used to set the current Vector3.
z The z-component used to set the current Vector3.
Acrobat 3D JavaScript APIAcrobat 3D JavaScript Objects
1
106 Acrobat 3D JavaScript Reference
subtract( offset )
Subtracts the specified Vector3 from the current one.
Parameters
Returns
A Vector3 object.
subtractInPlace( offset )
Subtracts the specified Vector3 from the current one, and updates the current Vector3 with the resulting value.
Parameters
Returns
undefined
offset The Vector3 object to be subtracted from the current one.
offset The Vector3 object to be subtracted from the current one.
Recommended