好的,我花了很多时间在这上面...我已经阅读了很多文档有意义和相同数量的源代码......
我有一个json加载器和一个搅拌器动画
它是一个简单的步行循环......
/******************************************************************/
// name :buffer_set_up
// params : none
// functions : creates the buffer to adjust
// returns : nothing
this.buffer_set_up = function() {
this.add('manager', new THREE.LoadingManager());
this.get_setting('loader').load('sites/all/themes/brain/models/sitespace.json', function(geometry, materials) {
materials.forEach(function (material) {
material.skinning = true;
});
var character = new THREE.SkinnedMesh(
geometry,
new THREE.MeshFaceMaterial(materials)
);
closed_object.get_setting('scene').add(character);
closed_object.set_up_model_animation(character);
});
}
// name : set_up_model_animation
// params : model is the model that is currently animating
// functions : intitiates the animation mixer
// return : nothing
this.set_up_model_animation = function(model) {
this.add('mixer', new THREE.AnimationMixer( model ) );
this.add('walk', closed_object.get_setting("mixer").clipAction(model.geometry.animations[1]) );
this.get_setting('walk').play();
}
///// ******** rAF ************* //////
// name : animate
// params: none;
// function: calls the looping animation sequence where rendering takes place
// returns nothing
this.animate = function() {
requestAnimationFrame(function() {
closed_object.animate(); // calls a frame reliable function
});
// wait for the animation mixer to catch up
if(typeof closed_object.get_setting('mixer') != 'undefined') {
/// the docs say to pass into the mixer the delta. [new time - old time] and scale that by the mixers time scale
// closed_object.get_setting('mixer').timeScale * closed_object.get_setting('clock').getDelta()
closed_object.get_setting('mixer').update( closed_object.get_setting('clock').getDelta() );
}
closed_object.get_setting('renderer').render(
closed_object.get_setting('scene'),
closed_object.get_setting('camera'),
);
}
/***********************************************************/
我的网站加载模型...我没有错误,但我的动画操作没有做任何事情