ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:    
Ambiera Forum > CopperLicht
Loading Models
Author Text

sumwon
Registered User
Quote
2010-04-14 07:43:52

Hello,

After going through the documentation for CopperLicht, I noticed I saw no methods for loading models from a file, such as Collada or 3ds files. Is there a built-in method at this time to do so, or do you have to use CopperCube/write your own model loader. If there isn't one, do you plan on adding one in the future?

Thanks.


erik
Registered User
Quote
2010-04-14 09:42:30

It works like this: Import your .3ds, .x, .lwo or whatever file into the CopperCube editor and create a .ccbjs file from it. This is a small file which is fast to be downloaded. You can load these in CopperLicht.


sumwon
Registered User
Quote
2010-04-14 11:51:11

erik wrote:
It works like this: Import your .3ds, .x, .lwo or whatever file into the CopperCube editor and create a .ccbjs file from it. This is a small file which is fast to be downloaded. You can load these in CopperLicht.

I don't think you read my post in it's entirety ;P

sumwon
Is there a built-in method at this time to do so, or do you have to use CopperCube/write your own model loader.

I'm aware that you can load a model using CopperCube, but I was curious as to whether or not there's a premade method within CopperLicht to load models.

I currently don't have 100 euros to dish out for CopperCube and am rather comfortable working with code alone, so I really have no reason to buy it anyway, other than a little simplicity I suppose. Oh, and to support Niko and his awesome work of course.
Thanks for the response.


niko
Moderator
Quote
2010-04-14 14:08:29

it's currently the only way to load models this way. I wrote it that way to strip out all the unnecessary data of other file formats so that the client doesn't need to download unnecessary big files in order to start the 3d app. Plugins like loaders for other file formats would be possible, but are currently not planned. But feel free to contribute, of course :)


sumwon
Registered User
Quote
2010-04-14 22:25:58

Alright, makes sense. Perhaps I'll work on my own importer or something then.

Thanks, guys!


pavlost
Registered User
Quote
2010-06-15 13:48:32

I realize that the main purpose CooperLicht isnt supporting methods for loading models is to force people to buy CooperCube. However,there are many situations that you need to load a model on the fly. For example, i am making a game when the user selects his avatar outside the html5 canvas and i simply need to load the appropriate model in cooperlicht. The way i am doing it is by having all the models allready loaded in the scene and making visible the one that user selects. It works but its totally wrong as its a waste of resources and poor programming.

Niko, since you allready have all the methods for loading models ready, why dont you add some to Cooperlicht? At least for some old formats like MD2 or MD3. As the Cooperlicht user base grows, i am sure coobercube will too. If you keep Cooperlicht without loading methods, people will simply go to other webgl frameworks that support that.


niko
Moderator
Quote
2010-06-15 16:38:02

Well, you can always also load .ccbjs files dynamically, this should work without any problem.
Loading .3ds, .obj or other huge file formats is a probably more a waste of resources and bandwidth. That's why the geometry and scene is packed into one single file, not to force you into using CopperCube. :)

And if you like, you can always implement your own loader for your own file format to CopperLicht, or even implement one for one of the file formats you mentioned. There is none implemented yet for CopperLicht since CopperCube can convert all those into .ccbjs and CopperLicht then only needs to know how to load those (reducing a lot of javascript code, again: better for bandwith and performance).


FragFrog
Guest
Quote
2010-06-15 22:50:30

I am a new user to CopperLicht and CopperCube, and I must admit: so far, it's pretty awesome. I just used a small app to convert models from an old game to 3ds files, used CopperCube to load those into a scene and *bam* - game models directly on the web! Awesome!

Having said that, I too do not have the $100 to spare for a full fledged version of CopperCube, especially not when all it needs to do for me is be a fancy conversion tool - which leads me to SpiderGL, a package that for all intends and purposes is inferior to CopperLicht, except its ability to work directly with OBJ and DAE files.

Now, I am not proposing CopperLicht be made into some code monstrosity capable of importing everything CopperCube can, and I can only speak for myself in this, but the ability to directly load an obj / dae / collada / whatever file, even if it's just a single (well supported) format, would be the difference for me between going with CopperLicht (and he, who knows, maybe in the future when my app's made me rich buy a license) or working with the few alternatives there are, bad though they might be in most other regards.

Just a thought: maybe its possible to create a few small conversion programs? A simple exe that converts all *.obj files in a directory to *.ccbjs would be awesome, heck, I'd put down a few bucks for that.


niko
Moderator
Quote
2010-06-16 08:52:22

Would be an idea. Thanks for the feedback, I'm going to think about this a bit.


pavlost
Registered User
Quote
2010-06-16 11:22:35

FragFrog has a point. Cooperlich is heavily depended on CooperCube and that is a problem. Another idea is to give some small libraries in a form of .js files with loading methods in them. There are model formats like MD2 that are low poly so downloading them wouldnt be a problem in terms of efficiency.

Cooperlich is right now the best framework for webgl development and i say that after i have worked with GLGE and C3DL. To remain the best add a few loading methods and dont worry, people will still buy CooperCube 8-)


mgan
Registered User
Quote
2010-06-23 23:27:00

Just stumbled onto Copperlich and love it. As I was reading the doc because I want to know if I can import blender3d models or google-sketchup models I realized there were no documents explaining how I go about that. So I come here and saw this thread.

I kinda see the issues with not wanting people to dynamically load large models. That makes sense. But could there be a bridge to take my blender3d models convert them to this .ccbjs format? I see it as time consuming task and for me I'd want the converter to be in python or javascript (node.js). I'd be willing to help take on some of the project to work on a converter, just I honestly don't know where to start.

However, if someone were to start it and wanted some help let me know.

Niko this is a great project and look forward to it succeeding


pavlost
Registered User
Quote
2010-06-24 09:43:12

What you can do is, convert your rblender3d models to a format that can be imported by coppercube (there are lots of them) and publish it to .ccbjs Then you can load dynamically .ccbjs with copperlicht.


sweaver
Registered User
Quote
2013-10-07 19:14:26

I know this post is old, but does anyone know the best method for loading a scene node from another scene into the main scene? For example, if I had a scene with just a crate in it and I wanted to load the crate into another scene, is there sample code anywhere showing the preferred way of doing that?


niko
Moderator
Quote
2013-10-09 08:37:00

No, but you should be able to just remove the node from its parent in the loaded scene and add it as child to the parent in the new scene.


mdzima
Registered User
Quote
2018-10-21 17:59:51

I pulled the code from github and run the server. But it doesn't render the object like in the video. The object look black and i hardly see anything´╗┐ ..


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Forum 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


   





Software: Ambiera Light Forum. © 2008-2018 Nikolaus Gebhardt, Ambiera e.U.