Re: [osg-users] osgEphemeris

2008-09-10 Thread Filip Holm
Hi Mi,

If you have a look at my previous email on this subject you'll find the
answer to this problem. It's a bug in osgEphemeris. After re-calculating the
skydome image ephemeris fails to set the dirty bit on the result, hence the
texture is not updated.

Filip

On Wed, Sep 10, 2008 at 3:07 AM, [EMAIL PROTECTED] wrote:

 Hei,

 I've tried running the osgEphemeris example with OSG2.6 and I could not
 get it working properly, the stars were alright but the sun never
 appeared.but the same example works perfectly on osg2.4. So does anyone
 have any idea what could be the reason for this?


 regards,
 Mi Haotian



 On Tue, September 9, 2008 9:17 pm, Adrian Egli OpenSceneGraph (3D) wrote:
  Ok,
  i will be more precises.
 
  * nothings strange found with osg notify level set
  * i am working with latest svn osg
  * the texture gets calculated, but not displayed on the sky dome
  * if you wish i can upload the osgEmph. with all my changes. there are
  some bugs in the osgEmph. VC 7 project. i am working with vc 2005
 
  / adrian
 
 
  ###
  C:\Users\adrianset OSG
  OSG_FILE_PATH=F:\dev\OpenSceneGraph\Data;.;F:\data\models;
  OSG_LIBRARY_PATH=.;F:\dev\OpenSceneGraph\Deployment\bin
  OSG_WINDOW=256 256 512 512
  #
 
 
 
  F:\dev\OpenSceneGraph\osgEphemeris\binset OSG_NOTIFY_LEVEL=DEBUG
 
 
  F:\dev\OpenSceneGraph\osgEphemeris\binEphemerisViewer.exe park.ive
  GraphicsContext::setWindowingSystemInterface() 010A1C40 101A0F9C
  CullSettings::readEnvironmentalVariables()
  CullSettings::readEnvironmentalVariables()
  CullSettings::readEnvironmentalVariables()
  CullSettings::readEnvironmentalVariables()
  CullSettings::readEnvironmentalVariables()
  CullSettings::readEnvironmentalVariables()
  itr='.' FindFileInPath() : trying
  F:\dev\OpenSceneGraph\osgEphemeris\bin\osgPlugins-2.7.2\osgdb_ive.dll ...
  itr='F:\dev\OpenSceneGraph\Deployment\bin'
  FindFileInPath() : trying
  F:\dev\OpenSceneGraph\Deployment\bin\osgPlugins-2.7.2\osgdb_ive.dll ...
  FindFileInPath() : USING
  F:\dev\OpenSceneGraph\Deployment\bin\osgPlugins-2.7.2\osgdb_ive.dll
  Opened DynamicLibrary osgPlugins-2.7.2/osgdb_ive.dll
  itr='F:\dev\OpenSceneGraph\Data'
  FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\park.ive ...
  itr='.' FindFileInPath() : trying
  F:\dev\OpenSceneGraph\osgEphemeris\bin\park.ive
  ...
  itr='F:\data\models'
  FindFileInPath() : trying F:\data\models\park.ive ...
  FindFileInPath() : USING F:\data\models\park.ive
  ive::DataInputStream.setLoadExternalReferenceFiles()=1
  Font 0199B608, numberOfTexturesAllocated 1
  itr='F:\dev\OpenSceneGraph\Data'
  FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf ...
  FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  itr='.' FindFileInPath() : trying
 
 F:\dev\OpenSceneGraph\osgEphemeris\bin\osgPlugins-2.7.2\osgdb_freetype.dll
   ...
  itr='F:\dev\OpenSceneGraph\Deployment\bin'
  FindFileInPath() : trying
  F:\dev\OpenSceneGraph\Deployment\bin\osgPlugins-2.7.2\osgdb_freetype.dll
  ...
  FindFileInPath() : USING
  F:\dev\OpenSceneGraph\Deployment\bin\osgPlugins-2.7.2\osgdb_freetype.dll
  Opened DynamicLibrary osgPlugins-2.7.2/osgdb_freetype.dll
  FindFileInPath(F:\dev\OpenSceneGraph\Data\fonts\arial.ttf): returning
  F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  FreeTypeLibrary::FreeTypeLibrary()
  Adding to object cache F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  Font 019A5F58, numberOfTexturesAllocated 2
  itr='F:\dev\OpenSceneGraph\Data'
  FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf ...
  FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  returning cached instanced of F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  itr='F:\dev\OpenSceneGraph\Data'
  FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf ...
  FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  returning cached instanced of F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  itr='F:\dev\OpenSceneGraph\Data'
  FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf ...
  FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  returning cached instanced of F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  itr='F:\dev\OpenSceneGraph\Data'
  FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf ...
  FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  returning cached instanced of F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  itr='F:\dev\OpenSceneGraph\Data'
  FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf ...
  FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  returning cached instanced of F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  itr='F:\dev\OpenSceneGraph\Data'
  FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf ...
  FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
  returning 

Re: [osg-users] Reference frame

2008-09-10 Thread Elbers, H.P.
Hello Sajjad,

You can find details on this, and much more good information in
OpenSceneGraph Quick Start Guide, chapter : 2.3.3

Go to http://www.skew-matrix.com/OSGQSG/index.html
http://www.skew-matrix.com/OSGQSG/index.html , follow the 'lulu.com'
link. The guide can be downloaded for free. Paul Martz: thank you *VERY*
much for this beautiful guide!

Good luck,

Hans.




From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ami
guru
Sent: woensdag 10 september 2008 4:59
To: OpenSceneGraph Users
Subject: [osg-users] Reference frame


Hello Forum,


OSG Transform allows to specify its reference frame and by
default the reference frame is relative. and the other one is the
absolute.
And the two are specified by different code identifier.

We can view transformation in 2 ways.

1. relative to  the fixed coordinate system.
2. Local movable coordinate system.

There is no practical difference and just a matter of viewpoint.

What is the purpose of OSG to specify them separately as
follows:

osg::Transform::RELATIVE_RF.

Any example would be of great help!!!



Regards
Sajjad



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


Re: [osg-users] osgTerrain::TerrainTile question

2008-09-10 Thread Robert Osfield
Hi Nicolas,

osgTerrain::TerrainTile was named osgTerrain::Terrain in 2.2.
osgTerrain since 2.2 was evolved to be more rounded and functional,
the naming was changed to better fit what goes on in big paged
database, when the Terrain is composed of a hierarchy of TerrainTile.
There is now a new class class osgTerrain::Terrain which represent the
high level representation of the terrain.

In your case loading 3D models with terrain is something that we be
best done be pre-processing your data so that the 3D models are
inserted into a paged database.  If you are familiar with TerraPage
then this ideal should be familiar to you.

Robert.

On Tue, Sep 9, 2008 at 9:30 PM, Coco [EMAIL PROTECTED] wrote:
 Hi,

 I'm presently working on a car simulator using OSG 2.2 for the visual.
 My problem is that I would like to load big areas (such as entire cities or
 more) which are fragmented in several Open Flight files without loading all
 those files.
 I looked at the OSG documentation and found out the osgTerrain::TerrainTile
 class (which doesn't exist on 2.2 OSG version).
 By using OSG 2.6, would I be able to load (with the TerrainTile class) only
 tiles (associated to a FLT file) that I need to see (which means according
 to the location of the camera)?
 Or do I need to implement this system by myself to avoid loading all files
 at the same time?

 I hope this post is clear enough and wait for answers.

 Kind regards,

 Nicolas Duval
 ___
 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] osgEphemeris

2008-09-10 Thread Robert Osfield
Hi Filip,

Good detective work.  This does look like a bug in osgEmpheris, where
it's modifying an image, but then not calling dirty() on it where it
should, as its the dirty() call that tells the Texture object to
upload the new the data.  Previously it'll have been relying upon an
inefficiency in the osg::Texture2D::setImage() method that has now
been fixed, so only really worked previously by fluke.

Robert.

On Tue, Sep 9, 2008 at 10:24 PM, Filip Holm [EMAIL PROTECTED] wrote:
 I tracked down the osgEphemris texture update problem earlier today. If you
 have updated to osg-2.6.0 or later there is a change in how Texture2D works.
 Since I do not have the code at hand I'll tell what the problem is and you
 should be able to find it quite easy.

 Find the method in ephemeris that writes to the _skyTexture you'll notice
 that it's code that looks something like this:

 Image* image = _skyTexture-getImage();

 snip

 unsigned int* ptr = image-data;

 //Modifying ptr data

 snip

 _skyTexture-setImage(image);  - This is why skytexture texture does
 not update!!

 //If you replace the setImage call with the following line, everything works
 fine:

 image-dirty();

  new osgCode causing ephemeris bug to appear:
 osg::Texture2D::setImage(Image* image)
 {
 if(_image == image)
 return;
 .
 }

 Let me know if this doesn't fix your problem.

 Filip

 On Tue, Sep 9, 2008 at 3:30 PM, Viggo Løvli [EMAIL PROTECTED] wrote:

 Hi Adrian,

 I have experienced a similar problem.

 First, check that you set a decent radius for the Ephemeris dome. Example:
 5000 meters...
 Ensure that your far-clip is at least that far away.

 Ephemeris can be set to follow camera.
 If you do not set this then you must have camera inside the Ephemeris
 dome.

 If you set it to follow camera, then you are supposed to see it all the
 time.

 I did however get into a struggle with it where the dome disappeared at
 seemingly random times.
 It depended on where my camera was and the radius of the Ephemeris dome.
 I learnt that if the Ephemeris dome radius was low (5000meters) then it
 would often pop away (as in not visible) when I moved my camera away from
 world centre. The problem increased the further away I went. At 1meters
 from the world centre I would almost never see the Ephemeris dome.

 Ephemeris was in fact following my camera, but it does this in a special
 way. It actually 'update' its position after culling is almost done. So at
 times it may be culled even though you say it shall follow camera.

 The solution was to write a node-visitor that turns off culling for
 Ephemeris's root node and all of its child nodes.

 I am not sure if this is the same problem as you have but you can try it.

 Node visitor's apply function looks like this:
 void DisableCullingVisitor::apply( osg::Node node )
 {
 node.setCullingActive( false );
 traverse( node );
 }
 Ensure that it is set up to traverse all children.

 Hope it helps,
 Viggo

 
 Date: Tue, 9 Sep 2008 14:29:04 +0200
 From: [EMAIL PROTECTED]
 To: osg-users@lists.openscenegraph.org
 Subject: [osg-users] osgEphemeris
 Hi just come back to the good old osgEphemeris, i can not see any sky
 texture, what is wrong. do someone know the bug.
 adrian
 --
 
 Adrian Egli
 
 Windows Live Messenger. Hold kontakten med vennene dine.
 ___
 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] osgTerrain::TerrainTile question

2008-09-10 Thread Coco
Thank you very much for your ideas!

I found out the osgDB::DatabasePager class by reading old posts and it looks
to fit my problem very well.
By using TerraPage I will have to pre-process my databases, whereas with the
database pager I don't need to.

  virtual void
requestNodeFilefile:///C:/SHERPA/SHERPA_5.5_Modifiee_Nico/VIS_OSG_DEV/tools/OpenSceneGraph-2.2.0/doc/doxygen/html/a00119.html#b768d3e105f1fb2df66064719ff3bcba(const
std::string fileName,
osg::Groupfile:///C:/SHERPA/SHERPA_5.5_Modifiee_Nico/VIS_OSG_DEV/tools/OpenSceneGraph-2.2.0/doc/doxygen/html/a00217.html*group,
float priority, const
osg::FrameStampfile:///C:/SHERPA/SHERPA_5.5_Modifiee_Nico/VIS_OSG_DEV/tools/OpenSceneGraph-2.2.0/doc/doxygen/html/a00191.html
 *framestamp)

Theoretically, I just have to use this function before the camera is close
enough to see next area(s).

Regards,

Nicolas Duval

2008/9/10, Robert Osfield [EMAIL PROTECTED]:

 Hi Nicolas,

 osgTerrain::TerrainTile was named osgTerrain::Terrain in 2.2.
 osgTerrain since 2.2 was evolved to be more rounded and functional,
 the naming was changed to better fit what goes on in big paged
 database, when the Terrain is composed of a hierarchy of TerrainTile.
 There is now a new class class osgTerrain::Terrain which represent the
 high level representation of the terrain.

 In your case loading 3D models with terrain is something that we be
 best done be pre-processing your data so that the 3D models are
 inserted into a paged database.  If you are familiar with TerraPage
 then this ideal should be familiar to you.

 Robert.

 On Tue, Sep 9, 2008 at 9:30 PM, Coco [EMAIL PROTECTED] wrote:
  Hi,
 
  I'm presently working on a car simulator using OSG 2.2 for the visual.
  My problem is that I would like to load big areas (such as entire cities
 or
  more) which are fragmented in several Open Flight files without loading
 all
  those files.
  I looked at the OSG documentation and found out the
 osgTerrain::TerrainTile
  class (which doesn't exist on 2.2 OSG version).
  By using OSG 2.6, would I be able to load (with the TerrainTile class)
 only
  tiles (associated to a FLT file) that I need to see (which means
 according
  to the location of the camera)?
  Or do I need to implement this system by myself to avoid loading all
 files
  at the same time?
 
  I hope this post is clear enough and wait for answers.
 
  Kind regards,
 
  Nicolas Duval
  ___
  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] osgEphemeris

2008-09-10 Thread Mi Haotian
Hi Filip,

The method suggested in your email does slove the problem.Thank you very
much.

regards,
Mi Haotian

On Wed, September 10, 2008 2:39 pm, Filip Holm wrote:
 Hi Mi,


 If you have a look at my previous email on this subject you'll find the
 answer to this problem. It's a bug in osgEphemeris. After re-calculating
 the skydome image ephemeris fails to set the dirty bit on the result,
 hence the texture is not updated.

 Filip


 On Wed, Sep 10, 2008 at 3:07 AM, [EMAIL PROTECTED] wrote:


 Hei,


 I've tried running the osgEphemeris example with OSG2.6 and I could not
  get it working properly, the stars were alright but the sun never
 appeared.but the same example works perfectly on osg2.4. So does anyone
  have any idea what could be the reason for this?


 regards, Mi Haotian




 On Tue, September 9, 2008 9:17 pm, Adrian Egli OpenSceneGraph (3D)
 wrote:

 Ok,
 i will be more precises.

 * nothings strange found with osg notify level set
 * i am working with latest svn osg
 * the texture gets calculated, but not displayed on the sky dome
 * if you wish i can upload the osgEmph. with all my changes. there are
  some bugs in the osgEmph. VC 7 project. i am working with vc 2005

 / adrian



 ###
 C:\Users\adrianset OSG
 OSG_FILE_PATH=F:\dev\OpenSceneGraph\Data;.;F:\data\models;
 OSG_LIBRARY_PATH=.;F:\dev\OpenSceneGraph\Deployment\bin
 OSG_WINDOW=256 256 512 512
 #




 F:\dev\OpenSceneGraph\osgEphemeris\binset OSG_NOTIFY_LEVEL=DEBUG



 F:\dev\OpenSceneGraph\osgEphemeris\binEphemerisViewer.exe park.ive
 GraphicsContext::setWindowingSystemInterface() 010A1C40 101A0F9C
 CullSettings::readEnvironmentalVariables()
 CullSettings::readEnvironmentalVariables()
 CullSettings::readEnvironmentalVariables()
 CullSettings::readEnvironmentalVariables()
 CullSettings::readEnvironmentalVariables()
 CullSettings::readEnvironmentalVariables()
 itr='.' FindFileInPath() : trying
 F:\dev\OpenSceneGraph\osgEphemeris\bin\osgPlugins-2.7.2\osgdb_ive.dll
 ...
 itr='F:\dev\OpenSceneGraph\Deployment\bin'
 FindFileInPath() : trying
 F:\dev\OpenSceneGraph\Deployment\bin\osgPlugins-2.7.2\osgdb_ive.dll
 ...
 FindFileInPath() : USING
 F:\dev\OpenSceneGraph\Deployment\bin\osgPlugins-2.7.2\osgdb_ive.dll
 Opened DynamicLibrary osgPlugins-2.7.2/osgdb_ive.dll
 itr='F:\dev\OpenSceneGraph\Data'
 FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\park.ive ...
 itr='.' FindFileInPath() : trying
 F:\dev\OpenSceneGraph\osgEphemeris\bin\park.ive
 ...
 itr='F:\data\models'
 FindFileInPath() : trying F:\data\models\park.ive ...
 FindFileInPath() : USING F:\data\models\park.ive
 ive::DataInputStream.setLoadExternalReferenceFiles()=1
 Font 0199B608, numberOfTexturesAllocated 1
 itr='F:\dev\OpenSceneGraph\Data'
 FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 ...
 FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 itr='.' FindFileInPath() : trying

 F:\dev\OpenSceneGraph\osgEphemeris\bin\osgPlugins-2.7.2\osgdb_freetype.
 dll
 ...
 itr='F:\dev\OpenSceneGraph\Deployment\bin'
 FindFileInPath() : trying
 F:\dev\OpenSceneGraph\Deployment\bin\osgPlugins-2.7.2\osgdb_freetype.d
 ll ...
 FindFileInPath() : USING
 F:\dev\OpenSceneGraph\Deployment\bin\osgPlugins-2.7.2\osgdb_freetype.d
 ll Opened DynamicLibrary osgPlugins-2.7.2/osgdb_freetype.dll
 FindFileInPath(F:\dev\OpenSceneGraph\Data\fonts\arial.ttf): returning
 F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 FreeTypeLibrary::FreeTypeLibrary()
 Adding to object cache F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 Font 019A5F58, numberOfTexturesAllocated 2
 itr='F:\dev\OpenSceneGraph\Data'
 FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 ...
 FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 returning cached instanced of
 F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 itr='F:\dev\OpenSceneGraph\Data'
 FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 ...
 FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 returning cached instanced of
 F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 itr='F:\dev\OpenSceneGraph\Data'
 FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 ...
 FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 returning cached instanced of
 F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 itr='F:\dev\OpenSceneGraph\Data'
 FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 ...
 FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 returning cached instanced of
 F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 itr='F:\dev\OpenSceneGraph\Data'
 FindFileInPath() : trying F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 ...
 FindFileInPath() : USING F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 returning cached instanced of
 F:\dev\OpenSceneGraph\Data\fonts\arial.ttf
 itr='F:\dev\OpenSceneGraph\Data'
 FindFileInPath() : trying 

Re: [osg-users] osgTerrain::TerrainTile question

2008-09-10 Thread Robert Osfield
Hi Nicolas,

I think you have got the wrong end of the stick.  I was suggesting
TerraPage as an illustration of how cultural data (3d models) can be
stored in with the tiles on disk.  In vis-sim industry TerraPage is
well known so I used it as as a case in point to save typing lots...

FYI, The OSG's TerraPage plugin uses the PagedLOD and the
DatabasePager under the hood to provide it's paging functionality.

In your case the problem is about creating databases not actually
rendering them - as the OSG will do all the paging, and threading for
you thanks the DatabasePager and other related classes.  The
DatabasePage doesn't help you create databases, it's tools like
VirtualPlanetBuilder that do this, but... right now VPB doesn't
support insertion of cultural data into the tiles, so you'll need post
process the database to insert this data.

Robert.

On Wed, Sep 10, 2008 at 9:49 AM, Coco [EMAIL PROTECTED] wrote:
 Thank you very much for your ideas!

 I found out the osgDB::DatabasePager class by reading old posts and it looks
 to fit my problem very well.
 By using TerraPage I will have to pre-process my databases, whereas with the
 database pager I don't need to.

 virtual void  requestNodeFile (const std::string fileName, osg::Group
 *group, float priority, const osg::FrameStamp *framestamp)
 Theoretically, I just have to use this function before the camera is close
 enough to see next area(s).

 Regards,

 Nicolas Duval

 2008/9/10, Robert Osfield [EMAIL PROTECTED]:

 Hi Nicolas,

 osgTerrain::TerrainTile was named osgTerrain::Terrain in 2.2.
 osgTerrain since 2.2 was evolved to be more rounded and functional,
 the naming was changed to better fit what goes on in big paged
 database, when the Terrain is composed of a hierarchy of TerrainTile.
 There is now a new class class osgTerrain::Terrain which represent the
 high level representation of the terrain.

 In your case loading 3D models with terrain is something that we be
 best done be pre-processing your data so that the 3D models are
 inserted into a paged database.  If you are familiar with TerraPage
 then this ideal should be familiar to you.

 Robert.

 On Tue, Sep 9, 2008 at 9:30 PM, Coco [EMAIL PROTECTED] wrote:
  Hi,
 
  I'm presently working on a car simulator using OSG 2.2 for the visual.
  My problem is that I would like to load big areas (such as entire cities
  or
  more) which are fragmented in several Open Flight files without loading
  all
  those files.
  I looked at the OSG documentation and found out the
  osgTerrain::TerrainTile
  class (which doesn't exist on 2.2 OSG version).
  By using OSG 2.6, would I be able to load (with the TerrainTile class)
  only
  tiles (associated to a FLT file) that I need to see (which means
  according
  to the location of the camera)?
  Or do I need to implement this system by myself to avoid loading all
  files
  at the same time?
 
  I hope this post is clear enough and wait for answers.
 
  Kind regards,
 
  Nicolas Duval
  ___
  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] Bug? Unable to pick osgSim::SphereSegment

2008-09-10 Thread Morné Pistorius
Hi all,

I seem to be unable to pick a osgSim::SphereSegment using a
LineSegmentIntersector.  I have many other models in my scene as well that
all work fine with the picker, including loaded models and manually
assembled geometries.  It is just the SphereSegment that doesn't respond.
 When I click on it, picker-containsIntersections() always returns false:

  osgUtil::LineSegmentIntersector* picker;
  picker = new osgUtil::LineSegmentIntersector(
osgUtil::Intersector::PROJECTION, ea.getXnormalized(),ea.getYnormalized() );

  osgUtil::IntersectionVisitor iv( picker );
  viewer-getCamera()-accept( iv );

  if ( picker-containsIntersections() )   -- ALWAYS FALSE
  {
osgUtil::LineSegmentIntersector::Intersection intersection =
picker-getFirstIntersection();

osg::NodePath nodePath = intersection.nodePath;
node = ( nodePath.size() = 1 )? nodePath[ nodePath.size() - 1 ] : NULL;
  }


I will investigate this further, but I was hoping someone might have some
insights as to where to look for what goes wrong.  Is this a bug or is it
something specific to SphereSegments?  (I am using OSG v2.2)

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


Re: [osg-users] Bug? Unable to pick osgSim::SphereSegment

2008-09-10 Thread Robert Osfield
Hi Morné,

I've never done intersection testing against SphereSegment's before,
so don't have first hand experience to throw at the problem.  My best
guess at the lack of results is that the internal Drawable
implementation used in SphereSegmenet isn't implement the
Drawable::accept(PrimitiveFunctor) method which is the method that
the intersection code used to inquire about geometry data.  If this is
the case then one will need to implement this method as per the other
Drawable subclasses.

Robert.

On Wed, Sep 10, 2008 at 10:20 AM, Morné Pistorius
[EMAIL PROTECTED] wrote:
 Hi all,

 I seem to be unable to pick a osgSim::SphereSegment using a
 LineSegmentIntersector.  I have many other models in my scene as well that
 all work fine with the picker, including loaded models and manually
 assembled geometries.  It is just the SphereSegment that doesn't respond.
  When I click on it, picker-containsIntersections() always returns false:

   osgUtil::LineSegmentIntersector* picker;
   picker = new osgUtil::LineSegmentIntersector(
 osgUtil::Intersector::PROJECTION, ea.getXnormalized(),ea.getYnormalized() );

   osgUtil::IntersectionVisitor iv( picker );
   viewer-getCamera()-accept( iv );
   if ( picker-containsIntersections() )   -- ALWAYS FALSE
   {
 osgUtil::LineSegmentIntersector::Intersection intersection =
 picker-getFirstIntersection();
 osg::NodePath nodePath = intersection.nodePath;
 node = ( nodePath.size() = 1 )? nodePath[ nodePath.size() - 1 ] : NULL;
   }

 I will investigate this further, but I was hoping someone might have some
 insights as to where to look for what goes wrong.  Is this a bug or is it
 something specific to SphereSegments?  (I am using OSG v2.2)

 Thanks!
 Morne
 ___
 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] osgTerrain::TerrainTile question

2008-09-10 Thread Coco
2008/9/10, Robert Osfield [EMAIL PROTECTED]:

 Hi Nicolas,

 I think you have got the wrong end of the stick.  I was suggesting
 TerraPage as an illustration of how cultural data (3d models) can be
 stored in with the tiles on disk.  In vis-sim industry TerraPage is
 well known so I used it as as a case in point to save typing lots...

 FYI, The OSG's TerraPage plugin uses the PagedLOD and the
 DatabasePager under the hood to provide it's paging functionality.

 In your case the problem is about creating databases not actually
 rendering them - as the OSG will do all the paging, and threading for
 you thanks the DatabasePager and other related classes.  The
 DatabasePage doesn't help you create databases, it's tools like
 VirtualPlanetBuilder that do this, but... right now VPB doesn't
 support insertion of cultural data into the tiles, so you'll need post
 process the database to insert this data.

Robert.



I think there is a missunderstanding. My problem is to load a  big database,
not to create it.
I already have my database, fragmented in FLT files like I said. So I was
suggesting to use DatabasePager to load flt nodes when I need it to. In this
case I think I don't have to process any data...
I hope I haven't got the wrong end of the stick (again!).

Nicolas


On Wed, Sep 10, 2008 at 9:49 AM, Coco [EMAIL PROTECTED] wrote:
  Thank you very much for your ideas!
 
  I found out the osgDB::DatabasePager class by reading old posts and it
 looks
  to fit my problem very well.
  By using TerraPage I will have to pre-process my databases, whereas with
 the
  database pager I don't need to.
 
  virtual void  requestNodeFile (const std::string fileName, osg::Group
  *group, float priority, const osg::FrameStamp *framestamp)
  Theoretically, I just have to use this function before the camera is
 close
  enough to see next area(s).
 
  Regards,
 
  Nicolas Duval
 
  2008/9/10, Robert Osfield [EMAIL PROTECTED]:
 
  Hi Nicolas,
 
  osgTerrain::TerrainTile was named osgTerrain::Terrain in 2.2.
  osgTerrain since 2.2 was evolved to be more rounded and functional,
  the naming was changed to better fit what goes on in big paged
  database, when the Terrain is composed of a hierarchy of TerrainTile.
  There is now a new class class osgTerrain::Terrain which represent the
  high level representation of the terrain.
 
  In your case loading 3D models with terrain is something that we be
  best done be pre-processing your data so that the 3D models are
  inserted into a paged database.  If you are familiar with TerraPage
  then this ideal should be familiar to you.
 
  Robert.
 
  On Tue, Sep 9, 2008 at 9:30 PM, Coco [EMAIL PROTECTED] wrote:
   Hi,
  
   I'm presently working on a car simulator using OSG 2.2 for the visual.
   My problem is that I would like to load big areas (such as entire
 cities
   or
   more) which are fragmented in several Open Flight files without
 loading
   all
   those files.
   I looked at the OSG documentation and found out the
   osgTerrain::TerrainTile
   class (which doesn't exist on 2.2 OSG version).
   By using OSG 2.6, would I be able to load (with the TerrainTile class)
   only
   tiles (associated to a FLT file) that I need to see (which means
   according
   to the location of the camera)?
   Or do I need to implement this system by myself to avoid loading all
   files
   at the same time?
  
   I hope this post is clear enough and wait for answers.
  
   Kind regards,
  
   Nicolas Duval
   ___
   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


Re: [osg-users] osgTerrain::TerrainTile question

2008-09-10 Thread Robert Osfield
Hi Nicolas,

On Wed, Sep 10, 2008 at 10:55 AM, Coco [EMAIL PROTECTED] wrote:
 I think there is a missunderstanding. My problem is to load a  big database,
 not to create it.
 I already have my database, fragmented in FLT files like I said. So I was
 suggesting to use DatabasePager to load flt nodes when I need it to. In this
 case I think I don't have to process any data...
 I hope I haven't got the wrong end of the stick (again!).

OpenFlight files aren't paged, you can't just magically page them
without creating PagedLOD nodes that decorate them.  You have to
create some kind of paged database, even if you are creating it
dynamically on demand.

Also OpenFlight is appalling format for doing format as its 10 times
slower than using native binary formats.  Your best best to process
your source data in such a way  as to build a paged .ive database that
is composed of hierarchy of tiles.

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


Re: [osg-users] fadeIn and Out with blendcolor

2008-09-10 Thread Robert Osfield
Hi Deiter,

From the screenshot It looks to me like you have an depth ordering
issue with transparency.  This is a standard problem with rendering of
any transparent objects in your scene - you basically have to drawn
opaque objects first, then all transparent objects sorted in depth.
In your case you objects are overlapping so you have a problem that
can't easily be tackled by simply putting the objects in the
transparent bin - you'll need to break them up into small parts to get
the depth sorting fine grained enough to fix the ordering.

Robert.

On Wed, Sep 10, 2008 at 9:51 AM, Dieter Pfeffer
[EMAIL PROTECTED] wrote:

 Hi
 I am trying to fade one modell out and another one in; I am using blendfunc
 and blendcolor.

 However the first modell (when alpha is 0) cuts off the second  - see the
 attached images:

 a) first modell (dumptruck) cuts off the second
 b) the transparency is corret

 I suppose I use a wrong parameter, but I can't find it out - any idea?



 float currentAlpha = 0.0;

 void
 setAlphaBlendColor()
 {
 if (blendFunc0 == 0)
 {
 blendFunc0 = new
 osg::BlendFunc(osg::BlendFunc::CONSTANT_ALPHA, 
 osg::BlendFunc::ONE_MINUS_CONSTANT_ALPHA);
 blendColor0 = new osg::BlendColor (osg::Vec4 (1.,1.,1.,0.));

 if (loadedModel0.valid())  //dumptruck
 {
 loadedModel0 -getOrCreateStateSet()-setAttributeAndModes
 (blendFunc0,osg::StateAttribute::ON);
 loadedModel0 -getOrCreateStateSet()-setAttributeAndModes
 (blendColor0,osg::StateAttribute::ON);
 }
 }
 if (blendFunc1 == 0)
 {
 blendFunc1 = new osg::BlendFunc(osg::BlendFunc::CONSTANT_ALPHA,
 osg::BlendFunc::ONE_MINUS_CONSTANT_ALPHA);
 blendColor1 = new osg::BlendColor (osg::Vec4 (1.,1.,1.,0.));
 if (loadedModel1.valid()) //plane
 {
 loadedModel1 -getOrCreateStateSet()-setAttributeAndModes
 (blendFunc1,osg::StateAttribute::ON);
 loadedModel1 -getOrCreateStateSet()-setAttributeAndModes
 (blendColor1,osg::StateAttribute::ON);
 }
 }
if (loadedModel0.valid())
 {
 osg::Vec4 l_c;
 l_c.set(1.,1.,1.,currentAlpha);

 blendColor0-setConstantColor(l_c);
 }
 if (loadedModel1.valid())
 {
 osg::Vec4 l_c;
 l_c.set(1.,1.,1.,1-currentAlpha);

 blendColor1-setConstantColor(l_c);
 }
 }



 Thanks

 Dieter
 Unclassified Mail


 
 Disclaimer:

 If you are not the intended recipient of this email, please notify the
 sender and delete it.
 Any unauthorized copying, disclosure or distribution of this email or its
 attachment(s) is forbidden.
 Thales Nederland BV will not accept liability for any damage caused by this
 email or its attachment(s).
 Thales Nederland BV is seated in Hengelo and is registered at the Chamber of
 Commerce under number 06061578.
 


 ___
 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] osgTerrain::TerrainTile question

2008-09-10 Thread Brian R Hill
Nicholas,

If the openflight files are already subdivided into a grid of tiles
referenced into a single master file, then there's some code I posted to
the list a couple months ago that will convert them to use pagelods and
also convert them to .ive format for faster loading.

Search the archives and you should see how to do it.

Brian

[EMAIL PROTECTED] wrote: -

To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
From: Coco [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
Date: 09/10/2008 05:55AM
Subject: Re: [osg-users] osgTerrain::TerrainTile question

2008/9/10, Robert Osfield 
[EMAIL PROTECTED]
:

Hi Nicolas,

I think you have got the wrong end of the stick.  I was suggesting
TerraPage as an illustration of how cultural data (3d models) can be

stored in with the tiles on disk.  In vis-sim industry TerraPage is
well known so I used it as as a case in point to save typing lots...

FYI, The OSG's TerraPage plugin uses the PagedLOD and the
DatabasePager under the hood to provide it's paging functionality.

In your case the problem is about creating databases not actually
rendering them - as the OSG will do all the paging, and threading for
you thanks the DatabasePager and other related classes.  The
DatabasePage doesn't help you create databases, it's tools like

VirtualPlanetBuilder that do this, but... right now VPB doesn't
support insertion of cultural data into the tiles, so you'll need post
process the database to insert this data.

Robert.





I think there is a missunderstanding. My problem is to load a  big
database, not to create it.

I already have my database, fragmented in FLT files like I said. So I was
suggesting to use DatabasePager to load flt nodes when I need it to. In
this case I think I don't have to process any data...

I hope I haven't got the wrong end of the stick (again!).



Nicolas




On Wed, Sep 10, 2008 at 9:49 AM, Coco 
[EMAIL PROTECTED]
 wrote:

 Thank you very much for your ideas!

 I found out the osgDB::DatabasePager class by reading old posts and it
looks
 to fit my problem very well.
 By using TerraPage I will have to pre-process my databases, whereas with
the

 database pager I don't need to.

 virtual void  requestNodeFile (const std::string fileName, osg::Group
 *group, float priority, const osg::FrameStamp *framestamp)
 Theoretically, I just have to use this function before the camera is
close

 enough to see next area(s).

 Regards,

 Nicolas Duval

 2008/9/10, Robert Osfield 
[EMAIL PROTECTED]
:


 Hi Nicolas,

 osgTerrain::TerrainTile was named osgTerrain::Terrain in 2.2.
 osgTerrain since 2.2 was evolved to be more rounded and functional,
 the naming was changed to better fit what goes on in big paged

 database, when the Terrain is composed of a hierarchy of TerrainTile.
 There is now a new class class osgTerrain::Terrain which represent the
 high level representation of the terrain.


 In your case loading 3D models with terrain is something that we be
 best done be pre-processing your data so that the 3D models are
 inserted into a paged database.  If you are familiar with TerraPage

 then this ideal should be familiar to you.

 Robert.

 On Tue, Sep 9, 2008 at 9:30 PM, Coco 
[EMAIL PROTECTED]
 wrote:

  Hi,
 
  I'm presently working on a car simulator using OSG 2.2 for the visual.
  My problem is that I would like to load big areas (such as entire
cities
  or

  more) which are fragmented in several Open Flight files without
loading
  all
  those files.
  I looked at the OSG documentation and found out the
  osgTerrain::TerrainTile

  class (which doesn't exist on 2.2 OSG version).
  By using OSG 2.6, would I be able to load (with the TerrainTile class)
  only
  tiles (associated to a FLT file) that I need to see (which means

  according
  to the location of the camera)?
  Or do I need to implement this system by myself to avoid loading all
  files
  at the same time?
 

  I hope this post is clear enough and wait for answers.
 
  Kind regards,
 
  Nicolas Duval
  ___

  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 

Re: [osg-users] Precipitation Effect

2008-09-10 Thread selman duatepe
Hi Robert,

Thank you for quick response. I have three PrecipitationEffect active at one
time. I am trying for snow, rain, hail effect active at one time.

Selman

On Wed, Sep 10, 2008 at 3:35 PM, Robert Osfield [EMAIL PROTECTED]wrote:

 Hi Selman,

 On Wed, Sep 10, 2008 at 1:13 PM, selman duatepe [EMAIL PROTECTED]
 wrote:
  I have multiple precipitation effect objects. When I set the wind
 parameters
  of precipitation effect objects, only one precipitation effect object
  influence this wind parameters, the others are not.
 
  Anyone experienced about this problem?

 I haven't personally tried multiple osgParticle::PrecipitationEffect,
 when I wrote it I had in mind that only one would likely be active at
 any one time.

 Do you have multiple PrecipitationEffect active at one time?  What
 effect are you trying for?

 If you have multiple effects on at one time then perhaps lazy state
 updating on the uniform might be causing problems.  This is just a
 wild guess though.

 Robert.
 ___
 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] Precipitation Effect

2008-09-10 Thread Robert Osfield
Hi Selman,

On Wed, Sep 10, 2008 at 1:13 PM, selman duatepe [EMAIL PROTECTED] wrote:
 I have multiple precipitation effect objects. When I set the wind parameters
 of precipitation effect objects, only one precipitation effect object
 influence this wind parameters, the others are not.

 Anyone experienced about this problem?

I haven't personally tried multiple osgParticle::PrecipitationEffect,
when I wrote it I had in mind that only one would likely be active at
any one time.

Do you have multiple PrecipitationEffect active at one time?  What
effect are you trying for?

If you have multiple effects on at one time then perhaps lazy state
updating on the uniform might be causing problems.  This is just a
wild guess though.

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


[osg-users] osg-users subscription pass 2000 mark!

2008-09-10 Thread Robert Osfield
Hi All,

I checked the number of subscribers on osg-users this morning and
found that there are now 2002 subscribers.  A warm welcome to all the
new developers :-)

Our last milestone of 1900 was passed back in May, and the last big
milestone of 1000 subscribers was back in May 2005.   This means we
are roughly growing at average of about 0.8 a day, a rate that the we
fluctuate around month by month, but not by much.  Considering all
that is happening in the industry outwith the OSG project this
consistency of growth is somewhat surprising - Scene Graphs and OpenGL
are still just as relevant today as in the early years of the project
(at the turn of the millennium).

How the osg-users figure relates to actual osg users figures is hard
to know.  Some users subscribe more than once, while others use one
address for a whole team that use the OSG, and some developers are on
the list but just watching rather than using, while others who use the
osg unsubscribe once they are to up speed on the software but still
use the OSG.  If one then tries to work out how many end users use
software that uses the OSG rather than number of developers working
with it, well one basically has nothing to go on - being open source
that is no mechanism for tracking usage once the source code is
downloaded.  Perhaps members of osg-users can provide some figures of
there own user community.

Cheers,
Robert.

ps. If you are curious about historical community figures have a look
at the community activity page on the wiki, something I'm maintain on
adhoc basis to keep track of how we are doing, and how this compares
to other open source scene graphs:

http://www.openscenegraph.org/projects/osg/wiki/Community/CommunityActivity
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] CMake cmpilation

2008-09-10 Thread Guy
Hello all,

 I'm compiling osg2.0 on visual studio. The project was created with
CMake.

 

I changed the compiler to intel compiler, and now nothing compiles.

 

I get the errors:

 

1CMake Error: Error required internal CMake variable not set, cmake may
be not be built correctly.

1Missing variable is:

1CMAKE_SIZEOF_VOID_P

 

Any ideas why?

How does the CMake works anyway?? I didn't see calls to it in the
pre-build processing, include, or anything.

 

Thanks,

 Guy.

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


Re: [osg-users] OverlayNode bug

2008-09-10 Thread Robert Osfield
Hi Mathieu,

I don't know the cause/or a solution to the problem, but in the case
of VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY a GLSL vertex and fragment
program is used to generate the results, so I'd guess that the shader
simply doesn't know about the texture blending required.   Have a look
into the implementation to see if you can get things work.

Robert.

On Wed, Sep 10, 2008 at 3:05 PM, Mathieu MARACHE
[EMAIL PROTECTED] wrote:
 Hi,

 I happened to be testing the OverlayNode with transparent nodes and came
 across a difficult to spot bug. There are in fact three techniques that you
 can assign to an OverlayNode :

 osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY;
 osgSim::OverlayNode::VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY;
 osgSim::OverlayNode::VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY;

 Techniques 1 and 2 are producing expected results while technique 3 doesn't
 handle the transparency

 I haven't been able to spot where it goes wrong, I'm posting this in case
 someone has a hint to where the problem lies.

 --
 Mathieu

 ___
 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] CMake cmpilation

2008-09-10 Thread Guy


Hello Robert.
 Yes, I intend to upgrade... and yes, I'm looking at the CMake web site.
Since I dwelt there fore about an hour wih no significant improvement, I
just hoped someone already encountered this problem.

Thanks anyway,
 Guy.


Hi Guy,

Might I suggest you have a look at the Cmake website to see if it
supports the Intel compilers.

Also I have to recommend moving from OSG-2.0 to OSG-2.6 as the later
supports latest CMake versions which are more likely to support niche
compilers.

Robert.

On Wed, Sep 10, 2008 at 3:09 PM, Guy [EMAIL PROTECTED] wrote:
 Hello all,

  I'm compiling osg2.0 on visual studio. The project was created with
CMake.



 I changed the compiler to intel compiler, and now nothing compiles.



 I get the errors:



 1CMake Error: Error required internal CMake variable not set, cmake
may be
 not be built correctly.

 1Missing variable is:

 1CMAKE_SIZEOF_VOID_P



 Any ideas why?

 How does the CMake works anyway?? I didn't see calls to it in the
pre-build
 processing, include, or anything.



 Thanks,

  Guy.

 ___
 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.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] תשובה: CMake cmpilation

2008-09-10 Thread Guy

Thanks,
 I'll look for this IF(MSVC) and try to remove it so it will always...

Guy.

Hi Guy,

  I'm compiling osg2.0 on visual studio. The project was created with CMake.
 I changed the compiler to intel compiler, and now nothing compiles.
 I get the errors:
 
 1CMake Error: Error required internal CMake variable not set, cmake may 
 be not be built correctly.
 1Missing variable is:
 1CMAKE_SIZEOF_VOID_P
 
 Any ideas why?
 
 How does the CMake works anyway?? I didn't see calls to it in the 
 pre-build processing, include, or anything.

First of all, I haven't seen anyone compiling OSG with the Intel 
compiler, so I have no idea if this is even supposed to work. If it 
isn't widely tested, chances are it won't work without some 
modifications since the CMake code is peppered with IF(MSVC)... 
statements where equivalents would probably be needed for the Intel 
compiler.

On your more general question, I don't know on the Intel compiler, but 
on Visual Studio it adds some custom build targets which call cmake with 
scripts. I'm not sure how it's implemented exactly, but that's my 
general understanding of it. The ZERO_CHECK target checks that your 
CMake files haven't changed since the projects were generated, and 
regenerates the projects automatically if they were, for example.

Hope this helps,

J-S
-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
http://www.cm-labs.com/
 http://whitestar02.webhop.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] תשובה: CMake cmpilation

2008-09-10 Thread Jean-Sébastien Guay

Hi Guy,


 I'll look for this IF(MSVC) and try to remove it so it will always...


You're aware that's not really a fix... First of all you might need 
something different in your case, instead of always or never... (for 
example I'm reasonably sure the compiler options will be different) 
Second, when you'll want to compile a new release of OSG again you'll 
have to re-do the work.


A better solution would be to try and fix the problems for your compiler 
without breaking the others, and submit the changed files.


It's up to you of course.

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgTerrain::TerrainTile question

2008-09-10 Thread Coco
2008/9/10, Brian R Hill [EMAIL PROTECTED]:

 Nicholas,

 If the openflight files are already subdivided into a grid of tiles
 referenced into a single master file, then there's some code I posted to
 the list a couple months ago that will convert them to use pagelods and
 also convert them to .ive format for faster loading.

 Search the archives and you should see how to do it.


Brian,

Thanks a lot! I'm gonna take a look at this!

Nicolas

Brian

 [EMAIL PROTECTED] wrote: -

 To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
 From: Coco [EMAIL PROTECTED]
 Sent by: [EMAIL PROTECTED]
 Date: 09/10/2008 05:55AM
 Subject: Re: [osg-users] osgTerrain::TerrainTile question

 2008/9/10, Robert Osfield 
 [EMAIL PROTECTED]
 :

 Hi Nicolas,

 I think you have got the wrong end of the stick.  I was suggesting
 TerraPage as an illustration of how cultural data (3d models) can be

 stored in with the tiles on disk.  In vis-sim industry TerraPage is
 well known so I used it as as a case in point to save typing lots...

 FYI, The OSG's TerraPage plugin uses the PagedLOD and the
 DatabasePager under the hood to provide it's paging functionality.

 In your case the problem is about creating databases not actually
 rendering them - as the OSG will do all the paging, and threading for
 you thanks the DatabasePager and other related classes.  The
 DatabasePage doesn't help you create databases, it's tools like

 VirtualPlanetBuilder that do this, but... right now VPB doesn't
 support insertion of cultural data into the tiles, so you'll need post
 process the database to insert this data.

 Robert.





 I think there is a missunderstanding. My problem is to load a  big
 database, not to create it.

 I already have my database, fragmented in FLT files like I said. So I was
 suggesting to use DatabasePager to load flt nodes when I need it to. In
 this case I think I don't have to process any data...

 I hope I haven't got the wrong end of the stick (again!).



 Nicolas




 On Wed, Sep 10, 2008 at 9:49 AM, Coco 
 [EMAIL PROTECTED]
  wrote:

  Thank you very much for your ideas!
 
  I found out the osgDB::DatabasePager class by reading old posts and it
 looks
  to fit my problem very well.
  By using TerraPage I will have to pre-process my databases, whereas with
 the

  database pager I don't need to.
 
  virtual void  requestNodeFile (const std::string fileName, osg::Group
  *group, float priority, const osg::FrameStamp *framestamp)
  Theoretically, I just have to use this function before the camera is
 close

  enough to see next area(s).
 
  Regards,
 
  Nicolas Duval
 
  2008/9/10, Robert Osfield 
 [EMAIL PROTECTED]
 :
 

  Hi Nicolas,
 
  osgTerrain::TerrainTile was named osgTerrain::Terrain in 2.2.
  osgTerrain since 2.2 was evolved to be more rounded and functional,
  the naming was changed to better fit what goes on in big paged

  database, when the Terrain is composed of a hierarchy of TerrainTile.
  There is now a new class class osgTerrain::Terrain which represent the
  high level representation of the terrain.
 

  In your case loading 3D models with terrain is something that we be
  best done be pre-processing your data so that the 3D models are
  inserted into a paged database.  If you are familiar with TerraPage

  then this ideal should be familiar to you.
 
  Robert.
 
  On Tue, Sep 9, 2008 at 9:30 PM, Coco 
 [EMAIL PROTECTED]
  wrote:

   Hi,
  
   I'm presently working on a car simulator using OSG 2.2 for the visual.
   My problem is that I would like to load big areas (such as entire
 cities
   or

   more) which are fragmented in several Open Flight files without
 loading
   all
   those files.
   I looked at the OSG documentation and found out the
   osgTerrain::TerrainTile

   class (which doesn't exist on 2.2 OSG version).
   By using OSG 2.6, would I be able to load (with the TerrainTile class)
   only
   tiles (associated to a FLT file) that I need to see (which means

   according
   to the location of the camera)?
   Or do I need to implement this system by myself to avoid loading all
   files
   at the same time?
  

   I hope this post is clear enough and wait for answers.
  
   Kind regards,
  
   Nicolas Duval
   ___

   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

 

[osg-users] תשובה: תשובה: CMake cmpil ation

2008-09-10 Thread Guy

If it helps anyone,
I added the line
SET(CMAKE_SIZEOF_VOID_P 4)
In the file CMakeLists.txt in the project ALL_BUILD, and it seems to work. I 
only hope void* is really four bytes long and not 8 :)

Btw, the intel compiler should provide many intel specific optimizations to the 
complied code, including auto parallelism and vectorization, that should 
improve performance. If I'll get significant upgrade I'll post it here.

Guy.


Thanks,
 I'll look for this IF(MSVC) and try to remove it so it will always...

Guy.

Hi Guy,

  I'm compiling osg2.0 on visual studio. The project was created with CMake.
 I changed the compiler to intel compiler, and now nothing compiles.
 I get the errors:
 
 1CMake Error: Error required internal CMake variable not set, cmake may 
 be not be built correctly.
 1Missing variable is:
 1CMAKE_SIZEOF_VOID_P
 
 Any ideas why?
 
 How does the CMake works anyway?? I didn't see calls to it in the 
 pre-build processing, include, or anything.

First of all, I haven't seen anyone compiling OSG with the Intel 
compiler, so I have no idea if this is even supposed to work. If it 
isn't widely tested, chances are it won't work without some 
modifications since the CMake code is peppered with IF(MSVC)... 
statements where equivalents would probably be needed for the Intel 
compiler.

On your more general question, I don't know on the Intel compiler, but 
on Visual Studio it adds some custom build targets which call cmake with 
scripts. I'm not sure how it's implemented exactly, but that's my 
general understanding of it. The ZERO_CHECK target checks that your 
CMake files haven't changed since the projects were generated, and 
regenerates the projects automatically if they were, for example.

Hope this helps,

J-S
-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
http://www.cm-labs.com/
 http://whitestar02.webhop.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] CMake cmpilation

2008-09-10 Thread Jean-Sébastien Guay

Hi Guy,


 I'm compiling osg2.0 on visual studio. The project was created with CMake.
I changed the compiler to intel compiler, and now nothing compiles.
I get the errors:

1CMake Error: Error required internal CMake variable not set, cmake may 
be not be built correctly.

1Missing variable is:
1CMAKE_SIZEOF_VOID_P

Any ideas why?

How does the CMake works anyway?? I didn't see calls to it in the 
pre-build processing, include, or anything.


First of all, I haven't seen anyone compiling OSG with the Intel 
compiler, so I have no idea if this is even supposed to work. If it 
isn't widely tested, chances are it won't work without some 
modifications since the CMake code is peppered with IF(MSVC)... 
statements where equivalents would probably be needed for the Intel 
compiler.


On your more general question, I don't know on the Intel compiler, but 
on Visual Studio it adds some custom build targets which call cmake with 
scripts. I'm not sure how it's implemented exactly, but that's my 
general understanding of it. The ZERO_CHECK target checks that your 
CMake files haven't changed since the projects were generated, and 
regenerates the projects automatically if they were, for example.


Hope this helps,

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] תשובה: תשובה: CMake cmpil ation

2008-09-10 Thread Guy

Your are obviously right. But many times I start with the quick and dirty 
solution and only if it works, I adjust it to be a real general solution.
Anyway, in this case the IF(MSVC) didn't do the trick but setting the size of 
pointer value, did. 

Guy.


Hi Guy,

  I'll look for this IF(MSVC) and try to remove it so it will always...

You're aware that's not really a fix... First of all you might need 
something different in your case, instead of always or never... (for 
example I'm reasonably sure the compiler options will be different) 
Second, when you'll want to compile a new release of OSG again you'll 
have to re-do the work.

A better solution would be to try and fix the problems for your compiler 
without breaking the others, and submit the changed files.

It's up to you of course.

J-S
-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
http://www.cm-labs.com/
 http://whitestar02.webhop.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] תשובה: תשובה: CMak e cmpilation

2008-09-10 Thread Jean-Sébastien Guay

Hi Guy,

Anyway, in this case the IF(MSVC) didn't do the trick but setting the size of pointer value, did. 


This setting should normally be automatically set by CMake (it compiles 
a small test program using your configured compiler at the start of the 
generation process). If that didn't happen correctly it should probably 
be reported as a bug in CMake.


Good to know you're progressing, at least.

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgal with multiple sounds

2008-09-10 Thread Joe Lyga
Hi osg-users,

I've been playing around with the osgal audio library trying to get some
basic 3D sound working (with openscenegraph 2.4 I believe).  I've had some
success attaching a single sound to a single object, but I've been having
some problems getting multiple sounds to play at the same time.  Even with
the demos, it alternates between playing the two sounds instead of playing
them simultaneously.  I'm pretty sure my computer has multiple sound
channels, and I'm curious if I'm just using outdated libraries, or if it's
working as intended.

Has anyone had any luck with osgal?

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


Re: [osg-users] osgal with multiple sounds

2008-09-10 Thread xyc508
Hi,Joe Lyga
 
I ever meet the same problem one year before,but it still not solved.I think 
that osgAL have two sound channel limited.But i don't know why!
 
Same Confused Person
Donlin
 
 
 

在2008-09-10,Joe Lyga [EMAIL PROTECTED] 写道:

Hi osg-users,

I've been playing around with the osgal audio library trying to get some basic 
3D sound working (with openscenegraph 2.4 I believe).  I've had some success 
attaching a single sound to a single object, but I've been having some problems 
getting multiple sounds to play at the same time.  Even with the demos, it 
alternates between playing the two sounds instead of playing them 
simultaneously.  I'm pretty sure my computer has multiple sound channels, and 
I'm curious if I'm just using outdated libraries, or if it's working as 
intended.

Has anyone had any luck with osgal?

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


[osg-users] Wiki link for OSG-ODE

2008-09-10 Thread Sukender

Hello all,

I'm working on a small and simple GPL game engine called PVLE ( 
http://pvle.sourceforge.net ), that tries to integrate OSG, ODE and such. As I 
saw some people trying to integrate ODE with OSG, do you think it would be wise 
to put a link on OSG's wiki? If yes, in which category (Applications, nodekits, 
other...)?

Thanks!

Sukender
_
Email envoyé avec Windows Live Hotmail. Dites adieux aux spam et virus, passez 
à Hotmail ! C'est gratuit !
http://www.windowslive.fr/hotmail/default.asp
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Problem rendering Overlay node

2008-09-10 Thread Rahul Jain

Hi all,
I am trying to use overlay node to overlay a sphere on top of a 
cylinder, but  i am getting the black area(Clear color) around the 
sphere as shown in the snapshot. Ideally i want to have just sphere on 
top of cylinder. My code for  setting the overlay is


// Create overlay node
   osg::ref_ptrosgSim::OverlayNode olNode =
   new 
osgSim::OverlayNode(osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY);


   olNode-setOverlaySubgraph(sphNode);
   olNode-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER);
   olNode-setOverlayTextureSizeHint(1024);
   olNode-setOverlayBaseHeight(0.0);
   olNode-setTexEnvMode(GL_BLEND);
   olNode-setOverlayClearColor(osg::Vec4(1.0, 0.0, 0.0, 0.0));

   osg::ref_ptrosg::Group grpNode = new osg::Group;
 
   olNode-addChild(cylNode);


Can someone tell me what am i doing wrong ?

--
Rahul Jain,
Member of Technical Staff,
Visualization Experts Limited.
www.vizexperts.com
+91-98109-83697 (M) 

inline: ov.png___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Returning ref_ptr vs. ref_ptr::get()

2008-09-10 Thread Cliff Taylor
[Part 1:]

I'm relatively new to Open Scene Graph, so please forgive me if this
has been answered a hundred times already.

In the Open Scene Graph Quick Start Guide, Paul Martz gives several
examples where his functions return a ref_ptr.  In almost every
case, however, he returns the raw pointer address by returning the
result of ref_ptr::get() on his ref_ptrclass T object.

For a simple example, on page 37 (Section 2.1.3) he gives the following method:

osg::ref_ptrosg::Group createGroup()
{
  osg::ref_ptrosg::Group grp = new osg::Group;

  //comments
  return grp.get()
}

I understand that this will (or *should*) implicitly call the ctor:
ref_ptr(T* ptr)
and create the proper ref_ptr.  What I don't understand is why he
doesn't just return grp and let it call the copy ctor.

At first I thought it might be a scope issue, but if grp falls out
of scope, grp._ptr goes away with it.
My second thought was that he is using a slightly less-complex ctor,
but I doubt the performance gain is measurable.

My only other thought is that when he returns, for instance, a
ref_ptrosg::Group from a method with a return type of
ref_ptrosg::Node, the ref_ptr is created dynamically instead of
coerced across ref_ptrclass T types.  As long as it gets cast up to
a ref_ptrbase class, however, I don't see this as a problem.

Could one of you shed some light on this for me?  Is it just a coding
style decision on his part, or is this the right way?  I've seen
other examples where the ref_ptr itself is just returned.  I feel
like this is the way to go, but I want to write only good code with
OSG.
---
[Part 2:]

On a related note, there are some things about the use of ref_ptr
that I'm not sure I'm completely happy with.  If the OSG library is
going to make full use of ref_ptr for memory management, then it
seems like the member functions that take raw pointers should be
changed to use ref_ptr instead.

I understand that there may be cases when a new object is to be added
dynamically to another object's references, i.e.:
grp-addChild(new osg::Geode);

However, this could be handled by either providing the secondary
member functions for these special cases, or by letting the programmer
handle the conversion.  In fact, the programmer could let implicit
conversion handle this if he trusts his compiler.  Internally, classes
such as osg::Group simply use this implicit conversion when they add
the raw pointer (Node *) to their child list (see implementation of
osg::Group::insertChild).  In some cases, more than one implicit
conversion takes place (Geode * -- Node * -- ref_ptrNode).

I say this because it seems that using ref_ptr::get() breaks the
rules of reference pointers, because it allows you an easy way to
ignore the reference counting.  The class functions encourage the use
of ref_ptr::get(), as well.  While this works fine with careful
programming, it opens up some easy-to-make mistakes, and invites abuse
and the forming of bad habits by less skilled programmers.  If
another programmer has to maintain or debug this pointer-abusive code,
it could make finding the problems extremely difficult.  I already
know of one case where a developer simply removed all the non-required
uses of ref_ptr to just make another programmer's errors go away as
quickly as possible.

If I remember correctly, Java purposely doesn't give you access to the
base addresses its references point to.  At least, I can't think of an
easy way to access them.  This is all in the name of safe garbage
collection and data hiding, which ref_ptr::get() feels like it's
breaking, at least to me.  Shouldn't we let ref_ptr do it's job and
not mess with its internal structures, for the same reason we
shouldn't call ref() and unref() on osg::Referenced family objects?

That's the view from here.  I admit to being only partially informed.
If this makes somebody on the dev team think, well, I guess that can
only be positive, even if I'm wrong.  What I would really like,
however, is for someone who knows more about what's going on in OSG to
set the record straight for me.  I'd like to hear it from your side so
I can get a feel for where OSG is coming from.  Remember, I'm new to
OSG, so talk slowly and don't hurt my feelings ;-)

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


Re: [osg-users] Returning ref_ptr vs. ref_ptr::get()

2008-09-10 Thread Paul Speed



Cliff Taylor wrote:


If I remember correctly, Java purposely doesn't give you access to the
base addresses its references point to.  At least, I can't think of an
easy way to access them.  This is all in the name of safe garbage
collection and data hiding, which ref_ptr::get() feels like it's
breaking, at least to me.  Shouldn't we let ref_ptr do it's job and
not mess with its internal structures, for the same reason we
shouldn't call ref() and unref() on osg::Referenced family objects?



One thing to remember is that garbage collection (as in Java) is 
different than managed pointers.  The first is a full solution, the 
second is a nice helper.  For example, Java handles circular references, 
doesn't require buy in by all containing classes, etc..  ref_ptr 
doesn't have this luxury so it is frequently necessary to work around it.


In light of that, it would be impossible to get rid of get().
-Paul (a different Paul. ;))



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


Re: [osg-users] unrendered objects creating performance problems?

2008-09-10 Thread Joseanibal Colon Ramos
Thanks for the culling mode tip Robert. My terrain was generated using
VirtualPlanet builder, but I didn't do it, so I'll get back to you when I
get more details on that. I'm running my application on 2 machines getting
similar results: a 64-bit-Linux-86 with a double headed Nvidia Quadro
3450. The other is an intel MacBook Pro with a GForce 8600. The available
RAM for both is way over 1GB. I am trying OSG 2.6.0. It usually runs
smoothly at 60fps, but on this particular terrain, when zoomed in, and at
angles on which I look far into the distance, the framerate drops to below
20, which is unacceptable for my application.  I believe I end up drawing
way too many triangles for the computer to handle efficiently. I am trying
to find ways to run at a solid 60fps no matter what.

-Jose





On Wed, September 10, 2008 12:56 am, Robert Osfield wrote:
 Hi Joseanibal,

 By default the OSG does not cull on the near/far planes, and near/far
 clipping is done down on the GPU only affect the fill rate performance
 of your application.   You can enable culling on the near/far planes,
 but you have to be careful about setting your near/far planes so that
 encompass your scene - as the OSG by default computes the near/far
 planes it'll hide the inappropriately set near/far planes so by
 toggling these features on you might suddenly find parts of foreground
 or distance disappearing.

 To switch off the compute of near far use the Camera methods
 (inherited from osg::CullSettings) :

   
 viewer.getCamera()-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR)

 To enable the culling against the far plane use methods inherited from
 osg::CullSettings again:

   int cullingMode = viewer.getCamera()-getCullingMode() |
 osg::CullSettings::FAR_PLANE_CULLING;
   viewer.getCamera()-setCullingMode(cullingMode);

 All of this doesn't really address the performance issue too much.
 You don't mention the nature of your database at all i.e. how you
 built it, what scene graph components it uses, or what hardware, or
 OS, or OSG version you are using, all this info is essential for
 others to know enough to really guide you in the right direction.

 Robert.


 On Wed, Sep 10, 2008 at 1:08 AM, Joseanibal Colon Ramos
 [EMAIL PROTECTED] wrote:
 Hi all,

 I was hoping someone has an idea about why I am encountering the
 following
 problem: I have a big terrain and on certain viewing angles it contains
 a
 huge amount of triangles to draw and puts a big strain on OSG's
 performance. I tried playing around with near/far clipping planes to
 improve performance, by cutting out a lot of the rendering, to the point
 only a very small fraction (and even none at all) of the terrain is seen
 through my camera. OSG's framerate, however, behaves just as if I was
 looking at the whole thing and drawing all the triangles.

 At certain angles, the framerate increases (where small number of
 triangles would normally be - even thought I don't see anything),

 and at other angles, it decreases (the same angles at which the viewer
 normally tries to draw a large number of triangles - even though I can't
 see anything). What is going on here?!? help!

 -J

 ___
 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] Returning ref_ptr vs. ref_ptr::get()

2008-09-10 Thread Robert Osfield
Hi Cliff,

I won't dive in deep in this topic as it's been covered many times and
there is docs up on the wiki.

W.r.t access to .get(), yes this in theory can lead to misuse, but
it's also key to genuine uses - such as where a C pointer is required.
 I tend to assume that OSG users are grown ups and know how to code, I
rather not penalise the good programmers for the inabilities of the
few engineers who can't code their way out of wet paper bag.

The code example you gave doesn't look clean, there is no need to pass
back a C pointer from a function that returns a ref_ptr, unless the
types of different.  Cases where the types can be different is when
using a ref_ptrGroup internally and then passing out a ref_ptrNode
as the return type, here there is now way to downcast a ref_ptrGroup
to ref_ptrNode.  One can do this downcast use member templates,
but... not all compilers and all the platforms we support support this
feature so we have had to make do with out it.  Pain in the butt, but
that's the way of the wacky C++ world.

On a general note, I tend to use ref_ptr when they are required, and
C* pointers elsewhere, I choose ref_ptr when I want robust and easy
memory management, I use C pointers where no particular harm will come
from their usage, and performance will be gained (please note passing
ref_ptr around introduces thrashing of the renderenceCount() which
kills performance if you aren't careful).   Mixing code with ref_ptr
and C* can be done perfectly safely, but you do need to understand the
consequences - ref counting is one of the fundamental concepts that
all C++ programmers need to grasp very early in their careers, long
before they even come across software like the OSG.

Robert.



On Wed, Sep 10, 2008 at 7:22 PM, Cliff Taylor [EMAIL PROTECTED] wrote:
 [Part 1:]

 I'm relatively new to Open Scene Graph, so please forgive me if this
 has been answered a hundred times already.

 In the Open Scene Graph Quick Start Guide, Paul Martz gives several
 examples where his functions return a ref_ptr.  In almost every
 case, however, he returns the raw pointer address by returning the
 result of ref_ptr::get() on his ref_ptrclass T object.

 For a simple example, on page 37 (Section 2.1.3) he gives the following 
 method:

 osg::ref_ptrosg::Group createGroup()
 {
  osg::ref_ptrosg::Group grp = new osg::Group;

  //comments
  return grp.get()
 }

 I understand that this will (or *should*) implicitly call the ctor:
 ref_ptr(T* ptr)
 and create the proper ref_ptr.  What I don't understand is why he
 doesn't just return grp and let it call the copy ctor.

 At first I thought it might be a scope issue, but if grp falls out
 of scope, grp._ptr goes away with it.
 My second thought was that he is using a slightly less-complex ctor,
 but I doubt the performance gain is measurable.

 My only other thought is that when he returns, for instance, a
 ref_ptrosg::Group from a method with a return type of
 ref_ptrosg::Node, the ref_ptr is created dynamically instead of
 coerced across ref_ptrclass T types.  As long as it gets cast up to
 a ref_ptrbase class, however, I don't see this as a problem.

 Could one of you shed some light on this for me?  Is it just a coding
 style decision on his part, or is this the right way?  I've seen
 other examples where the ref_ptr itself is just returned.  I feel
 like this is the way to go, but I want to write only good code with
 OSG.
 ---
 [Part 2:]

 On a related note, there are some things about the use of ref_ptr
 that I'm not sure I'm completely happy with.  If the OSG library is
 going to make full use of ref_ptr for memory management, then it
 seems like the member functions that take raw pointers should be
 changed to use ref_ptr instead.

 I understand that there may be cases when a new object is to be added
 dynamically to another object's references, i.e.:
 grp-addChild(new osg::Geode);

 However, this could be handled by either providing the secondary
 member functions for these special cases, or by letting the programmer
 handle the conversion.  In fact, the programmer could let implicit
 conversion handle this if he trusts his compiler.  Internally, classes
 such as osg::Group simply use this implicit conversion when they add
 the raw pointer (Node *) to their child list (see implementation of
 osg::Group::insertChild).  In some cases, more than one implicit
 conversion takes place (Geode * -- Node * -- ref_ptrNode).

 I say this because it seems that using ref_ptr::get() breaks the
 rules of reference pointers, because it allows you an easy way to
 ignore the reference counting.  The class functions encourage the use
 of ref_ptr::get(), as well.  While this works fine with careful
 programming, it opens up some easy-to-make mistakes, and invites abuse
 and the forming of bad habits by less skilled programmers.  If
 another programmer has to maintain or debug this pointer-abusive 

Re: [osg-users] Reference frame

2008-09-10 Thread ami guru
Hello Hans,

The queries are the result of the going through the link that you have
sent.

Regards
Sajjad


On Wed, Sep 10, 2008 at 9:24 AM, Elbers, H.P. [EMAIL PROTECTED]wrote:

  Hello Sajjad,

 You can find details on this, and much more good information in
 OpenSceneGraph Quick Start Guide, chapter : 2.3.3

 Go to 
 *http://www.skew-matrix.com/OSGQSG/index.html*http://www.skew-matrix.com/OSGQSG/index.html,
 follow the 'lulu.com' link. The guide can be downloaded for free. Paul
 Martz: thank you *VERY* much for this beautiful guide!

 Good luck,

 Hans.

  --
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] *On Behalf Of *ami guru
 *Sent:* woensdag 10 september 2008 4:59
 *To:* OpenSceneGraph Users
 *Subject:* [osg-users] Reference frame

  Hello Forum,


 OSG Transform allows to specify its reference frame and by default the
 reference frame is relative. and the other one is the absolute.
 And the two are specified by different code identifier.

 We can view transformation in 2 ways.

 1. relative to  the fixed coordinate system.
 2. Local movable coordinate system.

 There is no practical difference and just a matter of viewpoint.

 What is the purpose of OSG to specify them separately as follows:

 osg::Transform::RELATIVE_RF.

 Any example would be of great help!!!



 Regards
 Sajjad


 ___
 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] unrendered objects creating performance problems?

2008-09-10 Thread Robert Osfield
Hi Jose,

If you build your VPB terrain using --terrain it'll produce terrain
which a high degree of geometry, but you can dynamically control how
much geometry is rendered by setting the
osgTerrain::Terrain::setSampleRatio(float).  You can also control the
LOD scale via viewer.getCamera()-setLODScale(float).   See the
osgmultitexturecontrol example for illustration of this in action.

The LODScale is a value you can vary per frame, so if you want to
change it in response to load you can.  The SampleRatio is something
that'll be used on building of terrain geometry, and changing this on
the fly would force a rebuild of the geometry so isn't something you
want to vary per frame.  I'd suggest altering the SampleRatio fit
different hardware, then use LODScale on the fly.

Robert.


On Wed, Sep 10, 2008 at 7:52 PM, Joseanibal Colon Ramos
[EMAIL PROTECTED] wrote:
 Thanks for the culling mode tip Robert. My terrain was generated using
 VirtualPlanet builder, but I didn't do it, so I'll get back to you when I
 get more details on that. I'm running my application on 2 machines getting
 similar results: a 64-bit-Linux-86 with a double headed Nvidia Quadro
 3450. The other is an intel MacBook Pro with a GForce 8600. The available
 RAM for both is way over 1GB. I am trying OSG 2.6.0. It usually runs
 smoothly at 60fps, but on this particular terrain, when zoomed in, and at
 angles on which I look far into the distance, the framerate drops to below
 20, which is unacceptable for my application.  I believe I end up drawing
 way too many triangles for the computer to handle efficiently. I am trying
 to find ways to run at a solid 60fps no matter what.

 -Jose





 On Wed, September 10, 2008 12:56 am, Robert Osfield wrote:
 Hi Joseanibal,

 By default the OSG does not cull on the near/far planes, and near/far
 clipping is done down on the GPU only affect the fill rate performance
 of your application.   You can enable culling on the near/far planes,
 but you have to be careful about setting your near/far planes so that
 encompass your scene - as the OSG by default computes the near/far
 planes it'll hide the inappropriately set near/far planes so by
 toggling these features on you might suddenly find parts of foreground
 or distance disappearing.

 To switch off the compute of near far use the Camera methods
 (inherited from osg::CullSettings) :

   
 viewer.getCamera()-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR)

 To enable the culling against the far plane use methods inherited from
 osg::CullSettings again:

   int cullingMode = viewer.getCamera()-getCullingMode() |
 osg::CullSettings::FAR_PLANE_CULLING;
   viewer.getCamera()-setCullingMode(cullingMode);

 All of this doesn't really address the performance issue too much.
 You don't mention the nature of your database at all i.e. how you
 built it, what scene graph components it uses, or what hardware, or
 OS, or OSG version you are using, all this info is essential for
 others to know enough to really guide you in the right direction.

 Robert.


 On Wed, Sep 10, 2008 at 1:08 AM, Joseanibal Colon Ramos
 [EMAIL PROTECTED] wrote:
 Hi all,

 I was hoping someone has an idea about why I am encountering the
 following
 problem: I have a big terrain and on certain viewing angles it contains
 a
 huge amount of triangles to draw and puts a big strain on OSG's
 performance. I tried playing around with near/far clipping planes to
 improve performance, by cutting out a lot of the rendering, to the point
 only a very small fraction (and even none at all) of the terrain is seen
 through my camera. OSG's framerate, however, behaves just as if I was
 looking at the whole thing and drawing all the triangles.

 At certain angles, the framerate increases (where small number of
 triangles would normally be - even thought I don't see anything),

 and at other angles, it decreases (the same angles at which the viewer
 normally tries to draw a large number of triangles - even though I can't
 see anything). What is going on here?!? help!

 -J

 ___
 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] Returning ref_ptr vs. ref_ptr::get()

2008-09-10 Thread Cliff Taylor
On Wed, Sep 10, 2008 at 2:00 PM, Robert Osfield
[EMAIL PROTECTED] wrote:
 Hi Cliff,

 I won't dive in deep in this topic as it's been covered many times and
 there is docs up on the wiki.

 W.r.t access to .get(), yes this in theory can lead to misuse, but
 it's also key to genuine uses - such as where a C pointer is required.
  I tend to assume that OSG users are grown ups and know how to code, I
 rather not penalise the good programmers for the inabilities of the
 few engineers who can't code their way out of wet paper bag.

 The code example you gave doesn't look clean, there is no need to pass
 back a C pointer from a function that returns a ref_ptr, unless the
 types of different.  Cases where the types can be different is when
 using a ref_ptrGroup internally and then passing out a ref_ptrNode
 as the return type, here there is now way to downcast a ref_ptrGroup
 to ref_ptrNode.  One can do this downcast use member templates,
 but... not all compilers and all the platforms we support support this
 feature so we have had to make do with out it.  Pain in the butt, but
 that's the way of the wacky C++ world.


OK, thanks.  That's about what I had figured.  Passing back the C
pointer when you're changing the reference type is the safe thing to
do, but it's otherwise unnecessary.

I'm still trying to decide if I agree with your statement about
penalizing the good programmers by having the library calls take
ref_ptr when they're going to implicitly cast it there anyway, but I
do see your point with .get() being a convenience to those of us who
know how to use it properly.

Speaking of which, good points were made by Paul Speed (sorry, had my
sub set to digest..).  I can see how it would be impossible to
handle every possible result of not having access to the raw pointer
through .get().  My issue was really with the library encouraging
.get() to be used, not with it being available.

 On a general note, I tend to use ref_ptr when they are required, and
 C* pointers elsewhere, I choose ref_ptr when I want robust and easy
 memory management, I use C pointers where no particular harm will come
 from their usage, and performance will be gained (please note passing
 ref_ptr around introduces thrashing of the renderenceCount() which
 kills performance if you aren't careful).   Mixing code with ref_ptr
 and C* can be done perfectly safely, but you do need to understand the
 consequences - ref counting is one of the fundamental concepts that
 all C++ programmers need to grasp very early in their careers, long
 before they even come across software like the OSG.

 Robert.

Because of the speed requirements we have, I'll probably be using C
pointers with OSG a lot more than I would expect.
I guess the idea of using smart pointers and the practice diverge a bit.

Some version of good library design would say that if you are going
to use ref_ptr, then your library arguments should expect its use.
However, C++ brings its own issues to the party.  Also, the only way
to be sure it is always safe to pass a C pointer to the library
functions is to provide a version that takes a C pointer.  I see how
this could become an issue where someone says, look, we're just going
to expect you to use safe coding practices and picks a version for
the library.

It goes back to the quote:
The difference between theory and practice is that in theory, there
is no difference between theory and practice, but in practice, there
is. -- (Unknown author)

Thanks for the fast feedback, guys :-)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Reference frame

2008-09-10 Thread Paul Martz
Thanks. I didn't really think I went into any great deoth on ABSOLUTE versus
RELATIVE, though.
   -Paul
 


  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Elbers,
H.P.
Sent: Wednesday, September 10, 2008 1:24 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Reference frame



Hello Sajjad,



You can find details on this, and much more good information in
OpenSceneGraph Quick Start Guide, chapter : 2.3.3

Go to  http://www.skew-matrix.com/OSGQSG/index.html
http://www.skew-matrix.com/OSGQSG/index.html, follow the 'lulu.com' link.
The guide can be downloaded for free. Paul Martz: thank you *VERY* much for
this beautiful guide!

Good luck,

Hans.


  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ami guru
Sent: woensdag 10 september 2008 4:59
To: OpenSceneGraph Users
Subject: [osg-users] Reference frame


Hello Forum,


OSG Transform allows to specify its reference frame and by default the
reference frame is relative. and the other one is the absolute.
And the two are specified by different code identifier.

We can view transformation in 2 ways.

1. relative to  the fixed coordinate system.
2. Local movable coordinate system.

There is no practical difference and just a matter of viewpoint.

What is the purpose of OSG to specify them separately as follows:

osg::Transform::RELATIVE_RF.

Any example would be of great help!!!



Regards
Sajjad



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


Re: [osg-users] Reference frame

2008-09-10 Thread Paul Martz
 What is the purpose of OSG to specify them separately as follows:
 
 osg::Transform::RELATIVE_RF. 

In short, if you don't know whether you want RELATIVE or ABSOLUTE, then you
probably want RELATIVE.
 
RELATIVE is for the typical case where you have a Camera node that specifies
the view, and other transforms (below the Camera in the scene graph
hierarchy) that place objects in the world coordinate system. This is the
view and model transforms from which the OpenGL ModelView matrix gets
its name. In this case, the model transform nodes need to specify RELATIVE
so that OSG will concatenate them with the view matrix from the Camera node.

You might also want to use RELATIVE to create some type of robot arm scene
graph in which transformations occur relative to each other.

This is all fairly basic 3D graphics so I'll recommend you purchase a
standard 3D text such as Real Time Rendering or 3D Graphics Principles
and Practice; see the recommended reading in the Quick Start Guide.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 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] osgal with multiple sounds

2008-09-10 Thread Joe Lyga
I found a solution!

In the osgAL multiple sounds example's createSound function, the
allocateSource function needs to be called before setPlay instead of after
setPlay.  The allocateSource funciton is important, since it allocates a
hardware soundsource for each sound being added to the scenegraph.

Anyway, here is how the fixed code looks in createSound.  This is at or near
line 386 in osgalmultiple.cpp:

osg::ref_ptrosgAL::SoundState sound_state = new
osgAL::SoundState(file);
sound_state-setSample(sample.get());
sound_state-setGain(1.0f);
sound_state-setReferenceDistance(60);
sound_state-setRolloffFactor(3);
sound_state-allocateSource(10);
sound_state-setPlay(true);
sound_state-setLooping(true);

The two sounds now play simultaneously, as intended.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Returning ref_ptr vs. ref_ptr::get()

2008-09-10 Thread Paul Martz
 What I don't understand is 
 why he doesn't just return grp and let it call the copy ctor.

In the example you cited, I could've done as you suggest. But as you and
Robert already discussed, this wouldn't work if the return type were a
ref_ptr to a base class of Group.

I figure there are two types of programmers: those who know C++ and can spin
up on things like ref_ptr in a matter if a few minutes just by glancing at
the code, and those who aren't so experienced and need some hand holding. To
address the needs of the latter group, the section on ref_ptr could have
been an entire chapter unto itself. To keep the book short and affordable, I
decided to give them a set of short but safe instructions that would keep
them out of trouble when using ref_ptrs. Exploring all of ref_ptr's ins and
outs is left as an exercise to the reader. (There are, of course, multiple
ways to return ref_ptr memory from a function. If I update the book, I'll
consider recommending release(), for example.)

Thanks for reading the book.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 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] Returning ref_ptr vs. ref_ptr::get()

2008-09-10 Thread Cliff Taylor
On Wed, Sep 10, 2008 at 4:35 PM, Paul Martz [EMAIL PROTECTED] wrote:
 What I don't understand is
 why he doesn't just return grp and let it call the copy ctor.

 In the example you cited, I could've done as you suggest. But as you and
 Robert already discussed, this wouldn't work if the return type were a
 ref_ptr to a base class of Group.

 I figure there are two types of programmers: those who know C++ and can spin
 up on things like ref_ptr in a matter if a few minutes just by glancing at
 the code, and those who aren't so experienced and need some hand holding. To
 address the needs of the latter group, the section on ref_ptr could have
 been an entire chapter unto itself. To keep the book short and affordable, I
 decided to give them a set of short but safe instructions that would keep
 them out of trouble when using ref_ptrs. Exploring all of ref_ptr's ins and
 outs is left as an exercise to the reader. (There are, of course, multiple
 ways to return ref_ptr memory from a function. If I update the book, I'll
 consider recommending release(), for example.)

 Thanks for reading the book.

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


Once I picked up on that, I figured out where you are coming from with
the book.  It's a smart way to write it if you want to keep it short,
but now I know to just apply my knowledge of C++ to it and not be
afraid that there's something you're not telling us in the book.  Or
rather, there's a lot you're not telling us, but you are telling us
what we need to know.

And no, thank YOU for writing it.  It's a great introduction to OSG,
and it's only around 100 pages long.  I'm glad the boss paid for the
hardcopy :-)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org