≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
addScene() with Overlay2D probleme
Posted by:
(you are not logged in)
Enter the missing letter in: "Internat?onal"
(you are not logged in)
Text:
[quote][b][/b] wrote: [code]engine.load('somefile.ccbjs');[/code] destroy the content of the original file, if not saved and added on reloading. (IMO) So I tried the code of @xakiru - he said that worked: [code] <script type="text/javascript"> var engineSphere = startCopperLichtFromFile('spherearea', 'copperlichtdata/sphere.ccbjs'); var savedBuffer = null; engineSphere.OnLoa_dingComplete = function() { console.log("sphere complete"); var sceneSphere = engineSphere.getScene(); if (sceneSphere) { savedBuffer = sceneSphere.getSceneNodeFromName('sphereMesh1'); //shows buffered javaScript object == sphereMesh1 console.log(savedBuffer) } } var engine = startCopperLichtFromFile('cubearea', 'copperlichtdata/cube.ccbjs'); var cubeSceneNode = null; engine.OnLoa_dingComplete = function() { console.log("cube complete"); var scene = engine.getScene(); if (scene){ loadModel = function(){ console.log("savedBuffer before addChild"); console.log(savedBuffer); scene.getRootSceneNode().addChild(savedBuffer); } // find the cube scene node cubeSceneNode = scene.getSceneNodeFromName('cubeMesh1'); // also, force the 3d engine to update the scene every frame scene.setRedrawMode(CL3D.Scene.REDRAW_EVERY_FRAME); } } document. = function(event){ var key = String.fromCharCode(event.keyCode); // when pressed 'F', move the cube scene node a bit up if (key == 'F' && cubeSceneNode) cubeSceneNode.Pos.Y += 5; // when pressed 'G', move the cube scene node a bit down if (key == 'G' && cubeSceneNode) cubeSceneNode.Pos.Y -= 5; // we need to call the key handler of the 3d engine as well, so that the user is // able to move the camera using the keys engine.handleKeyDown(event); }; </script> <button ="loadModel()">Load Sphere</button> [/code] example here: [url] http://estudio3d.eu/coppercube/testLoad.html [/url] Even if I used the same engine and same scene – in different <DIV>'s, or engine= new CL3D.CopperLicht(), engine.load() - It seems that we could control only the engine loaded in the first <DIV> - see arrow keys and F, G keys implemented from tutorial2. On trying to copy the node from one engine to another I’ve got the same error message: [b] WebGL: INVALID_OPERATION: bind(‘something’): object not from this context[/b]. for all elements of the javascript object. The javascript object was copied but empty (only has his name and appear in nodes list) What does it mean “not for this context” webgl buffer binding error for copperlicht? How could I transfer nodes between running ccbj files?[/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