Getting Started with the Java 3D™ API
Chapter 5
Animation
Dennis J Bouvier
K Computing
Module2: Interaction and Animation Chapter 5. Animation © 1999 Sun Microsystems, Inc.
2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A
All Rights Reserved.
The information contained in this document is subject to change without notice.
SUN MICROSYSTEMS PROVIDES THIS MATERIAL "AS IS" AND MAKES NO WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  SUN MICROSYSTEMS SHALL NOT BE LIABLE FOR ERRORS CONTAINED HEREIN OR FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS IN CONNECTION WITH THE FURNISHING, PERFORMANCE OR USE OF
THIS MATERIAL, WHETHER BASED ON WARRANTY, CONTRACT, OR OTHER LEGAL THEORY).
THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS.  CHANGES ARE PERIODICALLY MADE TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION.  SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME.
Some states do not allow the exclusion of implied warranties or the limitations or exclusion of liability for incidental or consequential damages, so the above limitations and exclusion may not apply to you.  This warranty gives you specific legal rights, and you also may have other rights which vary from state to state.
Permission to use, copy, modify, and distribute this documentation for NON-COMMERCIAL purposes and without fee is hereby granted provided that this copyright notice appears in all copies.
This documentation was prepared for Sun Microsystems by K Computing (530 Showers Drive, Suite 7-225, Mountain View, CA 94040, 770-982-7881, www.kcomputing).  For further information about course development or course delivery, please contact either Sun Microsystems or K Computing.
Java, JavaScript, Java 3D, HotJava, Sun, Sun Microsystems, and the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc.  All other product names mentioned herein are the trademarks of their respective owners.
Module 2: Interaction and Animation
Table of Contents
Chapter 5-1 .5-1 5.2Interpolators and Alpha Object Provide 5-2
javascript免费教程
5.5-2
5.2.2Using Interpolator and 5-4
5.2.3Example Using Alpha 5-4
5.2..5-8
5.2.5Interpolator 5-10
5.2.6Core 5-12
5.2.7Path 5-20 5.5-24
5.3.1Using a 5-24
5.3.2Example .5-25
5.3..5-26 5.4Level of Detail (LOD) 5-28
5.4.1Using a 5-29
5.4.2Example Usage .5-29
5.4.5-31
5.4.4LOD (Level of Detail) 5-32 5-33
5.5.1Using a 5-34
5.5.2Example Morph Application: 5-34
5.5.5-37 5.5-38 5.5-38
List of Figures
Figure 5-1 Some Classes used in Java
5-2 Figure 5-2 Phases of the .5-3 Figure 5-3 Some Basic Waveforms Easily Made with an 5-4 Figure 5-4 Recipe for Using an Interpolator and Alpha Objects 5-4 Figure 5-5 Scene Rendered at 4:30 by the ClockApp 5-6 Figure 5-6 Smoothing of the Waveform Produced 5-7 Figure 5-7 Four Scenes Rendered by AlphaApp Showing the Effect of IncreasingAlphaRampDuration..5-7 Figure 5-8 Java 3D Core and Utility (shaded boxes) Interpolator 5-10 Figure 5-9 Two Scenes from InterpolatorApp Showing 5-11 Figure 5-10 Partial Scene Graph Diagram of a ColorInterpolator Object and its Target Material 5-13 Figure 5-11The Relationship Between Knots and Alpha Value for a 2D 5-20 Figure 5-12 Recipe for Using a Path 5-21 Figure 5-13A Scene Rendered by RotPosPathApp Showing the Interpolation of the Rotation and Position of the Color Cube.  The Red Dots Show the Knots Positions of the 5-22 Figure 5-14 Recipe for Using a Billboard Object to 5-24 Figur
e 5-15 Diagram of Scene Graph Using a Billboard Object as Created in Code 5-26 Figure 5-16 Image of BillboardApp with all 2D 'Trees' Facing .5-26 Figure 5-17 Recipe for Using a DistanceLOD Object to 5-29 Figure 5-18 Partial Scene Graph Diagram for DistanceLODApp 5-30 Figure 5-19 Two Scenes Rendered 5-31 Figure 5-20 Recipe for Using a 5-34 Figure 5-21 Key Frame Images from MorphApp with the Trace of 5-36 Figure 5-22 A Scene Rendered from Morph3App Showing the Animations of Three Alternative Behavior Classes (not all are good).............................................................................................................5-37 List of Code Fragments
Code Fragment 5-1 Using a RotationInterpolator and Alpha to Spin a Clock (from ClockApp)...............5-5 Code Fragment 5-2 An Excerpt from the CreateSceneGraph Method of 5-21 Code Fragment 5-3 Except From the createSceneGraph Method of 5-26 Code Fragment 5-4 Excerpt from createSceneGraph Method 5-30 Code Fragment 5-5 MorphBehavior Class
............................................................5-35 Code Fragment 5-6 An Excerpt from the createSceneGraph Method .5-36 List of Tables
Table 5-1 Summary of Core 5-11
List of Reference Blocks
Alpha 5-8 Alpha Method Summary (partial list)....................................................................................................5-9 Interpolator Method Summary (partial list)..........................................................................................5-12 ColorInterpolator 5-13 ColorInterpolator Method Summary (partial list).................................................................................5-14 PositionInterpolator 5-14 PositionInterpolator Method Summary (partial list)..............................................................................5-15 RotationInterpolator 5-15 RotationInterpolator Method Summary (partial list).............................................................................5-16 ScaleInterpolator C
5-16 ScaleInterpolator 5-17 SwitchValueInterpolator 5-17 SwitchValueInterpolator Method Summary (partial list)......................................................................5-18 Switch 5-18 Switch Method Summary (partial list).................................................................................................5-19 Switch 5-19 TransparencyInterpolator 5-19 TransparencyInterpolator 5-23 PathInterpolator Method Summary (partial list)...................................................................................5-23 RotPosPathInterpolator 5-23 RotPosPathInterpolator 5-24 Billboard 5-27 Billboard Method Su
mmary (partial list).............................................................................................5-28 DistanceLOD 5-32 DistanceLOD 5-32 LOD 5-32 LOD 5-33 Morph 5-37 Morph Method Summary (partial list).................................................................................................5-38 Morph 5-38 Preface to Chapter 5
This document is one part of a tutorial on using the Java 3D API.  You should be familiar with Java 3D API basics to fully appreciate the material presented in this Chapter.  Additional chapters and the full preface to this material are presented in the Module 0 document available at:
java.sun/products/javamedia/3d/collateral
Cover Image
The cover image represents the key frame animation possible using a Morph object and the appropriat
e behavior.  Section 5.5 presents an example program utilizing a Morph object, an Alpha object, and a Behavior object to animate a stick man.

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。