6. December 2011

Fine tune three.js export from Blender

Three.js exporter for new version of Blender 2.60 supports many features. The problem is that default exporter settings generates quite big JSON file even for small models.

Here is list of defaut options for save model function from export_threejs.js:

         filepath = "",
         option_flip_yz = True,
         option_vertices = True,
         option_vertices_truncate = False,
         option_faces = True,
         option_normals = True,
         option_uv_coords = True,
         option_materials = True,
         option_colors = True,
         align_model = 0,
         option_export_scene = False,
         option_lights = False,
         option_cameras = False,
         option_scale = 1.0,
         option_embed_meshes = True,
         option_url_base_html = False,
         option_copy_textures = False,
         option_animation = False,
         option_frame_step = 1,
         option_all_meshes = True

These are good settings when you want to save all objects from scene. It is quite overkill when you need to save just one dynamically generated object. I recommend to turn off following options:

option_all_meshes, option_materials

Here is sample code in Python which will select object by name and save it to file with defined options:

import bpy

bpy.ops.object.select_name(name="ObjectName")
bpy.ops.export.threejs(filepath="ObjectName.js", option_all_meshes=False, option_materials=False)

Further articles about Blender and Python are located under the tag Blender on my blog.

Enjoy 🙂

27. October 2011

WebGL – Mine3D

Three.js is amazing 3D library written in JavaScript.

Eberhard Gräther wrote very interesting port of old Minesweeper. Now you can play it in 3D space 🙂

Checkout Ebehard’s web site. You can find there other cool examples of WebGL and JavaScript. Like this one:

30. June 2011

HTML5 WebGL/Canvas – Standard Slide – sneak peek

Year ago we developed application for navigating in Standard Slide catalog. It was written in Flex and still it’s serving very well.

This year we decided to make further step and we’re preparing version in HTML5. Not only that. We would like to show 3D models right in the browser.

Many thanks to Three.js for great Canvas/WebGL library.

I’ll share small sneak peek with you. I recommend to view it in Google Chrome or Firefox 4+ which has support for WebGL. Other modern browsers supports Canvas and 3D model will be displayed there as well.

Application is not finished yet. Models are in prototype version. We have to fix some issues, but it nicely demonstrates power of HTML5.

Update: You can test newer version 0.6

Test Standard Slide 3D version 0.6.

  • Quick search

  • Links

  • Twitter

    Follow @jurajmichalek on twitter.

  • Comments

  • Tags

  • Topics