≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Rotating camera around scene
Posted by:
(you are not logged in)
Enter the missing letter in: "In?ernational"
(you are not logged in)
Text:
[quote][b][/b] wrote: My code got cut off. [code] $("3darea").css({"position": "relative", "top": (offsetH/2) + "px"}); } }); // helper function for quickly creating a 3d vertex from 3d position and texture coodinates createVertex = function (x, y, z, s, t) { var vtx = new CL3D.Vertex3D(true); vtx.Pos.X = x; vtx.Pos.Y = y; vtx.Pos.Z = z; vtx.TCoords.X = s; vtx.TCoords.Y = t; return vtx; } // our own scene node implementation MySceneNode = function(engine, x, y, z) { this.init(); // init scene node specific members // create a 3d mesh with one mesh buffer this.MyMesh = new CL3D.Mesh(); var buf = new CL3D.MeshBuffer(); this.MyMesh.AddMeshBuffer(buf); // set indices and vertices buf.Indices = [0,2,1, 0,3,2, 1,5,4, 1,2,5, 4,6,7, 4,5,6, 7,3,0, 7,6,3, 9,5,2, 9,8,5, 0,11,10, 0,10,7]; buf.Vertices.push(createVertex(0, 0, 0, 0, 1)); buf.Vertices.push(createVertex(x, 0, 0, 1, 1)); buf.Vertices.push(createVertex(x, y, 0, 1, 0)); buf.Vertices.push(createVertex(0, y, 0, 0, 0)); buf.Vertices.push(createVertex(x, 0, z, 0, 1)); buf.Vertices.push(createVertex(x, y, z, 0, 0)); buf.Vertices.push(createVertex(0, y, z, 1, 0)); buf.Vertices.push(createVertex(0, 0, z, 1, 1)); buf.Vertices.push(createVertex(0, y, z, 0, 1)); buf.Vertices.push(createVertex(0, y, 0, 1, 1)); buf.Vertices.push(createVertex(x, 0, z, 1, 0)); buf.Vertices.push(createVertex(x, 0, 0, 0, 0)); // set the texture of the material // buf.Mat.Tex1 = engine.getTextureManager().getTexture("test.jpg", true); } MySceneNode.prototype = new CL3D.SceneNode(); // derive from SceneNode MySceneNode.prototype.OnRegisterSceneNode = function(scene) { scene.registerNodeForRendering(this, CL3D.Scene.RENDER_MODE_DEFAULT); CL3D.SceneNode.prototype.OnRegisterSceneNode.call(this, scene); // call base class } MySceneNode.prototype.render = function(renderer) { renderer.setWorld(this.getAbsoluteTransformation()); renderer.drawMesh(this.MyMesh); } </script> </head> <body> <div id="debugblock"></div> <center> <canvas id="3darea"></canvas> </center> </body> </html> [/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact