WebGL (TM) Framework

3D Object Class

A transition of class taccgl3DObject shows or animates one or more 3D Objects that were designed with an external 3D Modelling program, such as Blender. taccgl3DObject inherits most of the methods and properties of the Transition Class. A taccgl3DObject is associated with an HTML element and takes position and size of it as basis for the position and size of the 3D object. Also optionally the HTML element can be mapped on the 3D object. taccgl3DObject works only in dddmode. In ddmode no objects are shown and such transitions are silently ignored.

For example the image above could be replaced by a Torus or a complete scence of various objects. There are various options to fit the scene in the space of the HTML element, by default it is stretched to fit the replaced HTML element in every direction.

You can use all known methods of Transition Class to aminate, e.g. to, rotate, or resize. All these functions animate the complete taccgl3DObject. If you want to animate individual objects of a 3D scene, then you need to create multiple taccgl3DObjects each taking one or some objects of the scene for animating them individually.

In order to create a taccgl3DObject, you first need to load an 3D model file (see objFile, read, and taccglOBJFile Class). Then you can use taccglOBJFile.scene or taccglOBJFile.objs to select the complete scene or just some objects. The result of taccglOBJFile.scene or taccglOBJFile.objs then must to be supplied to actor or a etc.


var of=taccgl.objFile(); of.read('/objtest/taccgldoc.obj',false);
var a=taccgl.a("Layout",of.scene()).modFit(). pos(100,500,-5000). rotateMiddle(0.7,0,0.7).dur(3).start();

The methods taccgl3DObject.modFit and taccgl3DObject.setModMat can be used to scale, align, and rotate the external 3D model to fit with the HTML element selected.

taccgl3DObject has relatively few methods, because in fact it inherits most methods from Transition Class.

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:taccgl3DObject.modFit - Align scene with HTML element
Previous Page: taccglMTLFile.ambientAdjust - Ajust Ambient Color