Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi there, I posted an earlier thread about externally loading meshes. This is covered very well now. The next step is to do this dynamically. I guess this is where the variables enter the stage. The idea is to click on an object (2DOverlay) which will be loaded in another scene (It loads the 3D-mesh). See the thread "Externally load specific mesh" to find out about that. Now: Its got to be possible to call these by name, right?! What if the 2DOverlay has the same name as the mesh to be loaded - say the 2DOverlay is called Gun1 and the mesh we gonna display is also called Gun1 (more specific it is called: Gun1.ccbjs).. So set some variables like: if (nameOf2DOverlay) equal to (nameOfmesh.ccbjs) then load it or simply if (nameOf2DOverlay) than load mesh with same name (sameNameOfmesh.ccbjs) This is where YOU are in charge^^ For the most convenient solution I might pay some money. Hints and thoughts are very welcome. Thx KK |
||||
|
It would also work like this: In the button, simply call your function with a variable as parameter to load the mesh and the scene. Like in the On Click behavior of the button add an 'Execute JavaScript' action which calls your function like this: loadMyMesh('thisOne'); and in another button do this loadMyMesh('theOtherOne'); For example. Not sure if this is working in your case. |
||||
|
simply call your function with a variable as parameter to load the mesh Not sure how to achieve this. My problem is that I dont know how the variables interact. Therefore I dont know whether it meets my requirements. The idea is to load a mesh without setting/changing the behaviour of any single scene node (as there are plenty).. Therefore I was hoping you can combine behaviours (or scene node name) and variables. Unfortunatly, I cant find any Tutorial how to dynamically load external files (but javascript.js) A Tutorial would be nice (as I found several threads like this in the CL-Forum). I will write one for you once I figured this out.. @bagg: You mentioned the same issue a while ago. Any updates on that? @niko: Also: When double-clicked over the <canvas> it highlights the fonts below.. Any chance to get rid of that? Imagine a button to zoom in: once you click to fast it selects the text below. This wont be good for some actions.. Will this be solved? Or do we have to work around it? Reg KK |
||||
|
wrote: [quote] @niko: Also: When double-clicked over the <canvas> it highlights the fonts below.. Any chance to get rid of that? Imagine a button to zoom in: once you click to fast it selects the text below. I think this is the browser doing that. Difficult to say, you can try to work around this somehow, and probably depends on the browser. |
||||
|
True.. Its just Chrome Canary Build when it highlights the text. They might get rid of that once they figure it out. I just recognized that FF isn't displaying "Umlaute" - but Chrome does it. Maybe its a bug at the rear end?! |
||||
|
Hi You can write a script that creates a meshscenenode to your current scene then you can set as current scene the other scene that you have the object that you want to load get it with scene.getMeshSceneNodeByName then get it's mesh and copy it to the meshscenenode of the first scene.You will need one script for each button. |
||||
|
Thx bagg.. I will dig into it. I assume the mesh must be attached within that (other) scene (it is not loading externally - but from another scene)? If that is the case: would the scene you actually never go to (but getting copies from) require to be loaded before displaying the current scene?? Please also see my other thread on the "mouse pointer-issue": http://www.ambiera.com/forum.php... Maybe this affects you as well. Cheers KK |
||||
|
I assume that you are using coppercube.If that so you must create both scenes in coppercube put the objects that you want to transfer in the second scene and save the file as ccbjs.Then you must start the scene with engine = startCopperLichtFromFile('3darea', 'copperlichtdata/YourScene.ccbjs'); |
||||
|
About the other thread i am not familiar with games so i don't know..... |
||||
|
Yes Im using CopperCube also.. Thx for the hint. I came along good by externally load them. But using external JavaScripts for every mesh might be a good idea.. You could set the mesh-infos there and display it in the canvas as well. So thumbs up! Thx KK |
|