Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
hi ,, i have read a lot of Discussions here about loading model from disk and i understand that you can only load from ccbjs and the question is if i want to load 3d model should i load it i n coppercube first and save it in ccbjs and then use it by loading it inside the main world ccbjs file ...i mean load ccbjs contain only 3d model inside main world ccbjs file ...am i right? |
||||
|
Yes, that's right. The best way is to add all files into one ccbjs file. But you can also import other .ccbjs files during runtime using CopperLicht. |
||||
|
can you give me example of two ccbjs one is 3d model and the other is the main scene |
||||
|
You can just start up copperlicht and call engine.load('yourfile.ccbjs'); To load another file. See this: http://www.ambiera.com/copperlic... |
||||
|
can you give me example of two ccbjs one is 3d model and the other is the main scene I just had this same question in another topic. That link appears to be broken though, so can you post some sample code? Thanks. EDIT: I tried the following, but none of them worked. > Calling engine.load() once for the main one and once for the model I'm trying to load (engine.getScenes() still only returns the most recent one that was loaded and the other scene seems to get lost) > Creating two engine instances bound to the same canvas (the canvas flickers between the two) > Creating two engines and two canvases (I'm unable to move items from one context to the other) |
||||
|
I'll look into this and see what can be done about it. |
||||
|
I haven't tested this code, but wouldn't something like this work:
|
||||
|
^ above should read: engine.ingComplete but the forum was stripping it out for some reason |
||||
|
e n g i n e . O n L o a d i n g C o m p l e t e |
||||
|
yes, that should work. |
||||
|
The code doesn't work as it is. It need a delay because the second engine.OnLoa_dingComplete take the control before the first engine.OnLoa_dingComplete is finished completely. Something like this:
This is a sample about how to load a sphere in a main scene (cube.ccbjs). First loading cube.ccbjs. Then loading sphere.ccbjs and get the savedSphere as javaScript object. Finaly reloading cube.ccbjs and adding savedSphere. http://estudio3d.eu/coppercube/t... But this is a little bit weird, loading and saving, than reloading (with the blinking delay). But only we can load objects in the same main scene. The loaded objects disappear on reloading the main scene. How could I push ccbjs geometry (copperlicht SDK) without losing the previous added geometry? |
|