Want to be able to load, modify, and save ogre scene

ZacharyH

15-06-2006 17:51:31

There are 2 things I’d like to do in OGRE that I can’t find.

1) When an entity is clicked on the screen, I’d like for some kind of widget/manipulator to be displayed. The user can then use this to rotate, scale, and translate the entity and have that reflected in the Scene Node for the entity.

2) I’d like to be able to create a scene programmatically that contains cameras, lights, nodes, entities, viewports, etc. I want to then save this to a file or small number of files and be able to reload it at a later time. I've looked at oFusion but from what I can tell it only loads. I've looked at the C++ code under DotSceneInterface which will do loading and saving. I'm writing in C# and tried to make some wrappers for it but couldn’t figure out how to do it. I also tried using Swig to make the wrappers for me but couldn’t figure out how to do that either. Swig made some code but the types it creates aren’t compatible with the types of the C# data structures. Does any one have some wrappers or detailed instructions on how to make them?

humantargetjoe

15-06-2006 18:32:28

You could write a class to serialize all the Ogre objects, write stream them out, then deserialize them and read stream them in when you wanted to load them.

As far as adding something like a handle to manipulate an object, I've seen Ogre applications that do this in the screenshot section, they're all in native C++, though.

pjcast

18-06-2006 07:14:39

I'm currently working on an editor and I am working on this very issue of loading/unloading scene files. I am writing this with c# and OgreDotNet. I plan to use the .Scene format (though, my editor uses plugins for the project templates and .scene is just one format I want to support).

Anyway, I have a good framework going right now I think. And have started working on the .scene exporting. However, I have hit a snag.. I am not familiar too much with swig, so this is above my head. Anyway, it seems SceneNode.GetAttachedObjectIterator is not implemented (and, a comment in the swig file about needing to implement hash_map).. So, iterating through the scenegraph and getting objects is not a possibility at this time. I was wondering, if this is planned sometime soon?

Only other option is to just keep a seperate list of objects that get created and use that to save a scene. Which, I suppose is a good solution even if the ieterator worked ;)