Re: [osg-users] Text Intersecting Earth

2007-10-17 Thread Robert Osfield
Hi Jeffrey,

In the 2.x series of the OSG there is an osgfadetext example that uses
a ClusterCullingCallback to cull the text when its on the far side of
the earth, and disables depth test when its on the front side - this
sounds similar to your needs.

Robert.

On 10/16/07, Jeffrey M Short [EMAIL PROTECTED] wrote:

 Hi,

 First off I'm using OSG 1.0.

 I am creating an application that has globe viewing features.  The user can
 add an location object at a given Latitude, Longitude and Altitude.  Then a
 3d model and a text label is placed at that location.  Both the model node
 and the text geode are placed under a MatrixTransform with the matrix set
 using the
 osg::EllipsoidModel-computeLocalToWorldTransformFromLatLongHeight.  The
 text uses SCREEN_COORDS as the CharacterSizeMode and uses SCREEN as the
 AxisAlignment.

 The problem is that the text is intersects the earth when viewed from
 certain viewpoints.  I would like to draw the earth first, then draw all
 the text, but only draw any particular text geode if and only if the
 location is not clipped by the Earth.


 My first attempt was as follow:
  I set the text geode depth test to osg::Depth::ALWAYS.

  I added a custom osg::Drawable::CullCallback to the text geodes.  In
 the callback's virtual bool cull(osg::NodeVisitor* nv, osg::Drawable*
 drawable, osg::State*) const function I got the eye location and the text
 location in Earth Centered Cartesian Coordinates.  Then if the dot product
 of these 2 position vectors is  0, return true so the text is culled.


 One problem I encountered here was getting the eye location from
 CullVisitor::getEyePoint().  This function seems to return the EyePoint in
 local coordinates.  I tried using the
 osg::computeLocalToWorld(nv-getNodePath()) matrix to transform the
 EyePoint to Earth Centered coordinates but that didn't work.  I had
 transform osg::Vec4(EyePoint, 1) by the inverse of
 osg::EllipoidModel::computeLocalToWorldTransformFromXYZ to get the job
 done.

 This method works but only when the camera is targeted at the center of the
 earth and it only works for locations with 0 altitude (imagine a location
 on the other side of the Earth from where you are viewing.  If the
 location has a large enough altitude you could still see it).

 Any suggestions on a better way to accomplish this?

 Thanks
  Jeff



 Computer Sciences Corporation
 Registered Office: 2100 East Grand Avenue, El Segundo California 90245, USA
 Registered in USA No: C-489-59

 

 This is a PRIVATE message. If you are not the intended recipient, please
 delete without copying and kindly advise us by e-mail of the mistake in
 delivery.
 NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
 any order or other contract unless pursuant to explicit written agreement
 or government initiative expressly permitting the use of e-mail for such
 purpose.
 


 ___
 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] Slave cameras in a view

2007-10-17 Thread Karl Heijdenberg
Hi and thanks for the tip about where to look for code for the
projectionOffset. I now have a slave camera with the expected projection
offset next to the master camera.

One thing that I found out was that the slave camera is drawn one frame
after the master. Both cameras are drawn to the same graphics context. I can
easily see this in the seam between the two cameras by moving my scene up or
down at a constant speed. My slave camera is then drawn a at a constant
distance behind my master camera.

In the osgwindow example separate graphics contexts are used for master and
slave cameras. Is that the way it should be done? And then why?

If I set up the two cameras with different graphics contexts they draw
within the same frame (when I use the thread per context threading model).

Regards Karl


On 10/15/07, Robert Osfield [EMAIL PROTECTED] wrote:

 Hi Karl,

 Have a look at the osgwindows example, or the
 View::setUpViewAcrossScreens() source code in
 src/osgViewer/Viewer.cpp.

 On 10/10/07, Karl Heijdenberg [EMAIL PROTECTED] wrote:
  Hi,
 
  I'm trying to add two cameras to one View in compositeViewer.
  The first camera is added as a master camera and the second as a slave
  camera.
 
  Frustums for the cameras:
  master={-50, 0, -40, 40}
   slave={0, 50, -40, 40}
 
  For the first camera I set the projectionMatrix with
  setProjectionMatrixAsFrustum.
 
  How do I calculate the projectionOffset for the slave camera?
 
  The offset is needed in call to addSlave(osg::Camera* camera,const
  osg::Matrix projectionOffset, const osg::Matrix viewOffset, bool
  useMastersSceneData=true);
 
  I've also tried to set the reference frame to
 ABSOLUTE_RF_INHERIT_VIEWPOINT
  and then call the setProjectionMatrixAsFrustum for both cameras. This
 test
  ended up in a black scene for the second camera. Am I missing something?
 
  Thanks, Karl
  ___
  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] Quaternion multiplication order

2007-10-17 Thread Robert Osfield
Hi Will,

The quaternion multiplication order has to be consistent with the rest
of the OSG i.e.

   v' = v * M;

Now what is standard for other libraries, or even other communities is
an issue, but since libraries and communities all use their own
standards there is now way for the OSG to be consistent with all of
them - it has to stick with one and keep to it.

In the case of quats and matrix orderering one should have the same
between result from doing

   Quat q1 = ..
   Quat q2 = ..

   Matrix m1 = osg::Matrix::rotate(q1) *  osg::Matrix::rotate(q2);
   Matrix m2 = osg::Matrix::rotate(q1*q2);

   // if everything works m1 should equal m2;

Robert.


On 10/16/07, Will Dicharry [EMAIL PROTECTED] wrote:
 Hello,

 I noticed that the cross terms in osg's quaternion class binary
 multiplication differ from the usual mathematical definition of quaternion
 multiplication.  The subtractions are opposite what they should be.

 osg's implementation is


 /// Binary multiply

 inline const Quat operator*(const Quat rhs) const

 {

 return Quat( rhs._v[3]*_v[0] + rhs._v[0]*_v[3] + rhs._v[1]*_v[2] -
 rhs._v[2]*_v[1],

 rhs._v[3]*_v[1] - rhs._v[0]*_v[2] + rhs._v[1]*_v[3] + rhs._v[2]*_v[0],

 rhs._v[3]*_v[2] + rhs._v[0]*_v[1] - rhs._v[1]*_v[0] + rhs._v[2]*_v[3],

 rhs._v[3]*_v[3] - rhs._v[0]*_v[0] - rhs._v[1]*_v[1] - rhs._v[2]*_v[2] );

 }

 I believe that it should be:

 /// Binary multiply

 inline const Quat operator*(const Quat rhs) const

 {

 return Quat(

 rhs._v[3]*_v[0] + rhs._v[0]*_v[3] - rhs._v[1]*_v[2] + rhs._v[2]*_v[1],

 rhs._v[3]*_v[1] + rhs._v[0]*_v[2] + rhs._v[1]*_v[3] - rhs._v[2]*_v[0],

 rhs._v[3]*_v[2] - rhs._v[0]*_v[1] + rhs._v[1]*_v[0] + rhs._v[2]*_v[3],

 rhs._v[3]*_v[3] - rhs._v[0]*_v[0] - rhs._v[1]*_v[1] - rhs._v[2]*_v[2] );

 }

 The effect of this transposition is to force a pre-multiplication ordering
 for the operation.  I am wondering whether this is intentional or a mistake
 and if it is intentional, why was it chosen to work this way.  I searched
 the osg mailing list archives, and I found a similar question posted in
 2004, but I haven't been able to find a follow up to that message.

 This causes problems in my application because I may receive orientation
 data from a source that uses a different quaternion library using the
 post-multiplication ordering, which is the standard way in the mathematical
 community.

 Thanks,
 Will
 ___
 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] Slave cameras in a view

2007-10-17 Thread Robert Osfield
Hi Karl,

The master and slave cameras will be drawn in the same frame.

If you see a difference then it must be down to the propagation of the
settings from the master to the slave being out of sync.  I don't know
how you set the master, perhaps you are setting it after the sync
point.  The View::updateSlaves() method that does this sync is called
from within Viewer::updateTraversals() so perhaps you are setting the
master camera after this.

Robert.

On 10/17/07, Karl Heijdenberg [EMAIL PROTECTED] wrote:
 Hi and thanks for the tip about where to look for code for the
 projectionOffset. I now have a slave camera with the expected projection
 offset next to the master camera.

 One thing that I found out was that the slave camera is drawn one frame
 after the master. Both cameras are drawn to the same graphics context. I can
 easily see this in the seam between the two cameras by moving my scene up or
 down at a constant speed. My slave camera is then drawn a at a constant
 distance behind my master camera.

 In the osgwindow example separate graphics contexts are used for master and
 slave cameras. Is that the way it should be done? And then why?

 If I set up the two cameras with different graphics contexts they draw
 within the same frame (when I use the thread per context threading model).

 Regards Karl



 On 10/15/07, Robert Osfield [EMAIL PROTECTED] wrote:
 
  Hi Karl,
 
  Have a look at the osgwindows example, or the
  View::setUpViewAcrossScreens() source code in
  src/osgViewer/Viewer.cpp.
 
  On 10/10/07, Karl Heijdenberg  [EMAIL PROTECTED] wrote:
   Hi,
  
   I'm trying to add two cameras to one View in compositeViewer.
   The first camera is added as a master camera and the second as a slave
   camera.
  
   Frustums for the cameras:
   master={-50, 0, -40, 40}
slave={0, 50, -40, 40}
  
   For the first camera I set the projectionMatrix with
   setProjectionMatrixAsFrustum.
  
   How do I calculate the projectionOffset for the slave camera?
  
   The offset is needed in call to addSlave(osg::Camera* camera,const
   osg::Matrix projectionOffset, const osg::Matrix viewOffset, bool
   useMastersSceneData=true);
  
   I've also tried to set the reference frame to
 ABSOLUTE_RF_INHERIT_VIEWPOINT
   and then call the setProjectionMatrixAsFrustum for both cameras. This
 test
   ended up in a black scene for the second camera. Am I missing something?
  
   Thanks, Karl
   ___
   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


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


Re: [osg-users] Slave cameras in a view

2007-10-17 Thread Karl Heijdenberg
Ah, thanks a lot :-)

Of course that was the reason! Thats also explains why it worked with
different contexts.

Thanks Karl


On 10/17/07, Robert Osfield [EMAIL PROTECTED] wrote:

 Hi Karl,

 The master and slave cameras will be drawn in the same frame.

 If you see a difference then it must be down to the propagation of the
 settings from the master to the slave being out of sync.  I don't know
 how you set the master, perhaps you are setting it after the sync
 point.  The View::updateSlaves() method that does this sync is called
 from within Viewer::updateTraversals() so perhaps you are setting the
 master camera after this.

 Robert.

 On 10/17/07, Karl Heijdenberg [EMAIL PROTECTED] wrote:
  Hi and thanks for the tip about where to look for code for the
  projectionOffset. I now have a slave camera with the expected projection
  offset next to the master camera.
 
  One thing that I found out was that the slave camera is drawn one frame
  after the master. Both cameras are drawn to the same graphics context. I
 can
  easily see this in the seam between the two cameras by moving my scene
 up or
  down at a constant speed. My slave camera is then drawn a at a constant
  distance behind my master camera.
 
  In the osgwindow example separate graphics contexts are used for master
 and
  slave cameras. Is that the way it should be done? And then why?
 
  If I set up the two cameras with different graphics contexts they draw
  within the same frame (when I use the thread per context threading
 model).
 
  Regards Karl
 
 
 
  On 10/15/07, Robert Osfield [EMAIL PROTECTED] wrote:
  
   Hi Karl,
  
   Have a look at the osgwindows example, or the
   View::setUpViewAcrossScreens() source code in
   src/osgViewer/Viewer.cpp.
  
   On 10/10/07, Karl Heijdenberg  [EMAIL PROTECTED] wrote:
Hi,
   
I'm trying to add two cameras to one View in compositeViewer.
The first camera is added as a master camera and the second as a
 slave
camera.
   
Frustums for the cameras:
master={-50, 0, -40, 40}
 slave={0, 50, -40, 40}
   
For the first camera I set the projectionMatrix with
setProjectionMatrixAsFrustum.
   
How do I calculate the projectionOffset for the slave camera?
   
The offset is needed in call to addSlave(osg::Camera* camera,const
osg::Matrix projectionOffset, const osg::Matrix viewOffset, bool
useMastersSceneData=true);
   
I've also tried to set the reference frame to
  ABSOLUTE_RF_INHERIT_VIEWPOINT
and then call the setProjectionMatrixAsFrustum for both cameras.
 This
  test
ended up in a black scene for the second camera. Am I missing
 something?
   
Thanks, Karl
___
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
 
 
 ___
 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] under devcpp , can't find dll to run program

2007-10-17 Thread 王韬
Hi all:
I have compiled osg without example under devcpp(4.9.9.2) successfully,and 
get all dlls.(I downloaded the plugin's dlls and changed them to .a)
but,i compiled the osgtext example and when run it, error popped that it 
can't find freetype6.dll (why need it?), but libosgdb_freetype.dll (all dlls) 
is in the same folder.

someone can tell me what shall i do?

thanks. and last, i am poor in english.

wontor
 10/15/07 [EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] get elements of an osg::Matrixd instance

2007-10-17 Thread Jordi Torres
Hi,

I'm trying to do some conversions between OpenSceneGraph and Java using JNI.
One of them, Matrix2jobject, must  be able  to read  the elements of
osg::Matrix for copy pourposes. osg::Matrix API doesn't provide methods for
reading elements of an osg::Matrix instance, and the atribute _mat[4][4] is
protected. Anybody knows how to get this elements?

Thanks in advance.

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


Re: [osg-users] under devcpp , can't find dll to run program

2007-10-17 Thread Alberto Luaces
Hi,

El Wednesday 17 October 2007 12:06:18 王韬 escribió:
     I have compiled osg without example under devcpp(4.9.9.2)
 successfully,and get all dlls.(I downloaded the plugin's dlls and changed
 them to .a)

You shouldn't have to rename any dll. Mingw gcc, the compiler that devcpp 
uses, is usually clever enough to link to a dll. In fact, a .a lib is in 
the mingw world either a static library or an import library, but never a 
dynamic library.

 but,i compiled the osgtext example and when run it, error 
 popped that it can't find freetype6.dll (why need it?), but
 libosgdb_freetype.dll (all dlls) is in the same folder.

You need freetype6.dll because libosgdb_freetype.dll is a plugin that deals 
with the Freetype integration into OSG, so the Freetype functionality is 
still found on its own dll. Make sure freetype6.dll is in your PATH or copy 
it beside libosgdb_freetype.dll.

Alberto


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


Re: [osg-users] OpenFlt file causing crash in optimizer

2007-10-17 Thread Paul Martz
Hi Robert -- If the hidden flag bit is set in an OpenFlight Face or Mesh
record, the OpenFlight plugin handles this by setting the Geode NodeMask to
zero. Not sure why this would cause a merge geometry optimization to crash,
but maybe you've got some ideas on that?
   -Paul
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Wednesday, October 17, 2007 3:03 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OpenFlt file causing crash in optimizer

Hi Mark,

I don't know of any hacks you could apply to fix this, in the end one will
have to track down the bug be it in osgUtil::Optimizer or the OpenFlight
plugin.

Does osgviewer crash if you load the OpenFlight file directly?  Would it be
possible to make a model that reproduces the crash available so the
community can assist in tracking down the bug?

Robert.

On 10/17/07, Mark Hurry [EMAIL PROTECTED] wrote:

 I have been trying to load an OpenFlight file created using TerraVista 
 using osgViewer. However I have been getting a crash in the optimizer 
 code in Optimizer::MergeGeodesVisitor::mergeGeodes at line 
 geodeDuplicateMap[geode].push_back(geode); I finally managed to track 
 down that in the OpenFlight format polygon attributes there is a flag 
 for Hidden polygon. If this flag is set it causes a crash, if it is 
 not set then the model loads.



 Is this a known problem? And if so is there a work around? Obviously 
 it is not feasable to go into each OpenFlight file and manually check 
 each polygon to see if the Hidden polygon flag has been set.



 Thanks in advance



 Mark






 No virus found in this outgoing message.
  Checked by AVG Free Edition.
  Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 
 16-Oct-07
 2:14 PM

 ___
 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


[osg-users] OpenFlt file causing crash in optimizer

2007-10-17 Thread Mark Hurry
Hi Robert,

 

Not sure what you mean by directly. I have set it up as command line
argument in VS2005. I have also tried osgviewerMFC with the same results. 

 

I have reduced the OpenFlight model down to about 6 polys that still
produces the same crash, so what’s the best way of making it available to
everyone? 

 

I’ll carry on investiagting more to see if I can narrow the problem down as
this is a show stopper for me

 

Cheers

 

Mark

 

Hi Mark,
 
I don't know of any hacks you could apply to fix this, in the end one
will have to track down the bug be it in osgUtil::Optimizer or the
OpenFlight plugin.
 
Does osgviewer crash if you load the OpenFlight file directly?  Would
it be possible to make a model that reproduces the crash available so
the community can assist in tracking down the bug?
 
Robert.
 
On 10/17/07, Mark Hurry HYPERLINK
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.orgm
ark at dwork.com wrote:
 
 I have been trying to load an OpenFlight file created using TerraVista
using
 osgViewer. However I have been getting a crash in the optimizer code in
 Optimizer::MergeGeodesVisitor::mergeGeodes at line
 geodeDuplicateMap[geode].push_back(geode); I finally
 managed to track down that in the OpenFlight format polygon attributes
there
 is a flag for Hidden polygon. If this flag is set it causes a crash, if
it
 is not set then the model loads.
 
 
 
 Is this a known problem? And if so is there a work around? Obviously it
is
 not feasable to go into each OpenFlight file and manually check each
polygon
 to see if the Hidden polygon flag has been set.
 
 
 
 Thanks in advance
 
 
 
 Mark
 

 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 16-Oct-07
2:14 PM
 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenFlt file causing crash in optimizer

2007-10-17 Thread Robert Osfield
Hi Mark,

A six poly file would be ideal to test against, just post it as an
attachment to an osg-users email if the file is small.

Just to be precise, does:

  osgviewer myfile.flt

Fail?

Robert.

On 10/17/07, Mark Hurry [EMAIL PROTECTED] wrote:




 Hi Robert,



 Not sure what you mean by directly. I have set it up as command line
 argument in VS2005. I have also tried osgviewerMFC with the same results.



 I have reduced the OpenFlight model down to about 6 polys that still
 produces the same crash, so what's the best way of making it available to
 everyone?



 I'll carry on investiagting more to see if I can narrow the problem down as
 this is a show stopper for me



 Cheers



 Mark

   Hi Mark,
 
 I don't know of any hacks you could apply to fix this, in the end one
 will have to track down the bug be it in osgUtil::Optimizer or the
 OpenFlight plugin.

 Does osgviewer crash if you load the OpenFlight file directly?  Would
 it be possible to make a model that reproduces the crash available so
 the community can assist in tracking down the bug?

 Robert.
 
 On 10/17/07, Mark Hurry mark at dwork.com wrote:
 
  I have been trying to load an OpenFlight file created using TerraVista
 using
  osgViewer. However I have been getting a crash in the optimizer code in
  Optimizer::MergeGeodesVisitor::mergeGeodes at line
  geodeDuplicateMap[geode].push_back(geode); I finally
  managed to track down that in the OpenFlight format polygon attributes
 there
  is a flag for Hidden polygon. If this flag is set it causes a crash, if
 it
  is not set then the model loads.
 
 
 
  Is this a known problem? And if so is there a work around? Obviously it
 is
  not feasable to go into each OpenFlight file and manually check each
 polygon
  to see if the Hidden polygon flag has been set.
 
 
 
  Thanks in advance
 
 
 
  Mark
 


 


 No virus found in this outgoing message.
  Checked by AVG Free Edition.
  Version: 7.5.488 / Virus Database: 269.14.13/1074 - Release Date: 16-Oct-07
 2:14 PM

 ___
 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] OpenFlt file causing crash in optimizer

2007-10-17 Thread Paul Martz
  Not sure why this would cause a merge geometry 
  optimization to crash, but maybe you've got some ideas on that?
 
 No ideas I'm afraid.

It'd also be interesting to see if the following fails:
1. Load the FLT file, but specify the preserveFace option, which causes
the FLT loader to not run the Optimizer. App now has an unoptimized scene
graph.
2. Write this scene graph out as an .osg file.
3. Load the .osg file into osgviewer, which will run the Optimizer.

If this fails, it leaves OpenFlight and the FLT loader completely out of the
picture.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
303 859 9466

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


Re: [osg-users] double precision in position values of objects

2007-10-17 Thread Thrall, Bryan
Fuat ULUBATLI wrote on Wednesday, October 17, 2007 6:54 AM:
 hi all,
 
 i want to set the x,y,z of 3D objects as double since float is not
 sufficient for me due to large position values. how can i do this?
 
 thanks in advance...
 
 fuat

OpenGL generally does not support double precision, so the best way to
do this is place a transform (such as osg::MatrixTransform) above the 3D
object that positions it, and use floats in the object's geometry.

-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RenderingHint vs binNumber(RenderBinDetails)

2007-10-17 Thread Christophe Medard
Hi all,

Generalizing my 3 pass logic on a group of models, it seems I don't get the 
expected result.

Let me ask a question. In the following case :



am I correct if I assume the rendering order will be A1-A2-...-An-B-A1(with B 
context)-A2(with B context)-...-An(with B context)-C-A1(with C context)-A2(with 
C context)-...-An(with C context) , in each {A1-A2-...-An} sequence, precise 
order being unassumable ?

By with B context I mean having stateset attributes inherited from B 
stateset ones. 

If not, what would be a correct way to give rise to this render order ??

Thanks for any teaching about this.

-- 
Christophe Médard
Société OKTAL (http://www.oktal.fr)
2 impasse Boudeville
31100 Toulouse (France)
Tél. : (+33) 5 62 11 50 10
Fax : (+33) 5 62 11 50 29


- Original Message - 
From: Christophe Medard 
To: OpenSceneGraph Users 
Sent: Friday, October 05, 2007 3:55 PM
Subject: Re: [osg-users] RenderingHint vs binNumber(RenderBinDetails)


Yop,

All right, Tim's right.

So to conclude :
- setRenderingHint is just a shortcut for setRenderBinDetails, it allows not to 
have to specify the name of bin type, and _renderingHint is useless (for those 
making inquiries on the OSG source)
- indeed, the binNumber is the draw order number against other children in the 
parent Group, evaluated in a left-first traversall logic. 

The draw order for this case (3 pass on an geode) is A-B-C. It works well, one 
just have to beware of z-fighting, through the reuse of the depth buffer of the 
1st pass (via setAttributeAndModes(new 
osg::Depth(osg::Depth::EQUAL,0.0,1.0,false) for example).


   |
  osg::Group Root
   |
   ---
   |   |   |
   |   |   |
   |osg::Group B   osg::Group C
   |[binNumber = 20]  [binNumber = 30]
   | ||
   --
   |
 osg::Geode A
 [binNumber = 15]


Thanks to all.

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


Re: [osg-users] Multisample problem

2007-10-17 Thread David Callu
Hi Panagiotis

I attach a osgviewer based example of use of multisample

You can switch on/off multisample with the key 'm'

Cheers
David

2007/10/14, Panagiotis Papadakos [EMAIL PROTECTED]:

 Hi David

 On Tue, 9 Oct 2007, David Callu wrote:

  Hi Panagiotis
 
  2007/10/6, Panagiotis Papadakos [EMAIL PROTECTED]:
 
  Hi.
 
  I want to add an option of using multisampling for my app. So I have
 setup
  DisplaySettings with setNumMultiSamples(4). The user is able to
  enable/disable multisampling as he feels in the app, by
 enabling/disabling
 
  the GL_MULTISAMPLE_ARB in the root stateset. My problem now is that
  initially I want to have multisampling disabled, which I can't figure
 out
  how to do. I have tried setting GL_MULTISAMPLE_ARB OFF in the root
  stateset, but this doesn't seem to help. Any ideas?
 
 

  This seem to be the good method.
  you can try
 
  1) do root-getOrCreateStateSet()-setMode(GLL_MULTISAMPLE_ARB,
  osg::StateAttribut::OFF | osg::StateAttribut::OVERRIDE)

 This is what I've been trying. More specifically
 root-getOrCreateStateSet()-setMode(GL_MULTISAMPLE_ARB,
 osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED |
   osg::StateAttribute::OVERRIDE);

 after the viewer has been realized.

  2) I think that number of sample is define when the OpenGL context is
  created
 so recreate a context on each switch of the number os sample you
 want.
 
 Why should I recreate a context? I think I should be able to
 enable/disable Multisampling with setting the state mode ON/OFF.

  How did you know that multisample is enabling/disabling.
  Did you look the render ?
 Yep, that is the case. I saw the render.

  Did you do a request to OpenGL about multisample ?
 
 
  David
 
 
  Thanks
   Panagiotis Papadakos
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 

/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
 *
 * This application is open source and may be redistributed and/or modified   
 * freely and without restriction, both in commericial and non commericial applications,
 * as long as this copyright notice is maintained.
 * 
 * This application is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

#include osgDB/ReadFile
#include osgUtil/Optimizer
#include osg/CoordinateSystemNode
#include osg/Multisample

#include osg/Switch
#include osgText/Text

#include osgViewer/Viewer
#include osgViewer/ViewerEventHandlers

#include osgGA/TrackballManipulator
#include osgGA/FlightManipulator
#include osgGA/DriveManipulator
#include osgGA/KeySwitchMatrixManipulator
#include osgGA/StateSetManipulator
#include osgGA/AnimationPathManipulator
#include osgGA/TerrainManipulator

#include iostream

class SwitchMultisampleHandler : public osgGA::GUIEventHandler
{
public:

SwitchMultisampleHandler(osg::StateSet * ss) :
_useMultisample(false), _ss(ss)
{
_ss-setAttributeAndModes(new osg::Multisample, osg::StateAttribute::ON);
_ss-setMode(GL_MULTISAMPLE, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE);

}

bool handle(const osgGA::GUIEventAdapter ea, osgGA::GUIActionAdapter )
{
if (ea.getHandled())
return false;

switch (ea.getEventType())
{
case (osgGA::GUIEventAdapter::KEYUP):
{
if (ea.getKey() == 'm')
{
if (_useMultisample == false)
{
_ss-setMode(GL_MULTISAMPLE, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
_useMultisample = true;
}
else
{
_ss-setMode(GL_MULTISAMPLE, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE);
_useMultisample = false;
}

return true;
}
break;
}
default:
break;
}
return false;
}

private:

bool _useMultisample;
osg::ref_ptrosg::StateSet _ss;
};

int main(int argc, char** argv)
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(argc,argv);

arguments.getApplicationUsage()-setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()-setDescription(arguments.getApplicationName()+ is the standard OpenSceneGraph example which loads and visualises 3d models.);

[osg-users] osgCal and osg::Fog

2007-10-17 Thread Laurent Di Cesare
Hello,

I am using osg to render a scene, and osgCal to display some character 
models.
When I try to use osg::Fog in the scene, everything works fine except 
for characters rendered by osgCal: They seem to get fogged only when 
very far (lod?) but they aren't fogged at all when they are near.
Does anyone have any pointer to why this doesn't work, or where I should 
be looking at? The stateset has been set with:
   setAttribute( fog /* an osg::Fog */, osg::StateAttribute::ON );
   setMode( GL_FOG, osg::StateAttribute::ON );
on the osg::Group containing the character I try to render.
Setting the mode to OVERRIDE or PROTECTED doesn't change the behaviour.
I think I must set a FOG shader flag in the osgCal core model but it 
doesn't seem to be retrieved from the stateset.
I'm a little lost in the osgCal code, but I can't find a way to set the 
shader_flag_fog there.
HwMeshStateSetCache::createHwMeshStateSet seems not to read it from the 
stateset?

Thanks in advance for any pointer,
Laurent Di Cesare.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multisample problem

2007-10-17 Thread Panagiotis Papadakos
Hi David. Thanks for your time and the example.

I have the same problem with your example as I have with my own code.
Running ./a.out --samples 4 saved_model.osg, uses anti-aliasing when the
application starts although SwitchMultisampleHandler disables it in 
constructor. Pressing 2 times 'm' disables it, as it also happens with my 
app.

Panagiotis Papadakos

On Wed, 17 Oct 2007, David Callu wrote:

 Hi Panagiotis

 I attach a osgviewer based example of use of multisample

 You can switch on/off multisample with the key 'm'

 Cheers
 David

 2007/10/14, Panagiotis Papadakos [EMAIL PROTECTED]:

 Hi David

 On Tue, 9 Oct 2007, David Callu wrote:

 Hi Panagiotis

 2007/10/6, Panagiotis Papadakos [EMAIL PROTECTED]:

 Hi.

 I want to add an option of using multisampling for my app. So I have
 setup
 DisplaySettings with setNumMultiSamples(4). The user is able to
 enable/disable multisampling as he feels in the app, by
 enabling/disabling

 the GL_MULTISAMPLE_ARB in the root stateset. My problem now is that
 initially I want to have multisampling disabled, which I can't figure
 out
 how to do. I have tried setting GL_MULTISAMPLE_ARB OFF in the root
 stateset, but this doesn't seem to help. Any ideas?



 This seem to be the good method.
 you can try

 1) do root-getOrCreateStateSet()-setMode(GLL_MULTISAMPLE_ARB,
 osg::StateAttribut::OFF | osg::StateAttribut::OVERRIDE)

 This is what I've been trying. More specifically
 root-getOrCreateStateSet()-setMode(GL_MULTISAMPLE_ARB,
 osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED |
   osg::StateAttribute::OVERRIDE);

 after the viewer has been realized.

 2) I think that number of sample is define when the OpenGL context is
 created
so recreate a context on each switch of the number os sample you
 want.

 Why should I recreate a context? I think I should be able to
 enable/disable Multisampling with setting the state mode ON/OFF.

 How did you know that multisample is enabling/disabling.
 Did you look the render ?
 Yep, that is the case. I saw the render.

 Did you do a request to OpenGL about multisample ?


 David


 Thanks
  Panagiotis Papadakos
 ___
 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] Multipass shading, black texture coming out of the first pass

2007-10-17 Thread Christian Heine
Hello Swen,

in the last few days i've figured out, that i have a bug in my multipass
soluiton.
For this bug, i've actually no idea how i could solve the problem

The problem occurs with the execution of the passes. Each pass holds an
osg::StateSet
where the Shaders and textures are bound for execution. Actually this
StateSet must
be an element of the SceneGraph for execution. This is not the problem,
if the Shader
is an object refered shader like a dot3 Shader.

But the dilemma is, that you don't have allways object refered shaders,
sometimes
the shader is not part of an object (Blur, HDR ect.), which will
actually not be
executed. The other problem of the dilemma occurs, if you got more
shaders which are
object refered (p.e. dot3, phong lighting). If you bind more than one
state to the
object, only the last state will be executed ...

One Solution may be a render quad for each pass, which is executed
(rendered)
explicit outside the graph, to force the execution. But i  don't have a
solution how this
could be realized...

I think this could be a part of your issue. Are you sure, that your
first shader is executed?

Best regards,
Christian



Swen Walkowski wrote:
 Hello all,

 first I am sorry that I start a new thread, but I do not have the old
 mail here that I can answer it. That thread refer to: [osg-users]
 Multipassshading in OSG v1.2

 I done a look in the source code from Christian, with that code I
 tried to extend my shader for a static 2 pass shader.

 That is the shader class is in the attachmend (Shader.cpp).
 In the attachmend you will see the output (2Pass.JPG).
 You just will see the the point (right upper corner) but not the live
 video stream from the camera and the output from the discard shader.

 I try to use osgart. The first texture, who the constructor gets and
 put it to the first shader pass is the live picture. What I get out of
 that pass I try to put in the second pass and than display it.

 So maybe someone can help me!

 Thanks Swen
   
 

 ___
 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] Rendering to a texture only

2007-10-17 Thread Williams Steven-ASW036
Sorry Robert, this is still unclear. Is there one option or two you are
suggesting is possible?

1) A viewer setup as embedded using a pbuffer context with a
normal camera
2) A viewer setup as embedded using pbuffer context and an FBO
camera

Obviously I'd like to use an FBO, less coding than copying image buffers
around, plus I already have it working, albeit in a window.

Thanks again

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Tuesday, October 16, 2007 2:36 PM
To: OpenSceneGraph Users
Subject: Re: Rendering to a texture only

On 10/16/07, Williams Steven-ASW036 [EMAIL PROTECTED] wrote:
 Is pBuffers the only solve or can I use my current FBO code?

You need a graphics context to create a FBO.

 I currently have an FBO camera  texture running as per the osgViewer 
 example, but I'm using the viewer to kick off rendering. Ideally I 
 want the non-existant rootnode-render() then use the image attached

 to my FBO camera and remove viewer completely.

Create a pbuffer, make current on it and then a viewer setup as a
embedded view as per the osgviewersdl/glut examples then dispatch the
frames required, then cleanup.

See the osgcamera/osgwindows examples to see how to create graphics
contexts using Traits. For pbuffer just set the relevant traits
parameter.

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


Re: [osg-users] Multisample problem

2007-10-17 Thread David Callu
Ok I have a not really clean fix but this work.

I will investigate more on this issue.
Keep you informed

David


2007/10/17, Panagiotis Papadakos [EMAIL PROTECTED]:

 Hi David. Thanks for your time and the example.

 I have the same problem with your example as I have with my own code.
 Running ./a.out --samples 4 saved_model.osg, uses anti-aliasing when the
 application starts although SwitchMultisampleHandler disables it in
 constructor. Pressing 2 times 'm' disables it, as it also happens with my
 app.

 Panagiotis Papadakos

 On Wed, 17 Oct 2007, David Callu wrote:

  Hi Panagiotis
 
  I attach a osgviewer based example of use of multisample
 
  You can switch on/off multisample with the key 'm'
 
  Cheers
  David
 
  2007/10/14, Panagiotis Papadakos [EMAIL PROTECTED]:
 
  Hi David
 
  On Tue, 9 Oct 2007, David Callu wrote:
 
  Hi Panagiotis
 
  2007/10/6, Panagiotis Papadakos [EMAIL PROTECTED]:
 
  Hi.
 
  I want to add an option of using multisampling for my app. So I have
  setup
  DisplaySettings with setNumMultiSamples(4). The user is able to
  enable/disable multisampling as he feels in the app, by
  enabling/disabling
 
  the GL_MULTISAMPLE_ARB in the root stateset. My problem now is that
  initially I want to have multisampling disabled, which I can't figure
  out
  how to do. I have tried setting GL_MULTISAMPLE_ARB OFF in the root
  stateset, but this doesn't seem to help. Any ideas?
 
 
 
  This seem to be the good method.
  you can try
 
  1) do root-getOrCreateStateSet()-setMode(GLL_MULTISAMPLE_ARB,
  osg::StateAttribut::OFF | osg::StateAttribut::OVERRIDE)
 
  This is what I've been trying. More specifically
  root-getOrCreateStateSet()-setMode(GL_MULTISAMPLE_ARB,
  osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED |
osg::StateAttribute::OVERRIDE);
 
  after the viewer has been realized.
 
  2) I think that number of sample is define when the OpenGL context is
  created
 so recreate a context on each switch of the number os sample you
  want.
 
  Why should I recreate a context? I think I should be able to
  enable/disable Multisampling with setting the state mode ON/OFF.
 
  How did you know that multisample is enabling/disabling.
  Did you look the render ?
  Yep, that is the case. I saw the render.
 
  Did you do a request to OpenGL about multisample ?
 
 
  David
 
 
  Thanks
   Panagiotis Papadakos
  ___
  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] Multisample problem

2007-10-17 Thread David Callu
oups forget the file ...

2007/10/17, David Callu [EMAIL PROTECTED]:

 Ok I have a not really clean fix but this work.

 I will investigate more on this issue.
 Keep you informed

 David


 2007/10/17, Panagiotis Papadakos  [EMAIL PROTECTED]:
 
  Hi David. Thanks for your time and the example.
 
  I have the same problem with your example as I have with my own code.
  Running ./a.out --samples 4 saved_model.osg, uses anti-aliasing when
  the
  application starts although SwitchMultisampleHandler disables it in
  constructor. Pressing 2 times 'm' disables it, as it also happens with
  my
  app.
 
  Panagiotis Papadakos
 
  On Wed, 17 Oct 2007, David Callu wrote:
 
   Hi Panagiotis
  
   I attach a osgviewer based example of use of multisample
  
   You can switch on/off multisample with the key 'm'
  
   Cheers
   David
  
   2007/10/14, Panagiotis Papadakos [EMAIL PROTECTED]:
  
   Hi David
  
   On Tue, 9 Oct 2007, David Callu wrote:
  
   Hi Panagiotis
  
   2007/10/6, Panagiotis Papadakos [EMAIL PROTECTED]:
  
   Hi.
  
   I want to add an option of using multisampling for my app. So I
  have
   setup
   DisplaySettings with setNumMultiSamples(4). The user is able to
   enable/disable multisampling as he feels in the app, by
   enabling/disabling
  
   the GL_MULTISAMPLE_ARB in the root stateset. My problem now is that
   initially I want to have multisampling disabled, which I can't
  figure
   out
   how to do. I have tried setting GL_MULTISAMPLE_ARB OFF in the root
   stateset, but this doesn't seem to help. Any ideas?
  
  
  
   This seem to be the good method.
   you can try
  
   1) do root-getOrCreateStateSet()-setMode(GLL_MULTISAMPLE_ARB,
   osg::StateAttribut::OFF | osg::StateAttribut::OVERRIDE)
  
   This is what I've been trying. More specifically
   root-getOrCreateStateSet()-setMode(GL_MULTISAMPLE_ARB,
   osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED |
 osg::StateAttribute::OVERRIDE);
  
   after the viewer has been realized.
  
   2) I think that number of sample is define when the OpenGL context
  is
   created
  so recreate a context on each switch of the number os sample you
   want.
  
   Why should I recreate a context? I think I should be able to
   enable/disable Multisampling with setting the state mode ON/OFF.
  
   How did you know that multisample is enabling/disabling.
   Did you look the render ?
   Yep, that is the case. I saw the render.
  
   Did you do a request to OpenGL about multisample ?
  
  
   David
  
  
   Thanks
Panagiotis Papadakos
   ___
   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
 


/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
 *
 * This application is open source and may be redistributed and/or modified   
 * freely and without restriction, both in commericial and non commericial applications,
 * as long as this copyright notice is maintained.
 * 
 * This application is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

#include osgDB/ReadFile
#include osgUtil/Optimizer
#include osg/CoordinateSystemNode
#include osg/Multisample

#include osg/Switch
#include osgText/Text

#include osgViewer/Viewer
#include osgViewer/ViewerEventHandlers

#include osgGA/TrackballManipulator
#include osgGA/FlightManipulator
#include osgGA/DriveManipulator
#include osgGA/KeySwitchMatrixManipulator
#include osgGA/StateSetManipulator
#include osgGA/AnimationPathManipulator
#include osgGA/TerrainManipulator

#include iostream

class SwitchMultisampleHandler : public osgGA::GUIEventHandler
{
public:

SwitchMultisampleHandler(osg::StateSet * ss) :
_useMultisample(false), _ss(ss)
{
_ss-setAttributeAndModes(new osg::Multisample, osg::StateAttribute::ON);
_ss-setMode(GL_MULTISAMPLE, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE);

}

bool handle(const osgGA::GUIEventAdapter ea, osgGA::GUIActionAdapter )
{
if (ea.getHandled())
return false;

switch (ea.getEventType())
{
case (osgGA::GUIEventAdapter::KEYUP):
{
if (ea.getKey() == 'm')
{
if (_useMultisample == false)
{
_ss-setMode(GL_MULTISAMPLE, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
_useMultisample = true;
}
else
 

Re: [osg-users] (solved)Re: RTT and stereo (revisited)...

2007-10-17 Thread Mike Logan


Nice.   thank you.

That was EXACTLY it.Setting the camera's to have colormasks
  all true  did the trick.

I would never have found it...

ml


On Oct 17, 2007, at 1:21 AM, Robert Osfield wrote:


Hi Mike,

With 2.x could you try:

  osgprerender cow.osg --stereo HORZONTAL_SPLIT

And then:

  osgprerender cow.osg --window --stereo


The two tests suggest to me that the basic mechanics are working in
2.x just fine, but the anaglyphic stereo set up is being affected by
the ColorMask state being inherited down to the RTT camera.  Setting a
local ColorMask to enable all colours on the RTT Camera might be a be
way of protecting it from being affected by the inherited ColorMask
settings used to the do the anaglyphic stereo.

Robert.

On 10/16/07, Mike Logan [EMAIL PROTECTED] wrote:



I don't disagree with any of that, but I don't think it fixes
 anything I want to do (besides I did all that already).

Maybe its constructive to ask the simple question:

Why  doesn't   the following command work?
  osgprerender --stereo cessna.osg

In 1.2,  the left  eye (red cessna) is stuck and doesn't
 update, the right eye(blue) spins around.

In 2.x, the left eye (red cessna) doesn't even show up.

The waving flag is certainly in stereo and working fine.
 But the cessna  isn't stereo-ized in either version.

And my claim is that adding a second CameraNode(1.2)
 or Camera(2.x)  with masking, or whatever, won't help.

I won't harass you anymore since I'm not a paying
 customer  8-)   Just wanted to explain my thinking.

ml

On Oct 16, 2007, at 11:21 AM, Robert Osfield wrote:

Hi Mike,

I haven't followed this thread closely, so not clear on what the  
exact
problem is, what you've tried and where you are at.  Will provide  
some

general comments to see if they help clarify things on how the OSG
does things.

If you are doing stereo you may or may not one RTT camera and
associated texture for each eye.  If you wish to have two textures  
one
for each eye then you'll need to have two osg::Camera one for each  
eye

and use the NodeMask on each of these cameras to select which camera
you want to use for each eye.

Robert.

On 10/16/07, Mike Logan [EMAIL PROTECTED] wrote:



If anyone cares,

I had to drop back to OSG1.2 to make some progress.

I now have 2 CameraNodes, 2 textures, 2 polys being
textured and everything works on the first frame only.
Nice stereo picture on a stereo canvas..   instead
 of a flat picture on a stereo canvas..

But I can only get ONE of the cameranodes to update its
 texture after the first frame.

The matrix of the both cameranodes is definitely changing.
But only one texture in the final display updates (right eye).

When someone, generally, has 1 RTT cameranodes rendering
for one window, is there something special that needs to
 be done?

thanks for reading,

ml



On Oct 11, 2007, at 9:58 AM, Mike Logan wrote:


Thanks for the suggestion Farshid,

But I don't know how to get the SceneView.

Isn't the SceneView now hidden in SVN?   as part
 of the camera's renderer?

I'm already setting

 camera-setCullMaskLeft( 0x1 );
 camera-setCullMaskRight( 0x2 );

for each of the 2 prerender cameras.
  Shouldn't that be sufficient?

The main camera is already stereo from what I can tell.
Its the final texture that isn't stereo.

To be sure, I got the main camera from the viewer and
 set it's  left/right cull masks..  I'm still not seeing
 two cessnas.

ml




On Oct 10, 2007, at 3:54 PM, Farshid Lashkari wrote:

Hi Mike

You need to set the left/right cull masks on the SceneView. Then set
the node masks for each camera to the appropriate cull mask. I've
successfully used this technique to render camera nodes in stereo.

-Farshid

On 10/10/07, Mike Logan [EMAIL PROTECTED] wrote:


ahem..  Looking for some free debugging.. 8)

I've included a very slimmed down  modified osgprerender.cpp
 example with a second camera added in an attempt to
get stereo-rtt working..

I've discovered that the
 RenderImplementation = osg::Camera::SEPERATE_WINDOW
is a very useful tool (run with the --window option).

It seems to show that the program is basically working
 in stereo but the final main window only shows the right eye.

I've tried this on OSX (anaglyph) and Linux (quad-buffer) and
 they perform roughtly the same.   (OSG-SVN 2.2.10+  or so)

Anyone done this already with the SVN version?
See anything obvious?

ml


ugly code removed





___
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





[osg-users] EyePoint from CullVisitor

2007-10-17 Thread Jeffrey M Short

Hello

First off I'm using OSG 1.0.

I am deriving a class from osg::Drawable::CullCallback.  I'm overloading
the cull function [virtual bool cull(osg::NodeVisitor* nv, osg::Drawable*
drawable, osg::State*) const].  I am trying to get the eye location in
World Coordinates.  It seems as though CullVisitor::getEyePoint() returns
the eye location in Local Coords.  I've tried tried multiplying by
osg::computeLocalToWorld(nv-getNodePath()) and
osg::computeWorldToLocal(nv-getNodePath()), but I've had no success.

In some cases, I already know that my drawable has one MatrixTransform
above it so I calculate the following:
osg::Matrixd::inverse(xfrom-getMatrix()) * osg::Vec4d(nv-getEyePoint(),
1).  This works.  But it won't work for cases when there's more than 1
Transfrom on the nodepath.  That's why I was trying
osg::computeLocalToWorld.  The best thing would be to get the eye point in
world coordinates directly without having to calculate it repeatedly from
local coordinates in each drawable's CullCallback.  Any suggestions?


Also I want to reply to some response made to other questions I have
submitted.  How do I do that?

Thank you,
 Jeff

Computer Sciences Corporation
Registered Office: 2100 East Grand Avenue, El Segundo California 90245, USA
Registered in USA No: C-489-59



This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose.



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


Re: [osg-users] osgviewerQT + StatsHandler

2007-10-17 Thread Mario Valle
Poirier, Guillaume wrote:

 Hello !

 Sorry if this was already discussed... I checked on the gmane archive 
 and could
 not find anything on the topic :(

 Is the osgviewerQT supposed to work with the StatsHandler ? Most 
 viewer examples
 use it except osgviewerQT.cpp. When I do

 ViewerQT* viewerWindow = new ViewerQT;
 viewerWindow-addEventHandler(new osgViewer::StatsHandler);

 and press 's' I get a Stats report: printout but see nothing in the 
 window.

The same was happening to osgviewerWX. It happens because WX passes 'S' 
instead of 's' to osg in OnKeyUp and OnKeyDown, ie. the uppercase 
lettere is always passed. I think the same is happening in Qt.
Hope it helps
   mario

 Cheers !


 bill

 

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


-- 
Ing. Mario Valle
Visualization Group  | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82

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


[osg-users] OpenFlt file causing crash in optimizer

2007-10-17 Thread Mark Hurry
Hi Robert/Paul

 

In answer to various questions 

 

Yes osgviewer flight1_0.flt (see attachment) causes the crash.  The file is
only 6 polygons. If I reduce the number of polys or change the structure,
then the results become unpredicatble, sometimes working other times not. It
seems to be the last polygon in the model – f801 that seems to cause the
problem.

 

I went through the stages suggested by Paul

 

1)   specifying the preserveFace=1 allowed the file to load successfully

2)   I saved the file as a .osg

3)   I loaded the file flight1_0.osg and it loaded successfully

 

So I assume from Paul’s comments that the best place to look for a problem
would be in the FLT loader?

 

Thanks

 

Mark

 

 

  Not sure why this would cause a merge geometry optimization to 

  crash, but maybe you've got some ideas on that?

 

 No ideas I'm afraid.

 

It'd also be interesting to see if the following fails:

1. Load the FLT file, but specify the preserveFace option, which causes
the FLT loader to not run the Optimizer. App now has an unoptimized scene
graph.

2. Write this scene graph out as an .osg file.

3. Load the .osg file into osgviewer, which will run the Optimizer.

 

If this fails, it leaves OpenFlight and the FLT loader completely out of
the picture.

 

Paul Martz

Skew Matrix Software LLC

HYPERLINK http://www.skew-matrix.com/http://www.skew-matrix.com

303 859 9466

 

 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.13/1075 - Release Date: 17-Oct-07
9:38 AM
 
  


flight1_0.flt
Description: Binary data
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org