|
@@ -1,181 +0,0 @@
|
|
|
-<!DOCTYPE html>
|
|
|
-<html lang="en">
|
|
|
- <head>
|
|
|
- <meta charset="utf-8" />
|
|
|
- <base href="../../" />
|
|
|
- <script src="list.js"></script>
|
|
|
- <script src="page.js"></script>
|
|
|
- <link type="text/css" rel="stylesheet" href="page.css" />
|
|
|
- </head>
|
|
|
- <body>
|
|
|
- [page:Object3D] →
|
|
|
-
|
|
|
- <h1>[name]</h1>
|
|
|
-
|
|
|
- <div class="desc">Play a sequence of morphs in a smooth animation sequence.</div>
|
|
|
-
|
|
|
- <h2>Examples</h2>
|
|
|
-
|
|
|
- <div>
|
|
|
- [example:webgl_lights_hemisphere lights / hemisphere ]<br/>
|
|
|
- [example:webgl_morphtargets_md2 morphtargets / md2 ]<br/>
|
|
|
- [example:webgl_loader_json_blender loader / json / blender ]
|
|
|
- </div>
|
|
|
-
|
|
|
- <code>
|
|
|
- var meshAnim;
|
|
|
-
|
|
|
- loader.load( "models/animated/flamingo.js", function( geometry ) {
|
|
|
-
|
|
|
- meshAnim = new THREE.MorphAnimMesh( geometry, material );
|
|
|
- meshAnim.duration = 1000;
|
|
|
- scene.add( meshAnim );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- function update() {
|
|
|
-
|
|
|
- var delta = clock.getDelta();
|
|
|
- meshAnim.updateAnimation( 1000 * delta );
|
|
|
-
|
|
|
- }
|
|
|
- </code>
|
|
|
-
|
|
|
-
|
|
|
- <h2>Constructor</h2>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[name]( [page:Geometry geometry], [page:Material material] )</h3>
|
|
|
- <div>
|
|
|
- geometry — An instance of [page:Geometry].<br />
|
|
|
- material — An instance of [page:Material] (optional).
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h2>Properties</h2>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[property:Boolean directionBackwards]</h3>
|
|
|
- <div>
|
|
|
- Animation is playing backwards
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Float direction]</h3>
|
|
|
- <div>
|
|
|
- 1 if playing forward, -1 if playing backwards
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Integer startKeyframe]</h3>
|
|
|
- <div>
|
|
|
- The first keyframe (morph) of the sequence
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Integer endKeyframe]</h3>
|
|
|
- <div>
|
|
|
- The last keyframe (morph) of the sequence
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Boolean mirroredLoop]</h3>
|
|
|
- <div>
|
|
|
- Loop animation back and forth
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Integer lastKeyframe]</h3>
|
|
|
- <div>
|
|
|
- The index of the last keyframe played.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Integer currentKeyframe]</h3>
|
|
|
- <div>
|
|
|
- The index of the current frame being played.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Integer length]</h3>
|
|
|
- <div>
|
|
|
- The number of frames (morphs)
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Float time]</h3>
|
|
|
- <div>
|
|
|
- The current playback position of the animation in milliseconds.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Float duration]</h3>
|
|
|
- <div>
|
|
|
- The length of the animation in milliseconds.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h2>Methods</h2>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setDirectionForward]()</h3>
|
|
|
- <div>
|
|
|
- Sets the animation to play forwards
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:null setDirectionBackward]()</h3>
|
|
|
- <div>
|
|
|
- Set the animation to play backwards.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:null playAnimation]( [page:String label], [page:Float fps] )</h3>
|
|
|
- <div>
|
|
|
- label -- The label of the animation <br />
|
|
|
- fps -- The frames per second (in seconds)
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Starts playing a labeled animation. Animations are defined by calling [page:MorphAnimMesh.parseAnimations parseAnimations].
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:null setFrameRange]( [page:Integer start], [page:Integer end] )</h3>
|
|
|
- <div>
|
|
|
- start -- The starting frame (morph) index <br />
|
|
|
- end -- The ending frame (morph) index
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Sets the range of morphs to be played
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:null parseAnimations]()</h3>
|
|
|
- <div>
|
|
|
- Goes through the geometry's morphTargets and generates animations based on the morphTargets' names (morph.name). Names
|
|
|
- are of the form "walk_01", "walk_02", "walk_03", etc or "run001", "run002", "run003". The animation label is then
|
|
|
- the part before the underscore and number, so "walk" or "run" in the examples.<br/><br/>
|
|
|
-
|
|
|
- This function changes the underlying geometry object by adding the animations property to it. This property
|
|
|
- is set to an object of key/pair values, with the key being the label and the value being an object with
|
|
|
- a start and end property that represents the frame index.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:null updateAnimation]( [page:Float delta] )</h3>
|
|
|
- <div>
|
|
|
- delta -- The change in time in milliseconds
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Update the morphTargetInfluences array on the MorphAnimMesh.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:null setAnimationLabel]( [page:String label], [page:Integer start], [page:Integer end] )</h3>
|
|
|
- <div>
|
|
|
- label -- The name of the animation <br />
|
|
|
- start -- The starting frame index <br />
|
|
|
- end -- The ending frame index
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Defines an animation. Sets the geometry.animations[label] to be an object with the start and end properties.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:Object3D clone]( [page:Object3D object] )</h3>
|
|
|
- <div>
|
|
|
- object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned MorphAnimMesh Object.
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Clone a MorphAnimMesh Object.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h2>Source</h2>
|
|
|
-
|
|
|
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
- </body>
|
|
|
-</html>
|