简体   繁体   中英

Three.js how to import dynamic components?

Example this model is a dynamic component:

http://sketchup.google.com/3dwarehouse/details?mid=c1e4befdfbfd283135b07d6213c348&prevstart=0

How do I import this to Three.js? I was thinking if it was possible to import the model and create the dynamic component dialog with input fields and some javascript? So it would be interactive like it is in google sketchup. I know to import OBJ files to JSON and then load them with three.js, but what happens to the dynamic components?

Dynamic components are in Sketchup-specific format, and there is no way to import them to Three.js as is, while maintaining the dynamic options. When exporting from SketchUp, dynamic components should be exported as they can be seen in SketchUp, but as dumb geometry, the dynamic nature is lost.

You'll have to roll your own dynamic components in Three.js if interactive models are needed, maybe by using skeletal animation, morph targets or just moving geometries/Object3D groups around. Or you could see how the various classes in three.js/src/extras/geometries are implemented. No easy way around as far as I know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM