HTML5+CSS on Canvas 3D WebGL (TM) Library
 

OBJ File Creation

taccgl™ currently supports OBJ files containing 3D Models consisting of various 3D objects as meshes. You can probably create such an OBJ file with various 3D design programs supporting the OBJ format, however so far only Blender was tested.

You can basically create a scene with your 3D design program as usual and then export the scene to the OBJ format. There however may be some limitations w.r.t. to what features and items of your scene can be exported to OBJ. So for example you cannnot represent animations in OBJ. See MTL File Creation for details on what Materials are supported by taccgl™. In addition taccGL supports a special material named "HTML". An HTML element is mapped on surfaces having this material.

Below we discuss, what export options to choose to produce an OBJ file for taccGL.

Recommended Blender
Export Options

check Include Normals
check Include UVs
check Write Materials
do not check Triangulate Faces
never check Write Nurbs
check Objects as OBJ Objects
select Up: -Y Up
select Forward: Z forward

In taccgl™ the y-axis extends (as in HTML) from the top of the document down. The x-axis extends from left to right. The z axis extends from the user, to the screen. The user and objects in front of the screen are at negative z coordinates, the screen is on the z=0 plane and objects beyond the screen are at positive z coordinates. Many drawing programs, e.g. Blender, use a different convention. So in order to convert, in Blender export you need the select Up: -Y Up and Forward: Z forward (although in taccgl™ the Z-axis goes backwards). If you do not set these correctly, taccgl™ will not show the front view but possibly the bottom view of the model.

taccgl™ can calculate normals but only in a simple way. So if possible, include normals (check Include Normals in Blender). Without normals, surfaces might not appear smooth.

taccgl™ can process UVs in a special way, as discussed in UV Mapping (check Include UVs in Blender).

taccgl™ can process Material (MTL) files. If the MTL file is not present, taccgl™ takes the color and material properties defined with taccgl™, however, the complete model then can use just a single material/color. (check Write Materials in Blender).

taccgl™ can process faces that are triangles, convex quadrilaterals, or arbitrary convex polygones. It can not process free form curved surfaces or NURBS. If you want to simply (without UVs) map HTML elements on surfaces then these surfaces must be quadrilaterals. Therefore you should normally not triangulate faces while otherwise triangulate faces should work as well. (So normally do not check the triangulate faces checkbox and never check Write Nurbs in Blender).

For various functions taccgl™ allows to select individual 3D objects of the model. So 3d object information needs to be included (check Objects as OBJ Objects in Blender).

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:UV Map Creation
Previous Page: taccglOBJFile.objs - Select objects to create transition
Please Add a Comment or Question, click here!