Description
.OBJ is a simple file format for description of geometry.
SceneJS needs to import geometry, material and texture from these
into a scene graph.
Proposed Solution
Create a SceneJS.LoadOBJ node that generates
its subgraph when first visited by loading and parsing an OBJ file,
in a similar manner to the existing SceneJS.loadCollada node:
var graph = new SceneJS.LoadOBJ({
uri: "http://foo.com/files/myobj.obj"
})
Limitations
- Early versions would provide limited OBJ support, where there
would be documented guidelines for what drawing programs may export
to OBJ files that are desired to work with SceneJS.
SL Avatar Import
Aiming to import Second Life avatar files: http://secondlife.com/community/avatar.php
Vertex normals per face
OBJ files are optimized for doing immediate mode processing -
they provides vertex normals per face instead of per vertex, which
needs to be adapted to to provide a per-vertex normal array for
loading into GLSL as a VBO. You must either duplicate vertices or
calculate normals by averaging the surrounding vertex normals in a
face.
Holes in mesh when animating groups
Faces may be organised in named groups, which can map to BVH
nodes that specify transforms. How are these groups to be
transformed without showing holes in the mesh? Eg. if an "arm"
group was rotated away from a "torso" group, then what prevents a
hole from appearing under the armpit?
Import Options
Support configuration of options in import
* Okino OBJ importer for reference: http://www.okino.com/conv/imp_wave.htm
Resources