Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jason Daly

Ismail Pazarbasi wrote:

small correction, if you don't misunderstand; that will not decrease
reference count, since ptr is void* and has no connection whatsoever
with pointee (osg::Referenced). In following case:

osg::ref_ptr pnode = new osg::Node;
void* ptr = pnode;
ptr = NULL;
(this is what I understood)
  


Right.  Sorry, I misunderstood the original message.



Rabbi, once you get raw pointer from smart pointer, you take
responsibility of reference counting (and of course, C++ scoping
rules). You may pass that pointer around, but you should be careful
with reference counting and scope that osg::ref_ptr was declared.
  


Exactly right.



Bottom line is; use smart pointers instead of raw pointers and be
explicit about conversions. Respect scope of smart pointer, because it
can't know what you do with the raw pointer once you obtain it.
  


Sometimes it's more convenient to temporarily use a generic pointer (as 
a local variable inside a single function, for example).  This is fine, 
as long as you know the object is going to be valid during the course of 
that function.  If you need to keep a reference to the object for any 
length of time (a class member, for example), use a ref_ptr.


--"J"

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


[osg-users] Looking for GLSL Parallax Occlusion Mapping

2009-05-28 Thread Chris 'Xenon' Hanson
I've tried posting this a couple of times, and it disappears. It went through 
yesterday as
a reply to a test post, so I'm going to try again with the proper subject.


I'm looking to add extra visual realism to surfaces using shaders. Grass, 
gravel and
dirt are some of the obvious candidates, but there could be others. I am hoping 
to use a
type of Parallax Mapping. I have a few algorithms of basic Parallax Mapping, 
but they fall
apart at glancing angles close to the ground (where the user viewpoint will 
frequently be).

  Tatarchuk's Parallax Occlusion Mapping:

http://ati.amd.com/developer/SIGGRAPH05/Tatarchuk-ParallaxOcclusionMapping-Sketch-print.pdf
http://ati.amd.com/developer/gdc/Tatarchuk-ParallaxOcclusionMapping-FINAL_Print.pdf
http://ati.amd.com/developer/gdc/2006/GDC06-Tatarchuk-Parallax_Occlusion_Mapping.pdf

  Seems to solve many of the issues.

  The GDC 06 paper with the allegedly improved algorithm only talks about HLSL 
and
DirectX. I'm interested in checking this algorithm out to see how it performs 
(I'm
designing shaders in RenderMonkey) but I've had a hard time finding working 
GLSL source
for anything newer than the original Parallax Shader from 04 and earlier.

  I don't want to write and debug an implementation from scratch just to find 
out it
doesn't do the job, so I was hoping to find a working implementation somewhere, 
but am not
finding one. Anyone seen one? It looks like a heck of a technique and could 
really be used
to great purpose in landscapes, and well, just about anything with surface 
detail.

  Anyone know where to find something like this?

  Also, I'm interested in other sources of canned shaders. I'm not trying to do
cutting-edge research, I'm just trying to apply the best available technology 
to a
visualization problem to give the best results without reinventing the wheel.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Jason Daly

Xin Chen wrote:

Hi,
   
I'm new to OSG. I use the following code to load my model, which is successful.  How can I access the vertices and faces of the model? Thank you.


nNode = osgDB::readNodeFile("D:/Livingroom.3DS");
  


Access them for what purpose?

When your model is loaded, a scene graph is created from it.  This scene 
might contain several different sets of vertices, normals, texture 
coordinates, and primitives.  If you just want to look at them, you can 
create a custom NodeVisitor to find all the osg::Geometry objects in the 
scene, then query the vertex arrays and primitive sets from each 
Geometry object. 

Chances are that there is an easier way to do what you want, but we 
can't help you until you tell us what you're trying to do.


--"J"

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


Re: [osg-users] MFC or Win32 based viewer

2009-05-28 Thread Cory Riddell




The osgviewer app that comes with OSG works in Windows. Also, the
bundled examples include an MFC based viewer called osgviewerMFC. 

Cory

Clay, Bruce wrote:

  
  
  
  
  I have tried all of the
ones except for osgWin32Demo (the
link is nonresponsive) in the windowing Toolkit section and can not get
them to
compile with the current version of OSG for various reasons.  One uses
a
CameraManipulator which doe4s not seem to be in the current build.
Another is
looking for getOrCreateDatabasePager
in
registry.
   
   
  Does anyone have basic
viewer code that works with a MFC or
Win32 framework? 
   
  Bruce
   
   
   
  
  
This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.
  

___
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] Ground clamping to paging terrain

2009-05-28 Thread brettwiesner

Hi,

I want to position something (let's say a building) to a terrain. 
Currently I'm getting the Z value for the building doing this with an 
osgUtil::IntersectVisitor and that works fine for static terrains. When 
I run on a paging terrain (like one from osgEarth) and I position the 
building, I get a Z value of the lowest LOD. Then more data pages in and 
the building gets "buried" underground as more accurate data comes 
available.


What's the most effiecient "ground clamp" things to paging terrain?

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


Re: [osg-users] Looking for GLSL Parallax Occlusion Mapping

2009-05-28 Thread Jason Daly



Hi, Chris,

I went to the Siggraph 2005 sketch, so I'm somewhat familiar with the 
technique (though I've never implemented it).  I wouldn't think it would 
be terribly hard to translate the HLSL code to GLSL, would it?


In any case there's a gamedev.net article on it (with HLSL .fx file 
provided) here:


  http://www.gamedev.net/columns/hardcore/pom/


As for canned shaders, the Nvidia SDK has tons of them, some in GLSL, 
and others in Cg and HLSL):


http://developer.nvidia.com/object/sdk_home.html

I'm sure AMD/ATi has a similar collection as well.

--"J"


Chris 'Xenon' Hanson wrote:

I've tried posting this a couple of times, and it disappears. It went through 
yesterday as
a reply to a test post, so I'm going to try again with the proper subject.


I'm looking to add extra visual realism to surfaces using shaders. Grass, 
gravel and
dirt are some of the obvious candidates, but there could be others. I am hoping 
to use a
type of Parallax Mapping. I have a few algorithms of basic Parallax Mapping, 
but they fall
apart at glancing angles close to the ground (where the user viewpoint will 
frequently be).

  Tatarchuk's Parallax Occlusion Mapping:

http://ati.amd.com/developer/SIGGRAPH05/Tatarchuk-ParallaxOcclusionMapping-Sketch-print.pdf
http://ati.amd.com/developer/gdc/Tatarchuk-ParallaxOcclusionMapping-FINAL_Print.pdf
http://ati.amd.com/developer/gdc/2006/GDC06-Tatarchuk-Parallax_Occlusion_Mapping.pdf

  Seems to solve many of the issues.

  The GDC 06 paper with the allegedly improved algorithm only talks about HLSL 
and
DirectX. I'm interested in checking this algorithm out to see how it performs 
(I'm
designing shaders in RenderMonkey) but I've had a hard time finding working 
GLSL source
for anything newer than the original Parallax Shader from 04 and earlier.

  I don't want to write and debug an implementation from scratch just to find 
out it
doesn't do the job, so I was hoping to find a working implementation somewhere, 
but am not
finding one. Anyone seen one? It looks like a heck of a technique and could 
really be used
to great purpose in landscapes, and well, just about anything with surface 
detail.

  Anyone know where to find something like this?

  Also, I'm interested in other sources of canned shaders. I'm not trying to do
cutting-edge research, I'm just trying to apply the best available technology 
to a
visualization problem to give the best results without reinventing the wheel.

  


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


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Ismail Pazarbasi
2009/5/28 Xin Chen :
> Hi,
>
>    I'm new to OSG. I use the following code to load my model, which is 
> successful.  How can I access the vertices and faces of the model? Thank you.
>
> nNode = osgDB::readNodeFile("D:/Livingroom.3DS");
>
>
>
>
>
> Thank you!
>
> Cheers,
> xinchen
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=13087#13087
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

Hi Xin,

I am not a plugin user (except freetype), but I could easily say; you
need to traverse the graph starting from Node returned! I don't know
how that graph is constructed (that is, how a face is represented -
probably a geode). It could be a good start to see 3ds plugin's source
code. As far as I can see, it's relatively complicated, but may give
you a start. Did you see/debug its source code? If you haven't already
done so, compile OpenSceneGraph with debug configuration and step into
3DS plugin. To understand how it works, you may need to create a very
simple 3DS file with one quad and its normals (may be) and load it
instead of a complicated one.

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


Re: [osg-users] MFC or Win32 based viewer

2009-05-28 Thread Ismail Pazarbasi
2009/5/28 Clay, Bruce :
> I have tried all of the ones except for osgWin32Demo (the link is
> nonresponsive) in the windowing Toolkit section and can not get them to
> compile with the current version of OSG for various reasons.  One uses a
> CameraManipulator which doe4s not seem to be in the current build. Another
> is looking for getOrCreateDatabasePager in registry.
>
>
>
>
>
> Does anyone have basic viewer code that works with a MFC or Win32 framework?
>
>
>
> Bruce
>
>
>
>
>
>
>
> This message and any enclosures are intended only for the addressee.  Please
> notify the sender by email if you are not the intended recipient.  If you
> are
> not the intended recipient, you may not use, copy, disclose, or distribute
> this
> message or its contents or enclosures to any other person and any such
> actions
> may be unlawful.  Ball reserves the right to monitor and review all messages
> and enclosures sent to or from this email address.
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>

Hi Bruce,

which version of OSG (2.8.1?) did you try? I am not sure about MFC
(I've never used it since I have porting concerns), but it works for
SDL.

If you are not using SDL, you can skip the rest...

I don't know your purpose, but once you get a window from SDL, you
could obtain its window handle via GetActiveWindow() (as long as it's
_the_ only top level window you've got). After obtaining HWND, you can
call regular Win32 functions over it (or you may attach an existing
windowing framework's class to that handle; e.g. CWindow of WTL).

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


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Xin Chen

Jason Daly wrote:
> Xin Chen wrote:
> 
> > Hi,
> > 
> > I'm new to OSG. I use the following code to load my model, which is 
> > successful.  How can I access the vertices and faces of the model? Thank 
> > you.
> > 
> > nNode = osgDB::readNodeFile("D:/Livingroom.3DS");
> > 
> > 
> 
> Access them for what purpose?
> 
> When your model is loaded, a scene graph is created from it.  This scene 
> might contain several different sets of vertices, normals, texture 
> coordinates, and primitives.  If you just want to look at them, you can 
> create a custom NodeVisitor to find all the osg::Geometry objects in the 
> scene, then query the vertex arrays and primitive sets from each 
> Geometry object. 
> 
> Chances are that there is an easier way to do what you want, but we 
> can't help you until you tell us what you're trying to do.
> 
> --"J"
> 
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum



Hello J,

Thank you for the reply. I do need the vertices and faces. My 
application is to load CAD model and simulate the projection (X-ray image) of 
the model according to the materials. So the ability to access individual 
vertices are important for my application. Any easy ways to build a program 
that able to load different types of model and also can access individual 
vertices and faces? Thanks

Xin

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





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


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Xin Chen

ismailp wrote:
> 2009/5/28 Xin Chen <>:
> 
> > Hi,
> > 
> >    I'm new to OSG. I use the following code to load my model, which is 
> > successful.  How can I access the vertices and faces of the model? Thank 
> > you.
> > 
> > nNode = osgDB::readNodeFile("D:/Livingroom.3DS");
> > 
> > 
> > 
> > 
> > 
> > Thank you!
> > 
> > Cheers,
> > xinchen
> > 
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=13087#13087
> > 
> > 
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> > 
> 
> Hi Xin,
> 
> I am not a plugin user (except freetype), but I could easily say; you
> need to traverse the graph starting from Node returned! I don't know
> how that graph is constructed (that is, how a face is represented -
> probably a geode). It could be a good start to see 3ds plugin's source
> code. As far as I can see, it's relatively complicated, but may give
> you a start. Did you see/debug its source code? If you haven't already
> done so, compile OpenSceneGraph with debug configuration and step into
> 3DS plugin. To understand how it works, you may need to create a very
> simple 3DS file with one quad and its normals (may be) and load it
> instead of a complicated one.
> 
> Ismail
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum



Hello Ismail, 

   Thanks for your reply. I did look at the source code to load .stl 
models. I found that there are _vertices and _normal variables in the source 
code. That's why I'm asking if there is a way to access those parameters. Any 
idea or sample code? Thank you. 

Xin

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





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


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Jason Daly

Xin Chen wrote:

Thank you for the reply. I do need the vertices and faces. My 
application is to load CAD model and simulate the projection (X-ray image) of 
the model according to the materials. So the ability to access individual 
vertices are important for my application. Any easy ways to build a program 
that able to load different types of model and also can access individual 
vertices and faces? Thanks
  


I'm not sure what you mean by "simulate the projection ... according to 
the materials".   Can you elaborate?


If you really do need to get at the low-level data, you can use the 
NodeVisitor method I described previously.  You'll need to create a 
class that inherits from osg::NodeVisitor and overrides the 
apply(Geometry *) method to perform whatever operations you need on each 
Geometry in your scene.  You also might want to look at the 
AttributeFunctor class inside osg::Drawable and/or the PrimitiveFunctor 
class inside osg::Geometry.  These allow you to perform similar 
operations on the vertices and/or primitives (triangles, quads, etc.) 
inside the Geometry object.


--"J"

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


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Ismail Pazarbasi
2009/5/28 Xin Chen :
> Hello Ismail,
>
>       Thanks for your reply. I did look at the source code to load .stl 
> models. I found that there are _vertices and _normal variables in the source 
> code. That's why I'm asking if there is a way to access those parameters. Any 
> idea or sample code? Thank you.
>
> Xin
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=13131#13131
>
Hello Xin,

no, I have no source code about that. I know it isn't the way to deal
with such situations; but all I can recommend is to walk through the
source code and Google for it! The fact that source code available is
available to us means that we are supposed to use it as much as we can
(again; it'd be much better if we had documentation covering
_everything_ - but it's too difficult to write one).

Normals could be accessed via osg::Geode::getNormal methods (you
have normal idices, data and binding method - see include/Geometry).
To do that, you need to traverse the returned graph (that is, the
Node* returned). In your NodeVisitor, you can do:
osg::Geode* pGeode = dynamic_cast(pNode); // where, pNode
is pointer to node
if (pGeode) // this is a geode node - query normals
{
   pGeode->getNormal // depends on what you want; normal indices,
binding method, etc. see member methods
}
(to traverse, you need to call "traverse" method on the Node* returned
with a reference to a custom NodeVisitor. See Jason's post, which I
believe covers "how to do it" part)

However, because I've never used any osg plugin (but freetype,
implicitly via osgText), I am not exactly sure whether this is
correct.

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


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Jason Daly

Jason Daly wrote:
If you really do need to get at the low-level data, you can use the 
NodeVisitor method I described previously.  You'll need to create a 
class that inherits from osg::NodeVisitor and overrides the 
apply(Geometry *) method to perform whatever operations you need on each 
Geometry in your scene.  You also might want to look at the 
AttributeFunctor class inside osg::Drawable and/or the PrimitiveFunctor 
class inside osg::Geometry.  These allow you to perform similar 
operations on the vertices and/or primitives (triangles, quads, etc.) 
inside the Geometry object.
  


I should point out you can also just get the attribute arrays (vertices, 
normals, etc) by calling the appropriate get*Array() method on the 
Geometry.  For example, getVertexArray() will fetch the vertex 
coordinate array.


You can do the same with the primitives by calling getPrimitiveSet().  
You'll probably need to familiarize yourself with the different types of 
primitive sets (DrawArrays, DrawArrayLengths, and DrawElements) as well.


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


Re: [osg-users] Ground clamping to paging terrain

2009-05-28 Thread Chris 'Xenon' Hanson
brettwiesner wrote:
> I want to position something (let's say a building) to a terrain.
> Currently I'm getting the Z value for the building doing this with an
> osgUtil::IntersectVisitor and that works fine for static terrains. When
> I run on a paging terrain (like one from osgEarth) and I position the
> building, I get a Z value of the lowest LOD. Then more data pages in and
> the building gets "buried" underground as more accurate data comes
> available.
> What's the most effiecient "ground clamp" things to paging terrain?

  I think you're on the right track. I ran into this before -- the Intersect 
visitor only
goes to the lowest LOD. but I think you could adapt it to be smarter.

> Thanks,
> Brett

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Chris 'Xenon' Hanson
Xin Chen wrote:

>Thanks for your reply. I did look at the source code to load .stl 
> models. I found that there are _vertices and _normal variables in the source 
> code. That's why I'm asking if there is a way to access those parameters. Any 
> idea or sample code? Thank you. 

  I think those are only temporary variables specific to the STL loader, and 
they don't
persist after the loader has created the scene graph.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Looking for GLSL Parallax Occlusion Mapping

2009-05-28 Thread Chris 'Xenon' Hanson
Jason Daly wrote:
> I went to the Siggraph 2005 sketch, so I'm somewhat familiar with the
> technique (though I've never implemented it).  I wouldn't think it would
> be terribly hard to translate the HLSL code to GLSL, would it?
> In any case there's a gamedev.net article on it (with HLSL .fx file
> provided) here:
>   http://www.gamedev.net/columns/hardcore/pom/

  I was worried because I thought the presentation implied it was using some 
special
DX/HLSL tricks that might give me fits trying to port, since I know diddly 
about HLSL and
DX. So I was hoping somewhere it had already been done. It looks like such a 
useful
technique for many effects that I figured everybody and their brother would be 
using it.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] crash when closing an "embeddedWindow" viewer with a shader example

2009-05-28 Thread Jonas Walti
Thank you for your help. Doesn't crash anymore. Solved.

Cheers,
Jonas

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





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


Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Paul Martz
Just to kind of sum up what has been said here...

To get the vertices and other vertex attributes, you use get* methods in the
Geometry class. See the Geometry header file.

There could be dozens, possibly thousands of Geometry objects in your scene
graph. You use a NodeVisitor to walk your scene graph and look for Geodes,
then iterate over the Drawables that are attached to the Geodes, using
dynamic_cast to access the Drawable as a Geometry. For more info here, grep
for "NodeVisitor" in the OSG source code. NodeVisitors are used throughout
OSG, so finding them should be easy. Also take a look at the Geode header,
and note that Geometry derives from Drawable.

Finally, the OSG Quick Start Guide has lots of applicable information that
will help you out: http://stores.lulu.com/pmartz. It seems like there have
been a lot of posts recently by people who have not bothered to take a look
at this free resource.

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] Ground clamping to paging terrain

2009-05-28 Thread Paul Martz
There is an osgSim::ElevationSlice that might be useful here, because it is
smart about paged databases and will go to the highest LOD to get the
elevation values.

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] Ground clamping to paging terrain

2009-05-28 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
I've tried the following which seems to work pretty well for moving models
on the paging terrain surface. Perhaps you can leverage this to do what you
need.

double MissionFunctions::GetHeightOnTerrain(double lat, double lon)
{
double X,Y,Z;
double maxElevation = 13000.0 / 3.281; // make sure we're above the
highest point in the database (meters)
earth->convertLatLongHeightToXYZ(osg::DegreesToRadians(lat),

osg::DegreesToRadians(lon),
   maxElevation, X, Y, Z);
double hat =
osgSim::HeightAboveTerrain::computeHeightAboveTerrain(terrain.get(),
osg::Vec3d(X,Y,Z), -1);
return (maxElevation - hat);
}

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
brettwiesner
Sent: Thursday, May 28, 2009 2:03 PM
To: OpenSceneGraph Users
Subject: [osg-users] Ground clamping to paging terrain

Hi,

I want to position something (let's say a building) to a terrain. 
Currently I'm getting the Z value for the building doing this with an 
osgUtil::IntersectVisitor and that works fine for static terrains. When 
I run on a paging terrain (like one from osgEarth) and I position the 
building, I get a Z value of the lowest LOD. Then more data pages in and 
the building gets "buried" underground as more accurate data comes 
available.

What's the most effiecient "ground clamp" things to paging terrain?

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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Ground clamping to paging terrain

2009-05-28 Thread Glenn Waldron
Brett,

Installing a ReadCallback on your IntersectionVisitor will allow it to
traverse PagedLODs so you can intersect with the highest LOD. Look at
osgSim::HeightAboveTerrain for a demonstration of the technique.

If you don't like that approach, you could install an
osgDB::Registry::ReadCallback, and re-clamp an object each time a new higher
LOD tile pages in under the object's location.


Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791


On Thu, May 28, 2009 at 4:03 PM, brettwiesner wrote:

> Hi,
>
> I want to position something (let's say a building) to a terrain. Currently
> I'm getting the Z value for the building doing this with an
> osgUtil::IntersectVisitor and that works fine for static terrains. When I
> run on a paging terrain (like one from osgEarth) and I position the
> building, I get a Z value of the lowest LOD. Then more data pages in and the
> building gets "buried" underground as more accurate data comes available.
>
> What's the most effiecient "ground clamp" things to paging terrain?
>
> Thanks,
> Brett
> ___
> 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] Drawing a point

2009-05-28 Thread Mojtaba Fathi

Hi all
Accept my apology for such a simple question. I want to display two coincident 
points at (0,0,0). I use code like this:

int main()
{
    osgViewer::Viewer viewer;

    osg::ref_ptr root (new osg::Group);
    osg::ref_ptr geode (new osg::Geode());
    osg::ref_ptr geometry (new osg::Geometry());

    osg::ref_ptr vertices (new osg::Vec3Array());

    vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
    vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));

    geometry->setVertexArray (vertices.get());

    geometry->addPrimitiveSet(new 
osg::DrawArrays(osg::PrimitiveSet::POINTS,0,vertices->size()));

    osg::Point *point=new osg::Point;
    point->setSize(4);
    root->getOrCreateStateSet()->setAttribute(point);

    geode->addDrawable (geometry.get());
    root->addChild(geode.get());
    viewer.setSceneData( root.get() );

    return (viewer.run());
}

But it displays nothing. I think it relates to BoundingBox and culling, so what 
should I do to display two coincident points at (0,0,0)? And how to do it for 
just one point?

Regards, Moji




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


Re: [osg-users] Drawing a point

2009-05-28 Thread Paul Martz
You are correct that it has something to do with BoundingBox. The
BoundingBox around a single point (or two coincident points, in this case)
has zero volume, so either the CullVisitor is discarding it, or the auto
compute of near far is computing two coincident planes and everything is
clipped. Either way, you see nothing.
 
For a solution, grep the source for setInitialBound.
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com  
+1 303 859 9466
 

  _  

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Mojtaba
Fathi
Sent: Thursday, May 28, 2009 4:04 PM
To: OpenSceneGraph Users
Subject: [osg-users] Drawing a point



Hi all
Accept my apology for such a simple question. I want to display two
coincident points at (0,0,0). I use code like this:

int main()
{
osgViewer::Viewer viewer;

osg::ref_ptr root (new osg::Group);
osg::ref_ptr geode (new osg::Geode());
osg::ref_ptr geometry (new osg::Geometry());

osg::ref_ptr vertices (new osg::Vec3Array());

vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));

geometry->setVertexArray (vertices.get());

geometry->addPrimitiveSet(new
osg::DrawArrays(osg::PrimitiveSet::POINTS,0,vertices->size()));

osg::Point *point=new osg::Point;
point->setSize(4);
root->getOrCreateStateSet()->setAttribute(point);

geode->addDrawable (geometry.get());
root->addChild(geode.get());
viewer.setSceneData( root.get() );

return (viewer.run());
}

But it displays nothing. I think it relates to BoundingBox and culling, so
what should I do to display two coincident points at (0,0,0)? And how to do
it for just one point?

Regards, Moji



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


[osg-users] Can I change the plugin directory structure?

2009-05-28 Thread rpingry
Hello All,

I have noticed that for the past little while the plugins are compiled to
their own directory with the version number.  I am not quite sure why this
is beneficial, it seems like you would always want the plugins compiled with
the version of OSG you have compiled, and it seems that having them in the
same folder with the other binaries ensures that the proper dll's will be
found.  I know when I try to run any of the example projects from Visual
Studio, that it always complains about the plugins not being there until I
copy them all over to the bin directory where the other binaries are.
Perhaps I am doing something wrong and I am missing some really cool feature
related to having them in their own version labeld directory?

I have several versions of OSG on my machine, for different projects, and I
want to avoid the DLL hell that might arise from having an environment
variable or whatever telling me where they go.  Right now I have a bat file
that copies all the files to the same directory as my project, and I have to
make sure I remember to change that whenever the plugin version number
changes.  Is there a way to tell CMake to just put all the binaries in the
same directory?

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


Re: [osg-users] Can I change the plugin directory structure?

2009-05-28 Thread Jean-Sébastien Guay

Hello Rick,

I have noticed that for the past little while the plugins are compiled 
to their own directory with the version number.  I am not quite sure why 
this is beneficial, it seems like you would always want the plugins 
compiled with the version of OSG you have compiled, and it seems that 
having them in the same folder with the other binaries ensures that the 
proper dll's will be found.


Well, copying the plugins into the same directory as your application 
ensures that *some* *version* of the plugin will be found, not 
necessarily the right one (unless you're extra careful).


There have been enough cases in the past of people only updating the 
main OSG DLLs, omitting to also update the plugins, and then running 
into an application crash (because of ABI changes between versions) that 
motivated Robert to do something better. Using the osgPlugins-VERSION 
subdirectory ensures that OSG will find the *right* *version* of the 
plugins. Since OSG (specifically osgDB::Registry) knows its own version, 
it can look in the right directory for the plugins.


> I know when I try to run any of the example
projects from Visual Studio, that it always complains about the plugins 
not being there until I copy them all over to the bin directory where 
the other binaries are.  Perhaps I am doing something wrong and I am 
missing some really cool feature related to having them in their own 
version labeld directory?


Yep, they're not meant to be in the same directory as the main OSG DLLs, 
they're meant to be in the osgPlugins-VERSION directory under that. 
Running the INSTALL target from Visual Studio will give you that 
automatically.


Being able to run an example directly from Visual Studio (using Set As 
Active Project and pressing F5) is another issue. You need to first run 
at least the ALL_BUILD target, so that all plugins will be built. That's 
because none of the OSG DLLs or examples have the plugins as 
dependencies, as it should be - the plugins are dynamically loaded, and 
as such no executable can know /a/ /priori/ which plugins it will need, 
it all depends on what is loaded either from the command line or the code.


Once you've run the ALL_BUILD target (or INSTALL, which depends on 
ALL_BUILD) then the examples will find the plugins just fine, you can 
run them with F5 no problem.


I have several versions of OSG on my machine, for different projects, 
and I want to avoid the DLL hell that might arise from having an 
environment variable or whatever telling me where they go.


Then just copy the right version of the OSG DLLs into your app's bin 
directory (with its executable) and the osgPlugins-VERSION directory 
there too (with the plugins inside the directory).


...somepath/bin/myapp.exe
...somepath/bin/osg.dll
...somepath/bin/
...somepath/bin/osgPlugins-x.y.z/osgdb_freetype.dll
...somepath/bin/osgPlugins-x.y.z/

Is there a way to tell CMake to just put 
all the binaries in the same directory?


Yes, it's called the INSTALL target. Just set your CMAKE_INSTALL_PREFIX 
to some directory where you want the latest OSG binaries+libs+headers to 
be placed, generate the project files, and run the INSTALL target from 
the Visual Studio solution. Same goes for Unix - set 
CMAKE_INSTALL_PREFIX, generate the makefiles, and run 'make install'.


Incidentally, this has been discussed a lot in the past, so searching 
the archives would have turned up all this info, but perhaps in a more 
fragmented fashion (across many posts), so I thought I'd sum it all up 
as direct replies to your questions. It's also discussed in the Platform 
Specifics/Visual Studio page on the Wiki (see the last section, called 
"Important note about plugins").


http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   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] Can I change the plugin directory structure?

2009-05-28 Thread Paul Martz
> Incidentally, this has been discussed a lot in the past, so searching the
> archives would have turned up all this info

You don't have to be on this list very long to see the same question pop up
multiple times. I'm guilty of it myself. :-)
   -Paul

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


Re: [osg-users] Can I change the plugin directory structure?

2009-05-28 Thread Jean-Sébastien Guay

Hi Paul,


You don't have to be on this list very long to see the same question pop up
multiple times. I'm guilty of it myself. :-)


Sure, but I prefer to remind people that the archives exist, while at 
the same time giving answers to their questions, rather than "let it 
slide". I figure it's more polite than just saying "go search the 
archives" (in my best old geezer voice, eh Gordon ;-) ), but at the same 
time, next time they have a question they might do a quick search first.


Plus the people who just use the forum might search that, not knowing 
that not all the mailing list history was imported. It's better to 
search the mailing list archives directly.


Hope that clears up my motives...

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   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] Can I change the plugin directory structure?

2009-05-28 Thread James Killian
"
Then just copy the right version of the OSG DLLs into your app's bin 
directory (with its executable) and the osgPlugins-VERSION directory 
there too (with the plugins inside the directory).

..somepath/bin/myapp.exe
..somepath/bin/osg.dll
..somepath/bin/
..somepath/bin/osgPlugins-x.y.z/osgdb_freetype.dll
..somepath/bin/osgPlugins-x.y.z/
"

I should review the code as I suspect it uses relative paths to retrieve the 
plugins.  If so, there should be a clause that client code must not dominate 
the CWD as ours currently does.  One thing I know for sure is that this path 
setup does not work right with our game in its current state.  Thanks for 
taking the time out to explain.  Hopefully we may find a better solution.



James Killian
  - Original Message - 
  From: Jean-Sébastien Guay 
  To: OpenSceneGraph Users 
  Sent: Thursday, May 28, 2009 8:07 PM
  Subject: Re: [osg-users] Can I change the plugin directory structure?


  Hello Rick,

  > I have noticed that for the past little while the plugins are compiled 
  > to their own directory with the version number.  I am not quite sure why 
  > this is beneficial, it seems like you would always want the plugins 
  > compiled with the version of OSG you have compiled, and it seems that 
  > having them in the same folder with the other binaries ensures that the 
  > proper dll's will be found.

  Well, copying the plugins into the same directory as your application 
  ensures that *some* *version* of the plugin will be found, not 
  necessarily the right one (unless you're extra careful).

  There have been enough cases in the past of people only updating the 
  main OSG DLLs, omitting to also update the plugins, and then running 
  into an application crash (because of ABI changes between versions) that 
  motivated Robert to do something better. Using the osgPlugins-VERSION 
  subdirectory ensures that OSG will find the *right* *version* of the 
  plugins. Since OSG (specifically osgDB::Registry) knows its own version, 
  it can look in the right directory for the plugins.

   > I know when I try to run any of the example
  > projects from Visual Studio, that it always complains about the plugins 
  > not being there until I copy them all over to the bin directory where 
  > the other binaries are.  Perhaps I am doing something wrong and I am 
  > missing some really cool feature related to having them in their own 
  > version labeld directory?

  Yep, they're not meant to be in the same directory as the main OSG DLLs, 
  they're meant to be in the osgPlugins-VERSION directory under that. 
  Running the INSTALL target from Visual Studio will give you that 
  automatically.

  Being able to run an example directly from Visual Studio (using Set As 
  Active Project and pressing F5) is another issue. You need to first run 
  at least the ALL_BUILD target, so that all plugins will be built. That's 
  because none of the OSG DLLs or examples have the plugins as 
  dependencies, as it should be - the plugins are dynamically loaded, and 
  as such no executable can know /a/ /priori/ which plugins it will need, 
  it all depends on what is loaded either from the command line or the code.

  Once you've run the ALL_BUILD target (or INSTALL, which depends on 
  ALL_BUILD) then the examples will find the plugins just fine, you can 
  run them with F5 no problem.

  > I have several versions of OSG on my machine, for different projects, 
  > and I want to avoid the DLL hell that might arise from having an 
  > environment variable or whatever telling me where they go.

  Then just copy the right version of the OSG DLLs into your app's bin 
  directory (with its executable) and the osgPlugins-VERSION directory 
  there too (with the plugins inside the directory).

  ...somepath/bin/myapp.exe
  ...somepath/bin/osg.dll
  ...somepath/bin/
  ...somepath/bin/osgPlugins-x.y.z/osgdb_freetype.dll
  ...somepath/bin/osgPlugins-x.y.z/

  > Is there a way to tell CMake to just put 
  > all the binaries in the same directory?

  Yes, it's called the INSTALL target. Just set your CMAKE_INSTALL_PREFIX 
  to some directory where you want the latest OSG binaries+libs+headers to 
  be placed, generate the project files, and run the INSTALL target from 
  the Visual Studio solution. Same goes for Unix - set 
  CMAKE_INSTALL_PREFIX, generate the makefiles, and run 'make install'.

  Incidentally, this has been discussed a lot in the past, so searching 
  the archives would have turned up all this info, but perhaps in a more 
  fragmented fashion (across many posts), so I thought I'd sum it all up 
  as direct replies to your questions. It's also discussed in the Platform 
  Specifics/Visual Studio page on the Wiki (see the last section, called 
  "Important note about plugins").

  
http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio

  Hope this helps,

  J-S
  -- 
  __
  Jean-Sebastien Guay 

Re: [osg-users] Can I change the plugin directory structure?

2009-05-28 Thread Jean-Sébastien Guay

Hi James,

Again with the black background and black text in your message... very 
hard to read. I thought you'd fixed this? :-)


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   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] Drawing a line once( bullet physics integration )

2009-05-28 Thread Stephan Huber
Hi Edurardo,

Eduardo Alberto Hernández Muñoz schrieb:

> I'm trying to integrate bullet with osg; the problem comes with
> bullet's debug drawing.
> 
> Bullet has an abstract class, with drawing functions to be implemented
> by the user.
> The main requirement is simply to render a line; however I need to
> draw a single frame,
> not add a model to a scene to be drawn over and over.

I've done this via a single geometry-instance, where I add the lines
(add the vertices and colors to their respecting arrays, updating the
primitivesets und dirty the displaylist & bound, setting the nodemas to
0x), and which I clear via an update callback every frame, and
setting the nodemask to 0x0.

Perhaps not the fastest performance-wise, but it's only used for
debugging-purposes.


HTH,
Stephan


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


Re: [osg-users] add/remove camera crash

2009-05-28 Thread Robert Osfield
Hi Guy,

You don't say where you are adding your HUD camera's - to the graphics
window, to the viewer as a slave/separate view or embedded in the
scene graph.  For the first two examples setting the data variance to
dynamic won't be sufficient as it's a high level objects that is being
removed - and as J-S suggested the thing to do is stop threading,
remove the cameras, then start the threading again.

Robert.

On Wed, May 27, 2009 at 10:49 PM, Guy Volckaert
 wrote:
> Hi,
>
> I integrated an overlays system into my code that essentially supports 
> multiple overlays, each having multiple hud items. Each overlay uses an 
> osg::Camera at its root. All this works very well, with the exception of the 
> following issue: when I remove the overlay (i.e the root camera) from the  
> scene, I get a draw crash (this does not happen all the time, but very often)
>
> I made sure that the root of the scene (i.e Group node) has the data variance 
> set to DYNAMIC.
>
> Here is the overlay camera constructor code:
>
>
> Code:
>
>    setDataVariance( osg::Camera::DYNAMIC);
>    setReferenceFrame( osg::Transform::ABSOLUTE_RF );
>    setProjectionMatrix( osg::Matrix::ortho2D( -1, 1, -1, 1 ) );
>    setViewMatrix( osg::Matrix::identity () );
>    setClearMask( 0 );
>    setRenderOrder( osg::Camera::POST_RENDER );
>    // we don't want the camera to grab event focus from the viewers main 
> camera(s).
>    setAllowEventFocus(false);
>
>    osg::StateSet* pStateSet = getOrCreateStateSet( );
>    pStateSet->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
>    pStateSet->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
>    pStateSet->setMode( GL_FOG, osg::StateAttribute::OFF );
>    pStateSet->setMode( GL_CULL_FACE, osg::StateAttribute::OFF );
>    pStateSet->setMode( GL_BLEND, osg::StateAttribute::OFF );
>
>
>
>
> Cheers,
> Guy
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=13067#13067
>
>
>
>
>
> ___
> 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] crash when closing an "embeddedWindow" viewer with a shader example

2009-05-28 Thread Jonas Walti
Hi,
I'm develping an application which does render the osgviewers output with the 
equalizer (parallel rendering) framework. 

I use

Code:
_window = viewer->setUpViewerAsEmbeddedInWindow(x,y,w,h);


to set up the viewer as embedded window and render the frame with 
viewer->frame();

I managed to load the common .osg file examples. Most of them work like charm 
but when I try to close the application with the glsl_simple.osg example, the 
app crashes when trying to execute _glDeleteProgram(program); in the function 
void GL2Extensions::glDeleteProgram(GLuint program) const in file 
GL2Extensions.cpp on line 662.

What could there be wrong?

I'm using the osg release 2.8 on windows.

Cheers,
Jonas

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





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


Re: [osg-users] add/remove camera crash

2009-05-28 Thread Mathias Fröhlich

Hi,

On Thursday 28 May 2009, Robert Osfield wrote:
> You don't say where you are adding your HUD camera's - to the graphics
> window, to the viewer as a slave/separate view or embedded in the
> scene graph.  For the first two examples setting the data variance to
> dynamic won't be sufficient as it's a high level objects that is being
> removed - and as J-S suggested the thing to do is stop threading,
> remove the cameras, then start the threading again.
That happens due to the RenderStage having a Camera pointer that might 
accessing that camera when it is already deleted.
Sure stop threading helps. But I think that this should work without stopping 
rendering.
I think of a use case where we have pre render cameras to render some texture 
that is mapped on a regular model that is loaded/deleted using the database 
pager. Such a model should be able to show up and vanish on the fly without 
the need to stop threading and restart that with an extra chance to miss some 
frames.

Currently debugging this because of more or less the same problem I observed 
with pre render cameras instead of post render ...

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


[osg-users] FBOs, MRTs, postprocessing, multi-pass, GLSL-Shader

2009-05-28 Thread Daniel Wirz
Hi,

I'm a newbie on OpenSceneGraph. I have written an OpenGL program which do 
computations in screen space. In my program, frame buffer objects (FBOs) with 
multiple render targets (MRTs) are used.

My code looks like:

first pass:
render scene:
- use GLSL shaders
- write data to FBOs' attached texures
second pass:
- use GLSL shaders
- wirte data to FBOs' attached textures using textures from 
first pass
third pass:
- use GLSL shaders
- wirte data to FBOs' attached textures using textures from 
previous passes

last pass:
- use GLSL shaders
- render to the textured screen filling quad

I would like write this program with OSG. Can anybody give me ideas how to do 
this? What kind of parts from OSG may I use. What will the scene graph look 
like? 

Thank you!

Cheers,
E.W.

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





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


Re: [osg-users] FBOs, MRTs, postprocessing, multi-pass, GLSL-Shader

2009-05-28 Thread J.P. Delport

Hi,

have a look at the osgstereomatch example, there multipass and MRT are 
used together. Also have a look at osgPPU and osgCompute which are 
external to OSG.


For simple flip-flop FBO use you can look at osggameoflife

jp

Daniel Wirz wrote:

Hi,

I'm a newbie on OpenSceneGraph. I have written an OpenGL program which do 
computations in screen space. In my program, frame buffer objects (FBOs) with 
multiple render targets (MRTs) are used.

My code looks like:

first pass:
render scene:
- use GLSL shaders
- write data to FBOs' attached texures
second pass:
- use GLSL shaders
- wirte data to FBOs' attached textures using textures from 
first pass
third pass:
- use GLSL shaders
- wirte data to FBOs' attached textures using textures from 
previous passes

last pass:
- use GLSL shaders
- render to the textured screen filling quad

I would like write this program with OSG. Can anybody give me ideas how to do this? What kind of parts from OSG may I use. What will the scene graph look like? 


Thank you!

Cheers,
E.W.

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





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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] crash when closing an "embeddedWindow" viewer with a shader example

2009-05-28 Thread Robert Osfield
Hi Jonas,

It sounds like the OSG is doing clean up of the OpenGL context after
you've deleted the graphics context or release that context from the
thread that is doing the cleanup.  I'm not familiar with the nut and
bolts of equalizer to can't comment on specifics, clearly you'll need
to take care when integrating with equalize w.r.t how the viewer gets
cleaned up.

Robert.

On Thu, May 28, 2009 at 10:54 AM, Jonas Walti  wrote:
> Hi,
> I'm develping an application which does render the osgviewers output with the 
> equalizer (parallel rendering) framework.
>
> I use
>
> Code:
> _window = viewer->setUpViewerAsEmbeddedInWindow(x,y,w,h);
>
>
> to set up the viewer as embedded window and render the frame with 
> viewer->frame();
>
> I managed to load the common .osg file examples. Most of them work like charm 
> but when I try to close the application with the glsl_simple.osg example, the 
> app crashes when trying to execute _glDeleteProgram(program); in the function 
> void GL2Extensions::glDeleteProgram(GLuint program) const in file 
> GL2Extensions.cpp on line 662.
>
> What could there be wrong?
>
> I'm using the osg release 2.8 on windows.
>
> Cheers,
> Jonas
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=13076#13076
>
>
>
>
>
> ___
> 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] crash when closing an "embeddedWindow" viewer with a shader example

2009-05-28 Thread Christian Buchner
Depending on what graphics card you use, there could also be a driver problem.
I've had a lot of trouble with the Intel integrated graphics drivers
(945GM) on cleanup
of my application.

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


[osg-users] Constrain primitiveset type using osgconv

2009-05-28 Thread Maxime BOUCHER
Hi,


 I wonder:
While using osgconv (for example on a .dae to .osg) is it possible to restrain 
the type of the PrimitiveSet ?

Thank you!

Cheers,
Maxime

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





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


Re: [osg-users] Attack the PrimitiveSet

2009-05-28 Thread Maxime BOUCHER
Hi,


For anyone who would read this thread an d reproduce the same, don't.
It seems the DrawArrayLengths contains a single number representing in a way I 
don't understand the primitives EVEN IF you can access the primitives the same 
way than for a DrawElementsUthing.


Maxime

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





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


Re: [osg-users] Attack the PrimitiveSet

2009-05-28 Thread Paul Melis

Hi,

Maxime BOUCHER wrote:

For anyone who would read this thread an d reproduce the same, don't.
It seems the DrawArrayLengths contains a single number representing in a way I 
don't understand the primitives EVEN IF you can access the primitives the same 
way than for a DrawElementsUthing.
  
It's not that hard to understand. Take, for example, the cow.osg sample 
file (check the file in a text editor). There's a Geometry node in there 
with 1 primitive set, which is a DrawArrayLengths. The type of this 
primitive set is TRIANGLE_STRIP, so it defines multiple triangle strips. 
The numbers (3, 3, 10, 14, 5, 5) represent the number of vertices 
user *per triangle strip*. So the DrawArrayLengths defines a triangle 
strip of 3 vertices (i.e. a single triangle), and then another strip of 
3 vertices, etc. The vertices are simply used in order from the vertex 
array. So the first triangle strip is defined with vertices 0, 1 and 2; 
the second triangle strip by vertices 3, 4 and 5, etc.

In total, the DrawArrayLengths primitive set defines 984 triangle strips.

   Geometry {
 DataVariance DYNAMIC
 [...]
 useDisplayList TRUE
 Primitives 1
 {
   DrawArrayLengths TRIANGLE_STRIP 0 984
   {
 3
 3
 
 10
 14
 5
 5
   }
 }
 VertexArray 7772
 {
   4.76334 -1.36791 3.02949
   4.85496 -1.36297 3.09889
   4.73514 -1.38955 3.08412
   4.92619 0.143477 2.29847
   4.98236 0.0975301 2.31196
   4.94471 0.136714 2.27932
   ...
}

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


Re: [osg-users] Attack the PrimitiveSet

2009-05-28 Thread Maxime BOUCHER
You're right, it 's not that hard.
Actually, indices are stored in a "VertexIndices IntArray".
Whereas they are directly stored in the PrimitiveSet for a DrawElement.

If someone knows why there are these several types for PrimitiveSets, and 
especially this difference between DrawArrayLengths and DrawElementUthing, I 
would be very very pleased to know (for culture).


Thanks


Max

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





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


Re: [osg-users] Attack the PrimitiveSet

2009-05-28 Thread Jason Daly

Maxime BOUCHER wrote:

You're right, it 's not that hard.
Actually, indices are stored in a "VertexIndices IntArray".
Whereas they are directly stored in the PrimitiveSet for a DrawElement.

If someone knows why there are these several types for PrimitiveSets, and 
especially this difference between DrawArrayLengths and DrawElementUthing, I 
would be very very pleased to know (for culture).
  


DrawArrays is for non-indexed rendering.  Each element of each vertex 
attribute array (vertices, normals, colors, texture coords) is used in 
order (0,1,2,...).


DrawArrayLengths is for non-indexed rendering of variable-length 
primitives (line strips, line loops, triangle strips, triangle fans, 
quad strips, and polygons).  In addition to the attribute arrays, there 
is a "lengths" array specified that determines how long each primitive 
will be.


DrawElementsUByte, DrawElementsUShort, and DrawElementsUInt are for 
indexed rendering.  Instead of using the vertex attribute arrays in 
order (0,1,2,...), the DrawElements* primitive set includes an index 
array that specifies which element of each array should be used for each 
vertex in the primitive.  The main use for this is in dense meshes, 
where any given vertex is shared among several primitives.


If you want to understand these better look up glDrawArrays() and 
glDrawElements() in the OpenGL Red Book.  Note that 
osg::DrawArrayLengths is just a convenience layer on top of glDrawArrays().


Also, don't confuse the indexed rendering aspect of the DrawElements 
primitive sets with index arrays.  The index arrays (set by 
setVertexIndices(), setNormalIndices(), etc) should not be used in most 
cases, as they force OSG to drop down to immediate mode rendering (using 
glBegin() and glEnd()), which is much slower than the above methods.


--"J"

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


Re: [osg-users] crash when closing an "embeddedWindow" viewer with a shader example

2009-05-28 Thread Jonas Walti
First, thank you for your fast answer...

@robert: This is what I also supposed. When I took once again a look at your 
osgviewerGLUT demo I figured out that this demo closes the viewer with 

Code:
if (viewer.valid()) viewer=0;



I did the same in my example and now everything works fine. But is this a 
proper way to close an embedded window viewer? 

@Christian
This shouldn't be the problem because I use an nvidia card and the common 
shader demos work fine.

So, my problem is solved now, but maybe someone could tell me, if there are 
some more steps to properly close an embedded viewer?

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





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


Re: [osg-users] crash when closing an "embeddedWindow" viewer with a shader example

2009-05-28 Thread Robert Osfield
On Thu, May 28, 2009 at 4:00 PM, Jonas Walti  wrote:
> First, thank you for your fast answer...
>
> @robert: This is what I also supposed. When I took once again a look at your 
> osgviewerGLUT demo I figured out that this demo closes the viewer with
>
> Code:
> if (viewer.valid()) viewer=0;
>
>
>
> I did the same in my example and now everything works fine. But is this a 
> proper way to close an embedded window viewer?

It's probably the safest way to do it - explictly cleanup the viewer
before the graphics context goes out of scope.

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


[osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi,

I wonder osg::ref_ptr<> is used anymore for automatic memory management. I 
remember sometime ago I got an error from mishandling multiple inheritance, the 
error printed on the screen was that the reference count of a node is some 
non-sense number when the destructor of the node executes (some shared parent 
higher up got deallocated twice). 
Since I did not use osg::ref_ptr<> in that code and it looks like reference 
count is kept somewhere in the node. My question is that if automatic memory 
management is used even without osg::ref_ptr<>.

Thank you!

Cheers,
Rabbi

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





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


Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jason Daly

Rabbi Robinson wrote:

Since I did not use osg::ref_ptr<> in that code and it looks like reference count is 
kept somewhere in the node. My question is that if automatic memory management is used even 
without osg::ref_ptr<>.
  


Short answer is yes.

The longer explanation is that almost all OSG classes inherit from 
osg::Referenced, which is where the reference count is maintained.  
osg::ref_ptr<> provides a convenient way to maintain a reference to one 
of these objects.


You could manually call the ref() and unref() methods from 
osg::Referenced instead, but this is a bit more error-prone than just 
using osg::ref_ptr<>


--"J"

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


Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi,

Thanks, that explains it. Correct me if I am wrong. So to use it, just create 
osg::ref_ptr<> and use it as regular pointer and the memory will be managed by 
osg::ref_ptr<>.

In a simple case, I careate Node* node = osg::ref_ptr and, call void* 
ptr = node. I suppose the reference count in node will be incremented 
If later I call, ptr = NULL, it doesn't seem that there is anyway to tell node 
to decrement the reference count in node. Can someone clarify how 
osg::ref_ptr<> behave in this case?

Thank you!

Cheers,
Rabbi

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





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


Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jolley, Thomas P
Hi Rabbi,

Read this article:
http://andesengineering.com/OSG_ProducerArticles/RefPointers/RefPointers
.html 

> -Original Message-
> From: Rabbi Robinson [mailto:longa...@gmail.com] 
> Sent: Thursday, May 28, 2009 11:10 AM
> To: osg-users@lists.openscenegraph.org
> Subject: Re: [osg-users] osg::ref_ptr<> used anymore
> 
> Hi,
> 
> Thanks, that explains it. Correct me if I am wrong. So to use 
> it, just create osg::ref_ptr<> and use it as regular pointer 
> and the memory will be managed by osg::ref_ptr<>.
> 
> In a simple case, I careate Node* node = osg::ref_ptr Node> and, call void* ptr = node. I suppose the reference 
> count in node will be incremented If later I call, ptr = 
> NULL, it doesn't seem that there is anyway to tell node to 
> decrement the reference count in node. Can someone clarify 
> how osg::ref_ptr<> behave in this case?
> 
> Thank you!
> 
> Cheers,
> Rabbi
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=13108#13108
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org
> 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi,
Sorry, 404

Thank you!

Cheers,
Rabbi

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





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


Re: [osg-users] osg-users Digest, Vol 23, Issue 104

2009-05-28 Thread Eduardo Alberto Hernández Muñoz
Thanks for both replies, it sounds like Stephan's approach will work just dandy.

-Coz

> I've done this via a single geometry-instance, where I add the lines
> (add the vertices and colors to their respecting arrays, updating the
> primitivesets und dirty the displaylist & bound, setting the nodemas to
> 0x), and which I clear via an update callback every frame, and
> setting the nodemask to 0x0.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jolley, Thomas P
Hi Rabbi,

The URL wrapped around to the next line.  Use the full URL. 

> -Original Message-
> From: Rabbi Robinson [mailto:longa...@gmail.com] 
> Sent: Thursday, May 28, 2009 11:20 AM
> To: osg-users@lists.openscenegraph.org
> Subject: Re: [osg-users] osg::ref_ptr<> used anymore
> 
> Hi,
> Sorry, 404
> 
> Thank you!
> 
> Cheers,
> Rabbi
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=13110#13110
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
> negraph.org
> 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Paul Martz
I think you'd benefit from looking at some OSG examples (all of which use
ref_ptr) and reading the memory management section in the OSG Quick Start
Guide (http://stores.lulu.com/pmartz).

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


[osg-users] Multiple animations

2009-05-28 Thread Christopher Back
Hi,

I have put together a series of animations as separate activities for
training purposes. I need to somehow combine then into one application, the
load time is too long for me to be able to demonstrate them in a
professional manner otherwise. I am using osg 2.2 and I have not been able
to stop and start the animations using the keyboard and I was wondering if
anyone has been able to manage it. I am not the most experienced programmer
but if someone could  provide some guidance I would really appreciate it.

Thanks,

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


[osg-users] MFC or Win32 based viewer

2009-05-28 Thread Clay, Bruce
I have tried all of the ones except for osgWin32Demo (the link is
nonresponsive) in the windowing Toolkit section and can not get them to
compile with the current version of OSG for various reasons.  One uses a
CameraManipulator which doe4s not seem to be in the current build.
Another is looking for getOrCreateDatabasePager in registry.

 

 

Does anyone have basic viewer code that works with a MFC or Win32
framework? 

 

Bruce

 

 

 




This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this 
 
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multiple animations

2009-05-28 Thread Paul Martz
If you've written your application correctly, your animations are controlled
by the FrameStanp simulation time. You specify the current simulation time
as a parameter to osgViewer::Viewer::frame(). So, if you want the animation
to "stop", you just pass in the same value for each frame.
 
This works for AnimationPath, the osgParticle NodeKit, Sequence nodes, etc.,
just about anything in OSG that is animated.
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com  
+1 303 859 9466
 

  _  

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Christopher
Back
Sent: Thursday, May 28, 2009 10:44 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Multiple animations


Hi,

I have put together a series of animations as separate activities for
training purposes. I need to somehow combine then into one application, the
load time is too long for me to be able to demonstrate them in a
professional manner otherwise. I am using osg 2.2 and I have not been able
to stop and start the animations using the keyboard and I was wondering if
anyone has been able to manage it. I am not the most experienced programmer
but if someone could  provide some guidance I would really appreciate it.

Thanks,

Christopher Back

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


Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jason Daly

Rabbi Robinson wrote:

Hi,

Thanks, that explains it. Correct me if I am wrong. So to use it, just create 
osg::ref_ptr<> and use it as regular pointer and the memory will be managed by 
osg::ref_ptr<>.

In a simple case, I careate Node* node = osg::ref_ptr and, call void* ptr = node. I suppose the reference count in node will be incremented 
  


Actually, it's like this:

osg::ref_ptr  node;
node = new osg::Node();


If later I call, ptr = NULL, it doesn't seem that there is anyway to tell node to decrement the reference count in node. 


This will decrement the reference count in node.  If the reference count 
goes to zero, it will be deleted.




Can someone clarify how osg::ref_ptr<> behave in this case?
  


Look at the operator= method in osg::ref_ptr

I'd also recommend looking at the ref_ptr tutorial that others have 
mentioned.


--"J"

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


[osg-users] osgGlut does not build

2009-05-28 Thread Clay, Bruce
I can not get the osgGlut viewer to build either.  The error list is
attached below.  I am using Visual Studio 2005 and compiling against OSG
2.8.1, OpenThreads and Producer both pulled with svn today.

 

Several of the errors in this list come from STL

 

 

Any thoughts?

 

Bruce

 

 

 

Error 1  error C2039: 'getPrims' : is not a member of
'osgUtil::RenderStage'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp626   

Error 2  error C2039: 'getPrims' : is not a member of
'osgUtil::RenderStage'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp647   

Error 3  error C2039: 'setTextureModeToInherit' : is not a
member of 'osg::StateSet'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1122 

Error 4  error C2679: binary '<<' : no operator found which
takes a right-hand operand of type 'osg::LineSegment::vec_type' (or
there is no acceptable conversion)
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1271 

Error 5  error C2679: binary '<<' : no operator found which
takes a right-hand operand of type 'osg::Vec3' (or there is no
acceptable conversion)   

 

f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1294 

Error 6  error C2679: binary '<<' : no operator found which
takes a right-hand operand of type 'osg::Vec3' (or there is no
acceptable conversion)
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1301 

Error 7  error C2248:
'osg::AnimationPath::ControlPoint::_position' : cannot access protected
member declared in class 'osg::AnimationPath::ControlPoint'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1370 

Error 8  error C2679: binary '<<' : no operator found which
takes a right-hand operand of type 'const osg::Vec3d' (or there is no
acceptable conversion)
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1370 

Error 9  error C2248:
'osg::AnimationPath::ControlPoint::_rotation' : cannot access protected
member declared in class 'osg::AnimationPath::ControlPoint'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1370 

Error 10 error C3083: 'PrimtiveValueMap': the symbol to the
left of a '::' must be a type
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1769 

Error 11 error C2039: 'iterator' : is not a member of
'osgUtil::Statistics'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1769 

Error 12 error C2133: 'pItr' : unknown size
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1769 

Error 13 error C2512: 'std::iterator' : no appropriate
default constructor available
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1769 

Error 14 error C2582: 'operator =' function is unavailable
in 'std::iterator'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1770 

Error 15 error C2678: binary '!=' : no operator found which
takes a left-hand operand of type 'std::iterator' (or there is no
acceptable conversion)
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1771 

Error 16 error C2675: unary '++' : 'std::iterator' does not
define this operator or a conversion to a type acceptable to the
predefined operator
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1772 

Error 17 error C2819: type 'std::iterator' does not have an
overloaded member 'operator ->'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1774 

Error 18 error C2039: 'second' : is not a member of
'std::iterator' f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp
1774 

Error 19 error C2228: left of '.first' must have
class/struct/union
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1774 

Error 20 error C2819: type 'std::iterator' does not have an
overloaded member 'operator ->'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1775 

Error 21 error C2039: 'second' : is not a member of
'std::iterator' f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp
1775 

Error 22 error C2228: left of '.second' must have
class/struct/union  f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp
1775 

Error 23 error C2819: type 'std::iterator' does not have an
overloaded member 'operator ->'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1776 

Error 24 error C2039: 'first' : is not a member of
'std::iterator'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1776 

Error 25 error C2582: 'operator =' function is unavailable
in 'std::iterator'
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\Viewer.cpp1784 

Error 26 error C2678: binary '!=' : no operator found which
takes a left-hand operand of type 'std::iterator' (or there is no
acceptable conversion)
f:\Projects\LIDAR\osgGLUT\src\osgGLUT\View

Re: [osg-users] Hope this is the right way to post this (osgEphemeris problem with simple example)

2009-05-28 Thread Don Dakin
Hi Richard,

I have not yet come to compiling any example/sample code to check these 
features out.

I stopped at trying with the simple example when it did not work. I could try 
it with codeing it up but that would require more time. If there is no quick 
answer to this working using osgviewer then I will put this on the back burner 
and try an example with some code when I have the time to look into that.

Thanks again

Don.

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





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


[osg-users] Access vertices and faces after load the model

2009-05-28 Thread Xin Chen
Hi,
   
I'm new to OSG. I use the following code to load my model, which is 
successful.  How can I access the vertices and faces of the model? Thank you.

nNode = osgDB::readNodeFile("D:/Livingroom.3DS");





Thank you!

Cheers,
xinchen

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





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


Re: [osg-users] Drawing a line once( bullet physics integration )

2009-05-28 Thread Paul Martz
I've implemented an OSG-based subclass of btDebugDraw. This is part of a
larger osgBullet library I'm developing that will aid in developing
applications that use both Bullet and OSG. I know this doesn't help you now,
but it will be open sourced in the future.

When I get a drawLine call, I just push the endpoints onto an OSG Vec3Array
(and colors onto a Vec4Array). The arrays are already attached to a Geometry
I created in the class constructor.

When I get an EndDraw call, I add PrimitiveSets to draw all the data. When I
get a BeginDraw call, I remove the PrimitiveSets and clear the arrays. The
app main loop looks like:
  while( !viewer.done() ) {
debug->BeginDraw();
dynamicsWorld->stepSimulation(...);
dynamicsWorld->debugDrawWorld();
debug->EndDraw();
viewer.frame( ... );
  }

I have the Geometry set up with display lists off (it doesn't make any sense
to create display lists that you will only use once) and I have the
DataVariance set to DYNAMIC. I also disable lighting in the StateSet.

I actually have multiple Geometry objects attached to a single Geode, one
Geometry for lines, one for contact points, and one for text. They all
operate in a similar fashion.

I think this is the most efficient way to do things. You might argue that
the array clear operation every frame and push_back for every vertex is
causing too many new/delete calls, but a well-implemented STL will maintain
and reuse its own memory pool, so I don't think that's an issue. The main
performance bottleneck is the draw time for lots of lines and points,
encountered in very complex scenes. Most consumer-grade graphics cards fall
flat on their faces when rendering points and lines.

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

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Eduardo
Alberto Hernández Muñoz
Sent: Wednesday, May 27, 2009 11:49 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Drawing a line once( bullet physics integration )

Hi all,

I'm trying to integrate bullet with osg; the problem comes with bullet's
debug drawing.

Bullet has an abstract class, with drawing functions to be implemented by
the user.
The main requirement is simply to render a line; however I need to draw a
single frame, not add a model to a scene to be drawn over and over.

The only theorical solution I have been able to come up with, is to add a
node per line before calling osgViewer:: frame(), and then delete the nodes.
Pure OpenGL code outside of the scenegraph is not an option.

-Coz
___
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] osg::ref_ptr<> used anymore

2009-05-28 Thread Ismail Pazarbasi
2009/5/28 Jason Daly :
> Rabbi Robinson wrote:
[snip]
>> If later I call, ptr = NULL, it doesn't seem that there is anyway to tell
>> node to decrement the reference count in node.
>
> This will decrement the reference count in node.  If the reference count
> goes to zero, it will be deleted.
>
> --"J"
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

Hi,

small correction, if you don't misunderstand; that will not decrease
reference count, since ptr is void* and has no connection whatsoever
with pointee (osg::Referenced). In following case:

osg::ref_ptr pnode = new osg::Node;
void* ptr = pnode;
ptr = NULL;
(this is what I understood)

Rabbi, once you get raw pointer from smart pointer, you take
responsibility of reference counting (and of course, C++ scoping
rules). You may pass that pointer around, but you should be careful
with reference counting and scope that osg::ref_ptr was declared.

By default, OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION is defined (as
far as I can see). This means there is an implicit conversion from
ref_ptr to T (and hence, to types has implicit conversion from T, e.g.
pointer to void) - you can pass an osg::ref_ptr to a function that
expects T* and osg::ref_ptr (even a void*) will return its raw
pointer without modifying reference count. In safe C++ programming
practice, this usually is taken dangerous, if not bad, practice; in
such cases, conversion must be explicitly expressed so that programmer
knows and takes responsibility.

After your ptr (which was declared as pointer to void) is assigned to
NULL, ptr is assigned to NULL; pnode has no knowledge whatsoever of
raw pointer you obtained after that line you perform assignment; you
might have somehow overwritten it, somehow deleted that (in our case,
it isn't possible but could well be possible). If you somehow store
returned raw pointer and try to use it beyond the scope that surrounds
pnode, you may crash your app, since object might have been deleted by
osg::ref_ptr. e.g.

class MyClass
{
  osg::Node* m_pNode;
  void foo();
  void bar();
...
};

void MyClass::foo()
{
  osg::ref_ptr pnode = new osg::Node;
  m_pNode = pNode;
}  // pnode dies here

void MyClass::bar()
{
  traverseNode(m_pNode); // expect anything but correct functionality
}

Bottom line is; use smart pointers instead of raw pointers and be
explicit about conversions. Respect scope of smart pointer, because it
can't know what you do with the raw pointer once you obtain it.

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