Hi folks,
I feel kinda guilty for asking without reading the manual... somewhat
abated by my frustration for there not being one. So I'm sorry if this
message starts off sounding a little bitter.
I've been spending the last week trying to get some sort of grasp of
OSG to see if it makes sense to chage over from our homegrown
architecture. Right now it isn't looking to good, basically because of
the complexity coupled with the lack of documentation. Why is it so
complicated? Why aren't there a few convenience fucntions and derived
classes that make common things simple (and then it can be up to the
user to hack those to pieces)? A super-basic for-instance: everyone
else in the world seems to have an event loop function that would do the
while-loop with sync, update, and frame. Why do you expect people to
always write this loop? For example, I created a real quick BasicViewer
class to derive from osgProducer::Viewer that makes my main look like this:
#include "BasicViewer.h"
int main( int argc, char **argv )
{
BasicViewer viewer;
if (argc >= 2)
viewer.readScene(argv[1]);
viewer.post();
return 0;
}
Ok, now some nuts and bolts questions:
1) I have an existing application that finds what 3D position is under
the cursor by querying the depth buffer and back-projecting. Is there
an OSG way to do this? I've been trying to use
osgProducer::Viewer::computerIntersections(...), but it doesn't seem to
guarantee that the first item in the HitList is closest to the front
clipping plane. It'd be cool to either have that guarantee or have a
way to get the 3D position without a HitList, and use that position to
constrain the intersection traversal.
2) I don't understand the underlying model regarding Geodes and
Drawables--why are they separate classes? I think I understand why
Shapes are separate from Drawables... because Shapes are used for
commonly-used geometry and this is a lightweight way of providing it for
Drawable subclasses? But I don't understand why Geodes group
Drawables. Why not have Geodes be Drawables and group them with
Groups? What am I missing?
3) My existing app implements an object-centric model of camera movement
(position, orientation, and scale all apply relative to a point
conceptually about arms-length from the user/eyepoint). I've been
trying to subclass the NodeTrackerManipulator to mimic this behavior,
but am having trouble. I've created a sphere (a la Leandro Barros's
examples) to be the tracked item, and have tried moving the sphere
around, but the view seems to stay put. The sphere did, too, until I
remembered to tell the sphere's Drawable to setUseDisplayList(false)...
is there something just as easy to wake up the NodeTrackerManipulator?
Alternatively, is there some sort of event I could trigger to set off
the appropriate update procedures (and potentially reinstate display
list use)?
4) I'd like to tie Python in. PyOSG seems to be in maintenance
mode/a-bit-behind, and Andrew Straw told me there is a more active
osgPython project under way. However, he didn't provide a link and the
project seems to be a bit under Google's radar (I end up with things
like OSG's Trac sandbox and a few e-mails from this list). Any
pointers? Anything worth updating the language binding OSG pages for?
Incidentally, I don't need a full OSG-functionality-in-Python sort of
thing. I'd be happy with something that makes the event loops work
together well, provides a simple way of getting an OSG-capable window
into a wxPython GUI, and allows Python to trigger and handle events and
to manipulate orientations of views and objects. I did this with Tcl/Tk
and my app by exporting a few key variables and then having my objects
support script commands (rather than having an all-encompassing 1:1
mapping between the underlying C++ code and the scripting
language)...ultimately less powerful, but most of the complicated stuff
can stay on the compiled side, and what the underlying system does
support script-wise can then be easily accessed from any scripting language.
Ok, enough questions/comments for now. Anyone willing to address a
couple of these or point me to messages that address them already?
Thanks,
--Matt P.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/