Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Loading a _model_? as JSON vertice list or.. any better idea?

skeezix
Guest
Quote
2011-11-10 02:44:19

I've got a pile of procedurally generated content; the models are generated in advance (every couple of weeks), so I expect to have the js app suck them down and rely on the browser to cache them to avoid heavy delays/bandwidth. The models are a fairly high number of triangles, but the textures (or colours really) never change.. so its just a list of vertices that they're made of.

My question is -- if I want to pull down 50 models (lists of vertices and face-colours) -- how best to do that?

ie: I'm not loading them into another content creation tool to transform them, since they're generated automatically as needed. (Think about landscape tesselation, etc.) I've got a service that the js can hit that just returns (say) a big JSON with the vertices/faces, but I could process it into some other format.

OS it aht besdt?

The app could just do a loop and pull down each of the 50 models (lists of vertices) in JSON, and then add each of the 50 to the scene-graph and away we go.

But I just wonder if there is something better .. JSON (being text) would make these extra large, and they're already quite a few triangles.

I don't see any discussion of handling models in the documentation, just a sample on create scene graph njodes from vertice lists.

Hoping theres a better way...

jeff


skeezix
Guest
Quote
2011-11-10 03:16:13

Is there a tool (in source form, say in C or python so I can use it on linux, BSD, windows, whatever) to translate some format file into a ccbjs file? One option for me, rather than have a JSON-vertice-service, is to have a cron job on the server that just gets the pregenerated files, and batch transforms them into ccbjs files of various resolutions (various triangle counts.)

So app coudl come up, suck down a ccbjs file of low res (quick), then over time suck down higher detail versions.

This would rely on some cron job doing..

for loop:
- for each object
- - generate geometry
- - convert geometry into obj or 3ds or some file format
- for each object
- - run batch converter from <foo file format> to ccbjs

If theres a command line tool in python or something we can re-use, that coudl be helpful! (or even during 'make' stage of a makefile, say.)

If such a tool exists, what format of files can it handle?

jeff

I see that possibly CopperCube can do it on command line; I'm not really interested in Copper Cube since I'm procedurally generating everything and not interested in by-hand modelling .. but also, I run Linux and BSD, and most people also run Linux on servers. So CopperCube (Windows and OSX only) isn't suitable for this sort of thing, I think?


niko
Moderator
Quote
2011-11-11 07:27:43

First, I would have suggested to simply - as you wrote - convert your models to .ccb files, and load them using the load() function in copperLicht, using the command line or plugin interface of CopperCube.
But since you don't want to do that, you probably have to roll your own file format / mode of loading.


skeezix
Guest
Quote
2011-11-15 23:13:19

I would want to as I noted.. but your tool is Windows-only, and I (and most) are not running websites on Windows servers ;)

Any chance you can build a command line version of your tool for Linux and/or various Unixes? That would make it pretty useful (or at least for me.) ifdef out the UI, and just keep the command line stuff, and good to go.

ie: Consider that peopler may need server side model format transformation..

As is then, it would seem there is no binary or fast file load.. I'm going to have to pull the model data over the wire and load it into Copperlicht, which I imagine will be heavy :(

jeff


niko
Moderator
Quote
2011-11-16 07:27:31

Hm, no, Linux/Unix version is not likely, I'm sorry. But it also runs on Mac, so Mac server would be an option, it's technically a Unix. ;)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Intern?tional" (you are not logged in)


Text:

 

  

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