[osg-users] reset root color to original colors

2016-05-24 Thread Bruno Oliveira
Hello,

I have one single root node in my scene graph. I have a vertex array and a
color array. I susually use them in conjunction to see my vertices with the
original colors, with

ret->setColorArray(m_colors);
ret->setColorBinding(osg::Geometry::BIND_PER_VERTEX);


Now I am adding the option for custom shaders. This is done with
osg::Programs, and adding the program to the stateset of the root node.

osg::ref_ptr program = new osg::Program;
program->setName(m_name);
program->addShader(new osg::Shader(osg::Shader::VERTEX, m_vertex));
program->addShader(new osg::Shader(osg::Shader::FRAGMENT, m_fragment));

Now I want to reset this, and assign the original colors I have in the
color Array back again. How can I do this? Do I have to create a new shader
for applying the custom colors in the color array? Or can I reset this in a
simpler fashion?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CullVisitor object not getting properly deleted

2016-05-24 Thread Robert Osfield
Hi Rick,

After a preplexing day looking at how the osgUtiil::CullVisitor,
osg::Camera and RenderStageCache were all interacting via the
osg::Observer system I finally fixed the problem with the crash that
I've see with the osgoit and osgprerender examples.   As the crash
looks similar to what you saw there is reasonable chance that the
changes should work for you too.

I have checked my fix into master and OpenSceneGraph-3.4.

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


[osg-users] [osgPlugins] Inventor Plugin Linking Against Coin4.lib

2016-05-24 Thread Scott Shaw
Hi,

I'm trying to build OSG 3.4.0 with Coin3D on Windows 7.  I've built the CMake 
branch of Coin successfully and it created the library Coin.lib.  When building 
OSG, FindInventor.cmake successfully finds the Coin library and places it's 
path in the INVENTOR_LIBRARY CMake variable.  When linking, the build fails 
because for some reason it tries to link against a non-existent Coin4.lib.  I 
grepped the source and build folders for Coin4.lib and it only shows up in 
ConvertToInventor.obj, ConvertFromInventor.obj, and ReaderWriterIV.obj as a 
/DEFAULTLIB switch.  Is there a CMake variable I'm missing or something?

Thank you!
Scott

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





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


Re: [osg-users] CullVisitor object not getting properly deleted

2016-05-24 Thread Rick Irons
Hi Robert,

Thanks for the update.

Rick

From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Robert Osfield
Sent: Tuesday, May 24, 2016 5:11 AM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] CullVisitor object not getting properly deleted

Hi Rick,

On 23 May 2016 at 20:33, Rick Irons 
> wrote:
The code where the static cast is failing is OSG code 
(openscenegraph\src\osgUtil\CullVisitor.cpp).  I believe it is fairly recent 
code that was added just prior to the release of 3.4.0.  Here is the OSG 3.5.1 
version of the change… 
http://trac.openscenegraph.org/projects/osg/changeset/14578#file0

Thanks for pin pointing the change.  The code in question was written to 
address a bug in clean up, so it looks like it's inadvertently introduced it's 
own one.

In testing I've foind the osgoit example crashes in the same manor as you've 
found.  I'm currently looking at resolving this.
Robert.

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


Re: [osg-users] FixedFunctionTechnique, lighting, and createNormalMapTexture

2016-05-24 Thread Robert Osfield
Hi Alex,

On 24 May 2016 at 13:15, Alex Taylor  wrote:
> I can't use Multipass technique because my viewer doesn't support
> pre-cameras.

How on each have you been able to disable the OSG enough that it can't
do pre-rendering, it's built into the core, you must being doing
something pretty extreme to cut the OSG core functionality so much.

> It is my intention to use Multi-pass when I can resolve the viewer issues,
> but in the meantime, I'd appreciate some guidance on my original question.

I'm not going to spend time supporting FixedFunctionPipeline when it's
absolutely not the thing you should be using.  Fix your viewer.

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


Re: [osg-users] FixedFunctionTechnique, lighting, and createNormalMapTexture

2016-05-24 Thread Alex Taylor
Robert,

I can't use Multipass technique because my viewer doesn't support
pre-cameras.

It is my intention to use Multi-pass when I can resolve the viewer issues,
but in the meantime, I'd appreciate some guidance on my original question.

Alex
On Tue, May 24, 2016 at 6:12 AM Robert Osfield 
wrote:

> Hi Alex,
>
> The osgVolume::MultipassTechnique supports mixing geometry with the
> volume and constraining to a convex hull geometry.  This is what you
> should use instead of FixedFunctionTechnique, the only reason to use
> this now is that you've have completely hopeless hardware+drivers that
> are incapable of doing proper volume rendering.
>
> Robert.
>
> On 23 May 2016 at 22:49, Alex Taylor  wrote:
> > Hey all,
> >
> > From previous posts, I understand clearly that FixedFunctionTechnique is
> the
> > worst of the osgVolume techniques in terms of both speed and quality of
> > results.
> >
> > However, due to some specific requirements of the application I'm trying
> to
> > build (need for clipping to a bounding box, need to insert other geometry
> > into scene) and limitations in the osgViewer in my environment (no
> support
> > for pre-cameras), FixedFunctionTechnique may be something I have to
> > consider.
> >
> > I was wondering, I understand that createNormalMapTexture is to allow for
> > lighting with FixedFunctionTechnique. What does one do with the resulting
> > array of normal vectors once you call createNormalMapTexture? Is there an
> > interface somewhere to pass the normals? How would one use
> > createNormalMapTexture to implement lighting when using
> > FixedFunctionTechnique?
> >
> > - Alex
> >
> > -
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FixedFunctionTechnique, lighting, and createNormalMapTexture

2016-05-24 Thread Robert Osfield
Hi Alex,

The osgVolume::MultipassTechnique supports mixing geometry with the
volume and constraining to a convex hull geometry.  This is what you
should use instead of FixedFunctionTechnique, the only reason to use
this now is that you've have completely hopeless hardware+drivers that
are incapable of doing proper volume rendering.

Robert.

On 23 May 2016 at 22:49, Alex Taylor  wrote:
> Hey all,
>
> From previous posts, I understand clearly that FixedFunctionTechnique is the
> worst of the osgVolume techniques in terms of both speed and quality of
> results.
>
> However, due to some specific requirements of the application I'm trying to
> build (need for clipping to a bounding box, need to insert other geometry
> into scene) and limitations in the osgViewer in my environment (no support
> for pre-cameras), FixedFunctionTechnique may be something I have to
> consider.
>
> I was wondering, I understand that createNormalMapTexture is to allow for
> lighting with FixedFunctionTechnique. What does one do with the resulting
> array of normal vectors once you call createNormalMapTexture? Is there an
> interface somewhere to pass the normals? How would one use
> createNormalMapTexture to implement lighting when using
> FixedFunctionTechnique?
>
> - Alex
>
> -
>
> ___
> 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] CullVisitor object not getting properly deleted

2016-05-24 Thread Robert Osfield
Hi Rick,

On 23 May 2016 at 20:33, Rick Irons  wrote:

> The code where the static cast is failing is OSG code
> (openscenegraph\src\osgUtil\CullVisitor.cpp).  I believe it is fairly
> recent code that was added just prior to the release of 3.4.0.  Here is the
> OSG 3.5.1 version of the change…
> http://trac.openscenegraph.org/projects/osg/changeset/14578#file0
>
>
Thanks for pin pointing the change.  The code in question was written to
address a bug in clean up, so it looks like it's inadvertently introduced
it's own one.

In testing I've foind the osgoit example crashes in the same manor as
you've found.  I'm currently looking at resolving this.

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


Re: [osg-users] Multiples scenes

2016-05-24 Thread Robert Osfield
Hi Florian,

On 23 May 2016 at 20:28, Florian GOLESTIN  wrote:
> Hi Robert,
>
> The player just move to a new scene so the previous one can be discarded.
>
> By scene I wanted to mean the "root" node and all its children, and the 
> callback, keeping only the view and the camera manipulator.
> In the application, the player walk along a maze (an interior scene) and when 
> he hits a door, he's "teleported" into another level of the maze so I load a 
> new map with new walls and monsters...
>
> Have a good day!

Will you have any graphical affect during the teleport that requires
both scenes to be mixed in some way?

If you are just moving from one location to the next instantaneously
then viewer.setSceneData(newModel); will fine.

Another route is to use an osg::Switch to move between locations -
this is something that would be preferrable if you want the ability to
move back to previous scenes that you've visited.

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


Re: [osg-users] clamp mouse cursor / position

2016-05-24 Thread Sebastian Schmidt

Flogo wrote:
> Hi Sebastian,
> 
> I'm not an expert, but in my case I've my own class overloading 
> osgGA::StandardManipulator.
> In this case, while overriding the method handleMouseMove I can call 
> requestWarpPointer without recusiving call handleMouseMove.
> 
> Is it what you are looking for?
> 
> Best,
> Florian


Thanks. The problem is, that i still need to call a mousemove event to update 
the position of a widget (f.e. the pin button of a scrollbar).
But with a custom StandardManipulator it might be possible to separate 
mousemove events from an event triggered by calling requestWarpPointer.

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





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