Re: [osg-users] Mac OSX | Problem loading curl-plugin inside OSG-web-plugin

2011-08-09 Thread Stephan Maximilian Huber
Hi,

Am 08.08.11 18:22, schrieb Guido Lucci Baldassari:
> Does anyone know how I can obtain the path of @loader_path at runtime
> (a better solution than getenv(PWD))? Thanks in advance

you can try one of the NSBundle-methods:

NSBundle* bundle = [NSBundle bundleForClass: [self class]];
std::string plugin_path( [ [bundle builtInPlugInsPath] cString]);

This will give you the path to the PlugIns-folder inside your bundle.

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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-09 Thread Cyril Bondue
anyone can try the attached code please? Just to see if the bug comes from my 
compilation (even if i didn't change a think..) my code or something.

Thanks!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41944#41944





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


Re: [osg-users] osg::Geometry and GL_PRIMITVE_RESTART

2011-08-09 Thread Peter Wrobel

Hi Sergey,

thank you, now its working perfectly

cheers, ParticlePeter


Hi, Peter

This is because osg tries to compute bound of drawable based on vertices it 
uses. So if your restart index behind memory allocated for vertices storage osg 
will go out of array bound when computing bounds of drawable, thats where your 
access violation comes from. You can try to avoid this with setting initial 
bound yourself and\or setting your own computeBoundCallback on drawable. 
Another way is to add additional vertex to vertex array and use it index as 
restart index to make osg bound computation happy.

Cheers,
Sergey.

07.08.2011, 00:26, "Peter Wrobel":

Hi J-S,

Yes, thank you, that did the trick, now it works. And to answer my question 
above, it has to be glEnableClientState, otherwise its not working.

I have one more issue now. Sergey, I am getting a Access Violation Exception 
directly after calling viewer.run inside osg::Vec3f line 84, if I use the the 
default restart index of USHRT_MAX.
To debug this, I added a method to set the index, and got wired results. I 
created an 18 Elements TriStrip, code is bellow. When I set the restart index 
between 0 and 18 (18 is not a typo ), everything is fine. When I set it to 19 
and higher I get this in the console:

Code:

CullVisitor::apply(Geode&) detected NaN,
depth=-1.IND, center=(-2 0 -7.942e+037),
matrix={
   1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN
   1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN
   1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN
   1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN
}

If I set the index between 1000 and 2000 it works right ( ! ), and if I set it 
to 5000 and above I get the Access Violation Exception again.
Do you have any idea what's going on ? Is this related to not creating an 
StateAttribute ?

TestCode, uses the class posted by hybr:

Code:

#include "DrawElementsUShortRestart.h"

#include
#include
#include

osg::ref_ptr<  osg::Node>  createDrawElements() {

osg::Geometry * geom = new osg::Geometry() ;

osg::Vec3Array * vrts = new osg::Vec3Array() ;
geom ->  setVertexArray( vrts ) ;

unsigned int numVrts = 18 ;

// Create Vertex Positions for TriStripe
for( unsigned int i = 0 ; i<  numVrts / 2 ; ++i ) {
   vrts ->  push_back( osg::Vec3( i , 1.f , 0.f ) ) ;
   vrts ->  push_back( osg::Vec3( i ,-1.f , 0.f ) ) ;
}

// Create a PrimitiveRestart DrawElements
DrawElementsUShortRestart * drawElems = new DrawElementsUShortRestart() ;

// This is set to false by default in the constructors initializer list
drawElems ->  enableRestart( true ) ;

// Added this method to the DrawElementsUShortRestart Class
drawElems ->  setRestartIndex( 1000 ) ; // Try also 20 and USHRT_MAX

for( unsigned int i = 0 ; i<  numVrts ; ++i ) {
   if ( i == 9 )
  drawElems ->  push_back( 1000 ) ; // Try also 20 and USHRT_MAX

   drawElems ->  push_back( i ) ;
}

geom ->  addPrimitiveSet( drawElems ) ;
geom ->  getOrCreateStateSet() ->  setMode( GL_LIGHTING , 
osg::StateAttribute::OFF ) ;
geom ->  getOrCreateStateSet() ->  setAttributeAndModes(
   new osg::PolygonMode( osg::PolygonMode::FRONT_AND_BACK, 
osg::PolygonMode::LINE ) ) ;

osg::ref_ptr<  osg::Geode>  geode = new osg::Geode() ;
geode ->  addDrawable( geom ) ;

return geode.release() ;

}

Thank you!

Cheers, ParticlePeter

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41911#41911

___
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] Join my network on LinkedIn

2011-08-09 Thread Alberto Jaspe via LinkedIn
LinkedIn





Alberto Jaspe requested to add you as a connection on LinkedIn:
  
--

I'd like to add you to my professional network on LinkedIn.

Accept invitation from Alberto Jaspe
http://www.linkedin.com/e/-qywqtf-gr4st7sj-4r/ki9l5dc0WBU2jCm_-ENl0WSMUV6C2kw9fBND0WJWSkAnjfMIiTR/blk/I108461582_125/6lColZJrmZznQNdhjRQnOpBtn9QfmhBt71BoSd1p65Lr6lOfPkOclYOe3kNdzgUc359bQINlkFxtkcUbPoUcPwTdP8Me3cLrCBxbOYWrSlI/EML_comm_afe/

View profile of Alberto Jaspe
http://www.linkedin.com/e/-qywqtf-gr4st7sj-4r/rsn/5890444/LXPj/
--

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


Re: [osg-users] Video playback on Mac via Imagestream.

2011-08-09 Thread Elliott D'Alvarez
Hi all,

Sorry for the slow reply, I got put on a different project for a week. I'm 
going to give the quicktime plugin another try then, I couldn't find any good 
documentation on it anywhere so probably got a little confused and made an 
error. I will let you know how I get on.

Cheers,
Elliott

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41947#41947





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


Re: [osg-users] Multiple Shaders

2011-08-09 Thread haithcoc


Glenn,
Thanks for the response.  Do you know where I can find the
osgvirtualprogram example?
The program I have worked on has recently moved from osg 2.2 to 2.8.3 (dark
ages, I know).  I do not see osgvirtualprogram in the osg examples
directories for 2.2, 2.8.2, or 2.8.3.

I am adding precipitation effects (and dust effects) to a project that
currently uses shaders produce a rendered scene that represents sensor
returns - the render target is read back by the main program,
where the data is consumed.  For the app/channel that has the sensor, the
program/shader is added to a node near the top of the tree.  I have added
the precip effect program/shader to a node slightly below this one - at the
same level as the top terrain and entities node.  The sensor shader
basically does range calculation, applies some error, and does some
processing for alpha fragments.  For the visual channel, that has no higher
shaders, this works fine.  However, for the sensor channel, the precip
particles don't get seen by sensor shader.

My implementation of rain/snow is based on a slightly modified
osgPrecipitationEffect.  Perhaps shader is not the way to go for the precip
effect, but I thought it would provide the best efficiency.  Nevertheless,
I can definitely see the need in the near future to have multiple,
accumulated, non-overriding effects.  Currently, I would like to be able to
have the results from osgPrecipitationEffect like shader be seen by the
higher sensor shader.

Any thoughts?

Stephen Haithcock
General Dynamics Land Systems
38500 Mound Rd.
Sterling Heights, MI 48310
MZ 436-40-15
(586) 825-8573



   
 Glenn Waldron 
 To 
 Sent by:  osg-users@lists.openscenegraph.org  
 osg-users-bounces  cc 
 @lists.opensceneg 
 raph.org  Subject 
   Re: [osg-users] Multiple Shaders
   
 08/05/2011 05:35  
 PM
   
   
 Please respond to 
  OpenSceneGraph   
   Users   
  
   
   




Stephen,

You need some kind of shader composition. Personally, I prefer the
VirtualProgram approach taken in the osgvirtualprogram example. IIRC,
Robert did not consider this flexible enough to be a general-purpose shader
comp solution, so it's not in the core OSG. However it suited our needs
quite well so we adopted and extended it for use in the osgEarth project.

http://github.com/gwaldron/osgearth/blob/master/src/osgEarth/ShaderComposition

Glenn Waldron / Pelican Mapping / @glennwaldron


On Thu, Aug 4, 2011 at 10:19 AM, Stephen Haith  wrote:
  Very timely thread - I am looking at doing the same thing.

  How can you apply a shader effect to the entire scene, AND another effect
  to only a part of the tree?

  Thanks,

  Stephen

  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=41851#41851





  ___
  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





This is an e-mail from General Dynamics Land Systems. It is for the intended 
recipient only and may contain confidential and privileged information.  No one 
else may read, print, store, copy, forward or act in reliance on it or its 
attachments.  If you are not the intended recipient, please return this message 
to the sender and delete the message and any attachments from your computer. 
Your cooperation is appreciated.

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


Re: [osg-users] Multiple Shaders

2011-08-09 Thread Glenn Waldron
Stephen,
That example is in the main distro; you need to enable the examples in CMake
to see it. The source is here
http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/examples/osgvirtualprogram

Yes, yours is a case for shader composition. PrecipitationEffect is
self-contained so you would need to modify it to make it work in a
composition framework.

BTW here is a write-up on the shader composition approach we use in
osgEarth. Like I said, we started with VirtualProgram and extended it to
support user function injection.

http://osgearth.org/wiki/OeDevelShaderComposition


Glenn Waldron / Pelican Mapping / @glennwaldron


On Tue, Aug 9, 2011 at 10:03 AM,  wrote:

>
>
> Glenn,
> Thanks for the response.  Do you know where I can find the
> osgvirtualprogram example?
> The program I have worked on has recently moved from osg 2.2 to 2.8.3 (dark
> ages, I know).  I do not see osgvirtualprogram in the osg examples
> directories for 2.2, 2.8.2, or 2.8.3.
>
> I am adding precipitation effects (and dust effects) to a project that
> currently uses shaders produce a rendered scene that represents sensor
> returns - the render target is read back by the main program,
> where the data is consumed.  For the app/channel that has the sensor, the
> program/shader is added to a node near the top of the tree.  I have added
> the precip effect program/shader to a node slightly below this one - at the
> same level as the top terrain and entities node.  The sensor shader
> basically does range calculation, applies some error, and does some
> processing for alpha fragments.  For the visual channel, that has no higher
> shaders, this works fine.  However, for the sensor channel, the precip
> particles don't get seen by sensor shader.
>
> My implementation of rain/snow is based on a slightly modified
> osgPrecipitationEffect.  Perhaps shader is not the way to go for the precip
> effect, but I thought it would provide the best efficiency.  Nevertheless,
> I can definitely see the need in the near future to have multiple,
> accumulated, non-overriding effects.  Currently, I would like to be able to
> have the results from osgPrecipitationEffect like shader be seen by the
> higher sensor shader.
>
> Any thoughts?
>
> Stephen Haithcock
> General Dynamics Land Systems
> 38500 Mound Rd.
> Sterling Heights, MI 48310
> MZ 436-40-15
> (586) 825-8573
>
>
>
>
> Glenn Waldron
>  om>To
> Sent by:  osg-users@lists.openscenegraph.org
> osg-users-bounces  cc
> @lists.opensceneg
> raph.org  Subject
>   Re: [osg-users] Multiple Shaders
>
> 08/05/2011 05:35
> PM
>
>
> Please respond to
>  OpenSceneGraph
>   Users
>  openscenegraph.or
>g>
>
>
>
>
>
>
> Stephen,
>
> You need some kind of shader composition. Personally, I prefer the
> VirtualProgram approach taken in the osgvirtualprogram example. IIRC,
> Robert did not consider this flexible enough to be a general-purpose shader
> comp solution, so it's not in the core OSG. However it suited our needs
> quite well so we adopted and extended it for use in the osgEarth project.
>
>
> http://github.com/gwaldron/osgearth/blob/master/src/osgEarth/ShaderComposition
>
>
> Glenn Waldron / Pelican Mapping / @glennwaldron
>
>
> On Thu, Aug 4, 2011 at 10:19 AM, Stephen Haith  wrote:
>  Very timely thread - I am looking at doing the same thing.
>
>  How can you apply a shader effect to the entire scene, AND another effect
>  to only a part of the tree?
>
>  Thanks,
>
>  Stephen
>
>  --
>  Read this topic online here:
>  http://forum.openscenegraph.org/viewtopic.php?p=41851#41851
>
>
>
>
>
>  ___
>  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
>
>
>
>
>
> This is an e-mail from General Dynamics Land Systems. It is for the
> intended recipient only and may contain confidential and privileged
> information.  No one else may read, print, store, copy, forward or act in
> reliance on it or its attachments.  If you are not the intended recipient,
> please return this message to the sender and delete the message and any
> attachments from your computer. Your cooperation is appreciated.
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
__

Re: [osg-users] Crash on startup on Win7 x64

2011-08-09 Thread Torben Dannhauer
Hi,

Its not about using osgVisual, the 3rdparty is designated to OSG in general. It 
is only compiled, packed and provided by osgVisual.

Glad to hear it works now. :)

Cheers,
Torben

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41950#41950





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


Re: [osg-users] dimension oh a model

2011-08-09 Thread Sanat Talmaki
Hi David,

I guess I am replying to a rather old post, but I'll try my luck anyway:

Adding to your post on getting the size of the terrain, I had a similar 
question in mind. For a given terrain model (built using osgeart/vpb etc), is 
there a way to ensure that models loaded on the terrain conform to the scale of 
the terrain. If I loaded a building model onto a terrain, unless I knows the 
size of the terrain and the dimensions/scaling it is conforming to, my building 
model may be unrealistically big/small not representing reality.

I was searching along these lines and came across your post and just wanted to 
check if you had found any tool that helps you do this (getting terrain size) 

Thanks

Sincerely,
Sanat

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41951#41951





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


Re: [osg-users] osgAndroidExampleGLES1 crashed

2011-08-09 Thread anurag mairal
Hi Jorge,
 I got the issue; application is not able to load data; its plugin problem,
Thanks for the help,
Bye
Anurag
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] dimension oh a model

2011-08-09 Thread Paul Martz
In response to David's post (which I didn't see until now), it's fairly 
straightforward to back-transform a pixel into world coordinates. I've posted on 
this in the past, email me offline and I'll send you more info about it.


Sanat, one thing I learned in the GIS classes years ago is that you must be very 
careful to have all of your GIS data in the same projection/ellipsoid/units, or 
they won't mix well. If your buildings are too large, then perhaps they were 
modeled in feet and your Earth is modeled in meters, for example. If you don't 
have any meta data for the models to tell your application what coordinate 
system and units the model uses, there is no magic software trick to handle that 
situation. So you have two solutions: Either manually put all your models (Earth 
and buildings) into the same coordinate system and units, or manually ensure 
that each model contains the necessary metadata so that your application can 
transform them as needed into a common coordinate system and units.

   -Paul


On 8/9/2011 10:24 AM, Sanat Talmaki wrote:

Hi David,

I guess I am replying to a rather old post, but I'll try my luck anyway:

Adding to your post on getting the size of the terrain, I had a similar 
question in mind. For a given terrain model (built using osgeart/vpb etc), is 
there a way to ensure that models loaded on the terrain conform to the scale of 
the terrain. If I loaded a building model onto a terrain, unless I knows the 
size of the terrain and the dimensions/scaling it is conforming to, my building 
model may be unrealistically big/small not representing reality.

I was searching along these lines and came across your post and just wanted to 
check if you had found any tool that helps you do this (getting terrain size)

Thanks

Sincerely,
Sanat

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41951#41951





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





--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/

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


[osg-users] Determining whether a node is active in UpdateVisitor.

2011-08-09 Thread Mark Acosta
Is there some mechanism to determine whether or not a node being traversed 
during an update traversal is active or not? I know I could change the 
TraversalMode in UpdateVisitor to traverse only active children, but what if 
I want to traverse all children and only take action if a particular type of 
node is active? I can't find anything in NodeVisitor that would let me do 
this.


Thanks,
Mark 


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


[osg-users] Camera returns NULL viewport on Windows but not Linux

2011-08-09 Thread Paul Leopard
I have some code I have inherited that was developed on Linux. I am trying to 
get a Windows version of it to run but there is an inconsistency that I am 
unable to explain. Perhaps someone here has seen this issue before ...

Anyway, the problem is that on Windows (OSG v2.9.9 and v3.0.0) I get a NULL 
viewport pointer with the following (pseudocode) call to getViewport() :

Code:
osg::ArgumentParser arguments(&argc,argv);
osgViewer::Viewer viewer(arguments);
viewer.addEventHandler(...);
osg::Group* root = new osg::Group;
root->addChild( ... );
viewer.frame();
osg::Camera* camera = viewer.getCamera();
assert(camera!=NULL); // Ok
osg::Viewport* pViewPort = camera->getViewport();
assert(pViewPort !=NULL); // FAILS! NULL POINTER




On Linux the pointer is valid, on Windows it is always NULL. Am I missing 
something here or has anyone else had this issue?


Thanks!
Paul

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41955#41955





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


Re: [osg-users] Camera returns NULL viewport on Windows but not Linux

2011-08-09 Thread Jeremy Moles
On Tue, 2011-08-09 at 22:05 +0200, Paul Leopard wrote:
> I have some code I have inherited that was developed on Linux. I am trying to 
> get a Windows version of it to run but there is an inconsistency that I am 
> unable to explain. Perhaps someone here has seen this issue before ...
> 
> Anyway, the problem is that on Windows (OSG v2.9.9 and v3.0.0) I get a NULL 
> viewport pointer with the following (pseudocode) call to getViewport() :
> 
> Code:
> osg::ArgumentParser arguments(&argc,argv);
> osgViewer::Viewer viewer(arguments);
> viewer.addEventHandler(...);
> osg::Group* root = new osg::Group;
> root->addChild( ... );
> viewer.frame();

Try viewer.realize() here instead; not sure it'll change anything, but
it's worth a shot.

> osg::Camera* camera = viewer.getCamera();
> assert(camera!=NULL); // Ok
> osg::Viewport* pViewPort = camera->getViewport();
> assert(pViewPort !=NULL); // FAILS! NULL POINTER
> 
> 
> 
> 
> On Linux the pointer is valid, on Windows it is always NULL. Am I missing 
> something here or has anyone else had this issue?
> 
> 
> Thanks!
> Paul
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=41955#41955
> 
> 
> 
> 
> 
> ___
> 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] Determining whether a node is active in UpdateVisitor.

2011-08-09 Thread Tom Pearce
Hi Mark,

I don't know if this is optimal or not, but one thing you could do is use the 
NodeVisitor::getNodePath() method.  You can look through the path to find any 
switch nodes, and use the Switch::getChildValue(const Node*) method to see if 
the next node in the list is on or off.  This is of course assuming that this 
is what you meant by active.

Cheers,
Tom

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41956#41956





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


Re: [osg-users] Camera returns NULL viewport on Windows but not Linux

2011-08-09 Thread Paul Leopard
Thanks for the reply but it didn't fix anything ...

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41958#41958





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