Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting a Maya scene to JavaScript or WebGL

I have some time and I'd like to convert a Maya scene to WebGL or render it to a canvas if possible without WebGL. The model is of a desk lamp consisting of primitives and meshes, I've parented parts to the joints instead of binding them to the skeleton and now I want to use a JS library or WebGL to render, then animate with mouse movement and/or touch event. If I can get the model onto a canvas, or into a WebGL enabled application while conserving the parented relationships, I could then write a few functions to bind joint rotation to mouse movements, I just need a little help with actually exporting and importing my Maya scene while conserving relationships. Thanks in advance.

like image 648
dcd0181 Avatar asked Jun 13 '12 11:06

dcd0181


2 Answers

You can try Three.js WebGL library for that. They have exporters from 3D models to JSON written in python here.

For example you can try to export your model in obj and then convert it using convert_obj_three.py.

Then you can load your model into canvas using THREE.JSONLoader method. There is a lot of examples on internet.

like image 171
antyrat Avatar answered Nov 16 '22 16:11

antyrat


If your scene is already in Maya then www.inka3d.com should be the right thing for you. Inka3d supports joints, also objects parented to joints, and you can easily change the rotate parameters from javascript in your exported scene using the same parameter names as in maya.

like image 31
Jochen Avatar answered Nov 16 '22 17:11

Jochen