Hi Erik, On Sun, Mar 2, 2008 at 5:05 PM, Erik Sundnes Løvlie <[EMAIL PROTECTED]> wrote: > Yes, I need to control the camera view and animation path, and I would like > to be able to set up the complete scene (or "level" if you will, in game > terms) in blender and export it (meshes, cameras, lights, etc) to a single > file (.osg would be simplest I guess). In the code I imagine I can then > simply use the camera (or cameras) in the scene graph, with the stored > position and orientation.
OK, what you are looking for is a means of tagging a node in the scene graph that you want to effectively be the camera dolly (mounting) or a "camera view", rather than a camera itself in OSG terms. A camera in OSG terms is an object that is much more akin to an OpenGL camera, and specifies both the placement of scene relative to the camera, the flim of the camera (its graphics context/FBO) and the scene that the camera will take a picture. The scene that the camera takes a picture is specified explicitly by having children underneath the Camera - curiously here the scene is actually owned by the camera taking a picture of it, rather than a scene having a camera (although render to texture effects do have cameras in a scene, but this is a topic for another day). This role is obviously much more sweeping in terms of control of what a camera does in real life, rather than just specifying where the camera should take its picture from which is what modelling packages normally conceptually use. Back to where I started, what you need to place in the scene that you tag as your camera view, and in fact the OSG actually has osg::CameraView transform node for just this purpose, but as yet its not been supported by any of loaders as far as I know. A CameraView in itself doesn't solve the complete task though, as you still need to sync a Camera, that decorates the whole scene, to a CameraView that is placed in the scene. The NodeTackerCallback can be attached to an osg::Camera to do this job, where you provide the path to the CameraView and the callback then accumulates the transform and applies it to the camera. Unfortunately we don't have an example showing this in action so you'll have to wire it up yourself. Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org