Hello,
I'm trying to export Blender models to Javascript.
With the aim to develop a simple webgl game.
Although, I'm new in Blender and have no idea how to export Blender models to Javascript. Any ideas?
Kind regards
Jena
I have had a project like that a while back and these are the things I have learned (it may be a bit outdated now)
One nice way of making models in WebGL is usign SpiderGL, a javascript library that can import collada files:
http://spidergl.org/example.php?id=10. All you have to do is export your blender model as a collada file.
I have had some problems wit this, cause it did not allow me to do all the stuff I wanted, so I came up with this (i's very limited but just what i wanted, vertices and faces and nothing more):
- export blender file as .obj
- convert .obj into a json presentation of the object (i used this script
https://github.com/zidarsk8/Fri/blob/master/static/blenderFiles/convert.py , and again ... it's limited and buggy, i just wrote this to learn)
- draw vertices as i see fit in javascript since i have a json where all my vertices normals and faces are stored. (in the bottom of this horrible mess, you'll find something that uses the json and actually draws it
https://github.com/zidarsk8/Fri/blob/master/static/js/friWalker.js )
So, use SpiderGL if you want to get something done, Use the second method if you just want to learn more and see how stuff is actually made deep down.[/url]
Thanks Zidarsk. I'd been thinking about using WebGL to show Blender models. Your explanation of what can and can't be done was useful.