mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.69k stars 35.37k forks source link

WebGL skinning animation #962

Closed ge5 closed 12 years ago

ge5 commented 12 years ago

I am trying to run the "webgl - animation - skinning" example with various other animated .js models in place of the "animated buffalo" provided--all to no avail with the same error re. "THREE.js Animation Handler/line 351" and "Uncaught TypeError: Cannot read property 'name' of undefined"--any suggestions/ideas? Thank you.

alteredq commented 12 years ago

How did you get these models? Only buffalo has skeleton and skeletal animation.

ge5 commented 12 years ago

Thank you for your quick response/ I now see (from your question and then looking at the animated buffalo.js file versus the horse (animated).js file and some of my own simple animated models) that these are very different scripts, indeed. I was under the misconception that since I rigged a simple armature w/bones in Blender and was able to export to .js that this would be the same as "skeleton/skeletal"--So I use "morphTarget" instead for these? and then is it possible to generate the "skinned" models via Blender? Is there an advantage? I really appreciate your help and patience towards a "noob"!

-----Original Message-----

From: AlteredQualia reply@reply.github.com Sent: Dec 27, 2011 12:08 PM To: ge5 ge5@nyu.edu Subject: Re: [three.js] webGL_animation_skinning (#962)

How did you get these models? Only buffalo has skeleton and skeletal animation.


Reply to this email directly or view it on GitHub: https://github.com/mrdoob/three.js/issues/962#issuecomment-3283104

alteredq commented 12 years ago

So I use "morphTarget" instead for these?

Yes.

and then is it possible to generate the "skinned" models via Blender?

Only as morphs. It doesn't matter how animations are generated in Blender, everything gets converted to morphs on export.

Is there an advantage?

Advantage is exactly this, all complexities of skinning / rigging are lost on conversion, only vertex positions matter for morphs. Also morphs are very fast on playback

Disadvantage is that morphs are only suitable for relatively small meshes, as every keyframe needs all vertices. Also you can't really do easily procedural animation.

ge5 commented 12 years ago

body{font-size:10pt;font-family:arial,sans-serif;background-color:#ffffff;color:black;}p{margin:0px;}wow-thanks; that is really helpful info / clarifies a ton (i am coming from actionscript 3 + papervision...) so, would you recommend MD5 format in Blender to try to work on "procedural" animation /interactivity? (i need to stick to Blender)--but then how would i export to JSON loader? -or don't i need to convert ?Again, your help is deeply appreciated.-----Original Message----->From: AlteredQualia >Sent: Dec 27, 2011 6:19 PM>To: ge5 >Subject: Re: [three.js] webGL_animation_skinning (#962)>>> So I use "morphTarget" instead for these? >>Yes.>>> and then is it possible to generate the "skinned" models via Blender?>>Only as morphs. It doesn't matter how animations are generated in Blender, everything gets converted to morphs on export.>>> Is there an advantage?>>Advantage is exactly this, all complexities of skinning / rigging are lost on conversion, only vertex positions matter for morphs. Also morphs are very fast on playback>>Disadvantage is that morphs are only suitable for relatively small meshes, as every keyframe needs all vertices. Also you can't really do easily procedural animation.>>--- >Reply to this email directly or view it on GitHub:>https://github.com/mrdoob/three.js/issues/962#issuecomment-3286503

alteredq commented 12 years ago

Oh, that's hard to read. I suggest not to use "reply-by-mail" feature, only use web interface.

In Blender you can use whatever you want, just your animations will be exported as morphs.

Also you could use Collada, it does support skinning, but just as a way of having smaller files, upon loading to three.js it's anyways converted to morphs for playback (in ColladaLoader there is software skinning which bakes frames into morphs).

ghost commented 12 years ago

As I understand from above Blender exporter generates only morph targets. So what are the tools to create models with bones that can be used with Three.js ? Could you point me to some demos of skeletal animation in three.js ? ( other than the buffalos)

mrdoob commented 12 years ago

1979