HTML5 Canvas 3D WebGL (TM) js Library

scene Library Method

Short Description: Take complete scene to create transition

Signature: x.scene ()
Class: taccglOBJFile Class

The scene method returns an taccgl3DObject Class object representing a transition displaying the complete scene stored in the OBJ file. The result of scene must be passed as second argument to a or actor in order to attach it to the animation.

Per default the scene is interpreted to be in element coordinates, i.e. (0,0,0) denotes the top left of the HTML element, (1,0,0) the top right, (0,1,0) the bottom left and (1,1,0) the bottom right. The initial depth of the HTML is set identical to the height of the element. Coordintate (0,0,1) of the scene so refer to the top, left, back point of the HTML element, which is depth pixels behind the top left of the HTML element.

If the proportions of the HTML element do not exaclty match the proportions of the scene, the scene is stretched differently for each axis, so that sphere or a cube no longer appear as a sphere or a cube. Other ways of adjustment can be selected using modFit.


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

scene works properly only when and if the OBJ file has been succefully downloaded, i.e. taccglOBJFile.ready returns "ready". However, if the file was not downloaded because of an error or because of ddmode then scene makes an empty transition, that does nothing. So if in ddmode transitions that in dddmode show 3DObjects should just be left out, nothing special needs to be programmed.

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:taccglOBJFile.objs - Select objects to create transition
Previous Page: - Download a model file from the server