Re: [osg-users] Camera config file problems

2010-10-14 Thread Robert Osfield
Hi Javier,

Thanks for pointing these problems out, I hadn't tested the viewer
configuration plugin recently so hadn't spotted the regression.  I
suspect the regression happened when we merged the new serialization
support.  I'll put fix the viewer configuration on my TODO list for
the week.

Cheers,
Robert.

On Wed, Oct 13, 2010 at 10:27 PM, Javier Taibo javier.ta...@gmail.com wrote:
   Hi,

   I am trying to figure how to use config files for camera definition with
 osgviewer.
 After some search in the list and browsing the code, it seems that camera
 config files
 can be passed to osgviewer in two ways: the environment variable
 OSG_CONFIG_FILE
 and the command-line option -c. There are some examples in
 OpenSceneGraph-Data/Configuration (with .view extension), but they fail in
 different ways:

   osgviewer -c Configuration/SingleScreen.view cow.osg

 Warning: Could not find plugin to read objects from file
 Configuration/SingleScreen.view.

   OSG_CONFIG_FILE=Configuration/SingleScreen.view
   osgviewer cow.osg

 Warning: Could not find plugin to read objects from file
 Configuration/SingleScreen.view.
 Viewer::realize() - failed to set up any windows
 Warning: Could not find plugin to read objects from file
 Configuration/SingleScreen.view.
 Viewer::realize() - failed to set up any windows

   It seems that the program cannot find the plug-in to read .view files.
  What plug-in is this? Isn't it osgdb_osgviewer?

   Anyway, after browsing the source and experimenting a little more, I
 managed to get it working
 with regular .osg files (instead of .view) that I created with
 osgDB::writeObjectFile from an
 osgViewer::Viewer with the desired configuration. It works with the
 command-line option:

   osgviewer -c mycamera.osg model.osg

   But using the environment variable OSG_CONFIG_FILE still does not work, it
 keep showing
 the following messages:

 Viewer::realize() - failed to set up any windows
 Viewer::realize() - failed to set up any windows

   One last issue with camera config in the command-line option is that even
 though it work
 for the projection matrix and other features, the initial view is reset by
 osgviewer. To avoid
 this, I added this code to osgviewer.cpp after keyswitchManipulator creation
 and configuration.

     if ( arguments.read(--noautohomeview) ) {
     osg::Vec3 eye, center, up;
     viewer.getCamera()-getViewMatrixAsLookAt( eye, center, up );
     keyswitchManipulator-setHomePosition( eye, center, up );
     }

   This way, the config file view matrix is set as home position for the
 manipulator, what
 prevents the manipulator to override it. It is activated with a command-line
 option, to keep
 backwards compatibility.

   Btw, I am using OSG 2.9.9.

   My questions are:
   Is all this config file system deprecated? (the -c command-line option is
 not shown in the
 osgviewer help)
   If it is not, what am I doing wrong?
   Is there any way to see the initial camera position defined in the config
 file,
 without needing to modify the osgviewer code?

   Any help would be very appreciated.


   Best Regards,
   Javier Taibo.


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camera config file problems

2010-10-14 Thread Javier Taibo
  I have not an extremely deep knowledge of the intricacies of OSG code, but
if there
is something I can help with, let me know.

  Anyway, is it OK to use osgDB::writeObjectFile on the osgViewer::Viewer
object to
create the config file?


  Best regards,
  Javier Taibo.

On Thu, Oct 14, 2010 at 9:24 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Javier,

 Thanks for pointing these problems out, I hadn't tested the viewer
 configuration plugin recently so hadn't spotted the regression.  I
 suspect the regression happened when we merged the new serialization
 support.  I'll put fix the viewer configuration on my TODO list for
 the week.

 Cheers,
 Robert.

 On Wed, Oct 13, 2010 at 10:27 PM, Javier Taibo javier.ta...@gmail.com
 wrote:
Hi,
 
I am trying to figure how to use config files for camera definition
 with
  osgviewer.
  After some search in the list and browsing the code, it seems that camera
  config files
  can be passed to osgviewer in two ways: the environment variable
  OSG_CONFIG_FILE
  and the command-line option -c. There are some examples in
  OpenSceneGraph-Data/Configuration (with .view extension), but they fail
 in
  different ways:
 
osgviewer -c Configuration/SingleScreen.view cow.osg
 
  Warning: Could not find plugin to read objects from file
  Configuration/SingleScreen.view.
 
OSG_CONFIG_FILE=Configuration/SingleScreen.view
osgviewer cow.osg
 
  Warning: Could not find plugin to read objects from file
  Configuration/SingleScreen.view.
  Viewer::realize() - failed to set up any windows
  Warning: Could not find plugin to read objects from file
  Configuration/SingleScreen.view.
  Viewer::realize() - failed to set up any windows
 
It seems that the program cannot find the plug-in to read .view
 files.
   What plug-in is this? Isn't it osgdb_osgviewer?
 
Anyway, after browsing the source and experimenting a little more, I
  managed to get it working
  with regular .osg files (instead of .view) that I created with
  osgDB::writeObjectFile from an
  osgViewer::Viewer with the desired configuration. It works with the
  command-line option:
 
osgviewer -c mycamera.osg model.osg
 
But using the environment variable OSG_CONFIG_FILE still does not work,
 it
  keep showing
  the following messages:
 
  Viewer::realize() - failed to set up any windows
  Viewer::realize() - failed to set up any windows
 
One last issue with camera config in the command-line option is that
 even
  though it work
  for the projection matrix and other features, the initial view is reset
 by
  osgviewer. To avoid
  this, I added this code to osgviewer.cpp after keyswitchManipulator
 creation
  and configuration.
 
  if ( arguments.read(--noautohomeview) ) {
  osg::Vec3 eye, center, up;
  viewer.getCamera()-getViewMatrixAsLookAt( eye, center, up );
  keyswitchManipulator-setHomePosition( eye, center, up );
  }
 
This way, the config file view matrix is set as home position for the
  manipulator, what
  prevents the manipulator to override it. It is activated with a
 command-line
  option, to keep
  backwards compatibility.
 
Btw, I am using OSG 2.9.9.
 
My questions are:
Is all this config file system deprecated? (the -c command-line option
 is
  not shown in the
  osgviewer help)
If it is not, what am I doing wrong?
Is there any way to see the initial camera position defined in the
 config
  file,
  without needing to modify the osgviewer code?
 
Any help would be very appreciated.
 
 
Best Regards,
Javier Taibo.
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camera config file problems

2010-10-14 Thread Robert Osfield
Hi Javier,

On Thu, Oct 14, 2010 at 4:06 PM, Javier Taibo javier.ta...@gmail.com wrote:
   Anyway, is it OK to use osgDB::writeObjectFile on the osgViewer::Viewer
 object to
 create the config file?

In theory this is how I'd like it to work - you can serialize in and
out the view configuration.  This isn't fully implemented though.  The
new serializer support now in osgDB does open the door to implementing
this in a relatively straight forward way.  Once I've cleared my
current work items I'll have a bash at implementing this.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Camera config file problems

2010-10-13 Thread Javier Taibo
  Hi,

  I am trying to figure how to use config files for camera definition with
osgviewer.
After some search in the list and browsing the code, it seems that camera
config files
can be passed to osgviewer in two ways: the environment variable
OSG_CONFIG_FILE
and the command-line option -c. There are some examples in
OpenSceneGraph-Data/Configuration (with .view extension), but they fail in
different ways:

  osgviewer -c Configuration/SingleScreen.view cow.osg

Warning: Could not find plugin to read objects from file
Configuration/SingleScreen.view.

  OSG_CONFIG_FILE=Configuration/SingleScreen.view
  osgviewer cow.osg

Warning: Could not find plugin to read objects from file
Configuration/SingleScreen.view.
Viewer::realize() - failed to set up any windows
Warning: Could not find plugin to read objects from file
Configuration/SingleScreen.view.
Viewer::realize() - failed to set up any windows

  It seems that the program cannot find the plug-in to read .view files.
 What plug-in is this? Isn't it osgdb_osgviewer?

  Anyway, after browsing the source and experimenting a little more, I
managed to get it working
with regular .osg files (instead of .view) that I created with
osgDB::writeObjectFile from an
osgViewer::Viewer with the desired configuration. It works with the
command-line option:

  osgviewer -c mycamera.osg model.osg

  But using the environment variable OSG_CONFIG_FILE still does not work, it
keep showing
the following messages:

Viewer::realize() - failed to set up any windows
Viewer::realize() - failed to set up any windows

  One last issue with camera config in the command-line option is that even
though it work
for the projection matrix and other features, the initial view is reset by
osgviewer. To avoid
this, I added this code to osgviewer.cpp after keyswitchManipulator creation
and configuration.

if ( arguments.read(--noautohomeview) ) {
osg::Vec3 eye, center, up;
viewer.getCamera()-getViewMatrixAsLookAt( eye, center, up );
keyswitchManipulator-setHomePosition( eye, center, up );
}

  This way, the config file view matrix is set as home position for the
manipulator, what
prevents the manipulator to override it. It is activated with a command-line
option, to keep
backwards compatibility.

  Btw, I am using OSG 2.9.9.

  My questions are:
  Is all this config file system deprecated? (the -c command-line option is
not shown in the
osgviewer help)
  If it is not, what am I doing wrong?
  Is there any way to see the initial camera position defined in the config
file,
without needing to modify the osgviewer code?

  Any help would be very appreciated.


  Best Regards,
  Javier Taibo.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] camera config file?

2007-10-04 Thread David Callu
Hi mike

update your OpenSceneGraph-Data svn, there are osgViewer configuration file
into.

David

2007/10/4, Mike Wozniewski [EMAIL PROTECTED]:

 Hi all,

 I can't seem to find any documentation about the configuration files
 that can be used with osgViewer to manage cameras.

 I have various CAVE-like configurations that I need to switch between,
 and think that the config files are the way to go.

 Does anyone have an example?

 Thanks,
 -Mike
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] camera config file?

2007-10-03 Thread Mike Wozniewski
Hi all,

I can't seem to find any documentation about the configuration files 
that can be used with osgViewer to manage cameras.

I have various CAVE-like configurations that I need to switch between, 
and think that the config files are the way to go.

Does anyone have an example?

Thanks,
-Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org