possible to use real streaming?

Started by mogli, June 14, 2006, 09:56:46 AM

Previous topic - Next topic

mogli

hi!

is it possible to use a real streming for building objects?

i have to use a streaming algorithm for streaming objects over network.
i start at a first room and load the neighbour rooms one after the other. when i change the rooms i load the neighbours of this one and delete old rooms and so one...
the problem is when i add the objects the screens jerks.
i add the objects by using Loader.load3DS( InputStream resource, float scale  ). creating an octree and building an Object3D and save it ot a renderqueue.
after rendering the scene i take the first object from renderqueue and add it to the world.

but there is no difference between using load3DS with inputstream or with file because the object is only build when the inputstream is finished. :(

has somebody a notion how to do this in a better way?

perhaps it's possible to load one polygon after the other from the 3ds file and add polygon after polygon to the object. perhaps as child of the first polygon from the object so when i delete the first one from the world the childs are also deleted or by using the object3d megerobjects function.

hope to understand what i mean and somebody could help me...plz ;)

EgonOlsen

You can't stream 3DS. It's organized in chunks and you can't process the whole thing until you've all the chunks you need. If you want to stream your data, you would have to build your own format optimized for this task and a converter from 3DS into this format. Shouldn't be too hard to do.
Does the loading of the objects already happen in a separate thread?

mogli

Quote from: "EgonOlsen"You can't stream 3DS. It's organized in chunks and you can't process the whole thing until you've all the chunks you need.

hmm, sry, i don't know before. had to informe be better before next time.
but the load3DS functions returns an array of Object3Ds. is it perhaps possible to get this Object3Ds seperate? i don't know how you handle this intern? can you build the Object3Ds first after you get the whole 3ds-object?

QuoteIf you want to stream your data, you would have to build your own format optimized for this task and a converter from 3DS into this format. Shouldn't be too hard to do.
hmm, could be a solution. is it possible to stream from the xml-format? but this is much bigger than the 3ds format, isn't it?

QuoteDoes the loading of the objects already happen in a separate thread?
yes i start a thread for each object...

EgonOlsen

XML requires the document to be well formed. You may stream the data from  the XML, but not the xml itself. With most 3d formats, you'll have the problem, that the vertices are not defined per polygon, i.e. you have a bunch of vertices and then comes a bunch of polygons which mainly consist of indices into the bunch of vertices. So to stream the polygons, you should have at least all vertices available (plus texture information and similar stuff).
Your current goal is to add smaller parts of a room to the world to avoid the one, large hickup and get more smaller hickups instead, right?

mogli

year, that's wright! i think this is much comfortable for the user.

i think there are also two things which create the hickups. first the one when i call the load3Ds function and then in the main-loop when i add the object to the world. perhaps i render the world four or five times bevor i add a new object to the world.

...or i have to export the rooms in more parts than i do at the moment.