Re: [osg-users] How Camera Manipulators Work

2010-10-05 Thread Jean-Sébastien Guay

Hi Eduardo,


I think the function the original poster is looking for is, e.g.: bool
DriveManipulator::calcMovement().


Well, that method and the equivalents in other manipulators do calculate 
some parts of the final camera view matrix, but the final calculations 
are done directly inside the get{Inverse}Matrix() methods. And I think 
the OP was specifically asking how the manipulator affected the camera, 
since no part of the camera manipulator code actually ever touches any 
part of the view or camera...


So the answer is that the view calls getInverseMatrix() at each frame to 
get an updated view matrix which it will then give to the camera.


That also has another implication. If you're making a camera manipulator 
that needs to modify the projection matrix, then you need to put in some 
other mechanism in your own code to get the projection matrix that the 
manipulator would calculate to the camera. Because the only thing that 
will happen automatically when using a camera manipulator is that 
getInverseMatrix() will be called to get an updated view matrix each 
frame, nothing will be done about the projection matrix at all. I've 
always found that weird... A more general camera manipulator should have 
a mechanism to alter any relevant property of the camera, not just the 
view matrix... It could even have a pointer to the camera, which IMHO 
would have been a more straightforward and clear design, at the cost of 
higher coupling.


One example of this would be implementing a camera manipulator for 
otho2D views which would implement zooming by altering the 
left,right,top,bottom values of the frustum (or even the same principle 
for perspective views which would zoom by altering the FOV). This alters 
the projection matrix, and you'll have to get that projection matrix 
from your manipulator to the camera each frame yourself.


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] Transparent image isn't?

2010-10-05 Thread Ulrich Hertlein
Hi Philip,

On 6/10/10 6:13 , Philip Tessier wrote:
> My function, ConvertImageColorToAlphaValue, is apparently setting the alpha 
> values
> correctly.  I’ve checked Ball.rgba, using gimp, and the black corners are 
> transparent,
> as expected.  But, image doesn’t render transparently until I read it back in.
> 
> So, my first question is: What needs to change in the image to “activate”
> transparency?

Does your conversion function set the internalFormat to contain alpha?  It 
might still be
set to GL_RGB.

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


Re: [osg-users] How Camera Manipulators Work

2010-10-05 Thread Eduardo Poyart
I think the function the original poster is looking for is, e.g.: bool
DriveManipulator::calcMovement().

Eduardo


On Tue, Oct 5, 2010 at 12:00 PM, Jean-Sébastien Guay <
jean-sebastien.g...@cm-labs.com> wrote:

> Hi Tom,
>
>  [...] so that next time getMatrix() is called, the updated matrix reflects
>> the changes that were made.
>>
>
> That's almost right - getInverseMatrix() is the method that's called by the
> view(er) each frame. ;-)
>
> 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
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Box Selection Tool

2010-10-05 Thread Scott Shaw
Hi,

Does anyone have a faster method of creating a box selection tool than using 
the PolytopeIntersector?

Thanks,
Scott

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





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


Re: [osg-users] [osgPlugins] osgAnimation and TimelineAnimationManager

2010-10-05 Thread Cedric Pinson
Hi Jamie,

I have started the Timeline Animation manager with pokme project... It
worked when I used it, so I guess you can have a look to the source of
pokme http://hg.plopbyte.net/pokme

I know that this manager needs more work but I didn't have the time to
improve it... anyway if you have sample code to reproduce the problem I
will be happy to help.

For info, pokme use timeline animation manager with skinned model

Cheers,
Cedric

On Tue, 2010-10-05 at 21:32 +0200, Garrett Cope wrote:
> Hi,
> 
> I was wondering if Cedric or anyone else has gotten the 
> TimelineAnimationManager to work with skinned animations (RigGeometry - 
> hardware or software)? I am trying to port my functional 
> BasicAnimationManager implementation over to TimelineAnimationManager as 
> shown in the osgAnimationTimeline example and everything breaks. The timeline 
> seems to update fine, but the rig update is updating with all identity 
> matrices, so no change is seen.
> 
> Any ideas or examples anyone has other than osgTimelineAnimation?
> 
> 
> Thanks,
> Jamie
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=32422#32422
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

-- 
Provide OpenGL, WebGL and OpenSceneGraph services
+33 659 598 614 Cedric Pinson mailto:cedric.pin...@plopbyte.net
http://www.plopbyte.net


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Creating Image from Openflight file

2010-10-05 Thread Geoff Rhodes
Hi,

In looking into this a little bit more, it appears that it is not picking up a 
lot of the externally referenced textures and flt files. When i load the main 
FLT file, it will load in OSGViewer and show properly, but when I load it with 
my program, it seems to only load the the last referenced FLT file.

The structure of the file is this:

Main
  |
  +--+---+---+--+
 #1  #2  #3   #4  #5

Each number is translated to it's proper position in the main file


Another thing I noticed is that the FLT files are all built with the same 
origin, Meaning #1 through #5 are all built at origin 100,100 for X,Y. Not sure 
if this has anything to do with my issue, where they might be getting 
overlapped by each subsequent one when being built.

Thank you!

Cheers,
Geoff

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





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


[osg-users] Creating Image from Openflight file

2010-10-05 Thread Geoff Rhodes
Hi,

Ok, I need a small program to go through an openflight database and produce 
tile images of the database at a specified size of 2250x2250. Each pixel will 
correspond to 1ft in my database. I have an example program that I made that 
will run with a small FLT file that is less than a tile size. It will also work 
when loading  in a larger FLT file, but will only show one of the parts of the 
file, and will not show the other referenced files. Is there a setting I need 
to change inorder for it to go through the other referenced files to get it to 
work? I can open this in OSGViewer and it will load the whole image without 
issue from the references. 

I am also looking at the OSGPoster example submission, as it is similar to what 
I need to do, but can't seem to get it to function properly. 

Also, I am fairly new at OSG and graphics programming.

Thank you!

Cheers,
Geoff

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





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


[osg-users] Transparent image isn't?

2010-10-05 Thread Philip Tessier
All,

Thank you in advance.  My application needs to capture  an image (that part 
works), turn parts of it transparent (that part doesn’t), and redisplay the 
image.  I have the capture working, and, with a workaround, I have the 
transparency working.  The problem is that the workaround involves writing the 
image to a file, and reading it back.  Surely there is a better way than that.  
I’m sure that I’m missing something, probably something simple…

Here’s the main snippet:

Code:

   // I read in the bitmap, without transparency.
   ref_ptr image = osgDB::readImageFile( "Ball.bmp");

   // As expected, we do not see transparency.
   {
  ref_ptr viewer = new osgViewer::Viewer();
  viewer ->setSceneData( makeGeode( image).get());
  viewer->run();
   }

   // I convert the image to an RGBA format, if necessary, and set the 
alpha (black is transparent).
   My_OSG_Library::ConvertImageColorToAlphaValue( image);

   // But, the image is still opaque!
   {
  ref_ptr viewer = new osgViewer::Viewer();
  viewer ->setSceneData( makeGeode( image).get());
  viewer->run();
   }

   // I check the image by writing it out to an .rgba file...
   osgDB::writeImageFile( * image, "Ball.rgba");
   // Since it checks, I read it back in...
   image = osgDB::readImageFile( "Ball.rgba");

   // And, voila!  The transparency works!
   {
  ref_ptr viewer = new osgViewer::Viewer();
  viewer ->setSceneData( makeGeode( image).get());
  viewer->run();
   }



My function, ConvertImageColorToAlphaValue, is apparently setting the alpha 
values correctly.  I’ve checked Ball.rgba, using gimp, and the black corners 
are transparent, as expected.  But, image doesn’t render transparently until I 
read it back in. 

So, my first question is: What needs to change in the image to “activate” 
transparency?

My second question… If you look at my “helper” class, OSG_PixelComponent, which 
I implemented to examine color values, and set the alpha values, does get the 
job done…  I suspect that there is a better way to do this, though, and I’m 
wondering what that would be.

Thanks again,
Phil


Philip A. Tessier

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




Attachments: 
http://forum.openscenegraph.org//files/ball_142.bmp
http://forum.openscenegraph.org//files/osg_transparency_demo_405.cpp


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


[osg-users] [osgPlugins] osgAnimation and TimelineAnimationManager

2010-10-05 Thread Garrett Cope
Hi,

I was wondering if Cedric or anyone else has gotten the 
TimelineAnimationManager to work with skinned animations (RigGeometry - 
hardware or software)? I am trying to port my functional BasicAnimationManager 
implementation over to TimelineAnimationManager as shown in the 
osgAnimationTimeline example and everything breaks. The timeline seems to 
update fine, but the rig update is updating with all identity matrices, so no 
change is seen.

Any ideas or examples anyone has other than osgTimelineAnimation?


Thanks,
Jamie

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





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


Re: [osg-users] How Camera Manipulators Work

2010-10-05 Thread Jean-Sébastien Guay

Hi Tom,


[...] so that next time getMatrix() is called, the updated matrix reflects the 
changes that were made.


That's almost right - getInverseMatrix() is the method that's called by 
the view(er) each frame. ;-)


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] How Camera Manipulators Work

2010-10-05 Thread Tom Pearce
Hi Matt,

What is being manipulated is the matrix that is returned from the manipulator.  
The parameters that you've found all are used ultimately in computing the 
matrix.  Have a look at FirstPersonManipulator::getMatrix() for example - 
matrices are made from _trans and _rotate parameters and multiplied to get the 
overall matrix of the camera.  Variables like velocity are used in conjunction 
with a time step to figure out what the new _trans should be, so that next time 
getMatrix() is called, the updated matrix reflects the changes that were made.

Cheers,
Tom

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





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


Re: [osg-users] How Camera Manipulators Work

2010-10-05 Thread Jeremy Moles
On Tue, 2010-10-05 at 20:13 +0200, Matt Caron wrote:
> I'm trying to write my own camera manipulator and I'm having a difficult time 
> figuring out how the current camera manipulators work.
> 
> I have read through source code for a number of the manipulator classes 
> including FlightManipulator, FirstPersonManipulator, StandardManipulator, and 
> CameraManipulator.
> 
> I can't seem to track down the code that actually manipulates the camera.  I 
> see a bunch of instance variables being altered and GUIEventAdapters getting 
> passed off to other methods, but I just can't seem to get down far enough in 
> the code to see where the manipulation is occurring.
> 
> I think I noticed a frame() method in one of the lower level classes - is 
> this where all the data is used to compute new camera position and location?  
> If so, how does that frame() method know to use the velocity, acceleration, 
> pitch, yaw, etc that is built into subclasses like FlightManipulator?
> 
> Any clarification about how the camera manipulator class structure works 
> would be appreciated.
> 
> Additionally, I am having difficulty understanding the use of quaternions in 
> relation to the OSG coordinate system.  If someone could point me towards 
> some descriptive reference material on working in the OSG coordinate system I 
> would appreciate it.
> 
> Thanks.

If I'm not mistaken, you just need to define your own versions of the
pure virtuals in CameraManipulator(); particularly getInverseMatrix. And
remember, if you use a matrix created by Matrix::makeLookAt, that is
ALREADY inverted. :) (Cedric helped me with that...)

> Matt
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=32416#32416
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

-- 
Follow us on Twitter! http://twitter.com/emperorlinux

EmperorLinux, Inc.
http://www.emperorlinux.com
1-888-651-6686

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


[osg-users] How Camera Manipulators Work

2010-10-05 Thread Matt Caron
I'm trying to write my own camera manipulator and I'm having a difficult time 
figuring out how the current camera manipulators work.

I have read through source code for a number of the manipulator classes 
including FlightManipulator, FirstPersonManipulator, StandardManipulator, and 
CameraManipulator.

I can't seem to track down the code that actually manipulates the camera.  I 
see a bunch of instance variables being altered and GUIEventAdapters getting 
passed off to other methods, but I just can't seem to get down far enough in 
the code to see where the manipulation is occurring.

I think I noticed a frame() method in one of the lower level classes - is this 
where all the data is used to compute new camera position and location?  If so, 
how does that frame() method know to use the velocity, acceleration, pitch, 
yaw, etc that is built into subclasses like FlightManipulator?

Any clarification about how the camera manipulator class structure works would 
be appreciated.

Additionally, I am having difficulty understanding the use of quaternions in 
relation to the OSG coordinate system.  If someone could point me towards some 
descriptive reference material on working in the OSG coordinate system I would 
appreciate it.

Thanks.

Matt

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





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


Re: [osg-users] Problem Loading .FLT

2010-10-05 Thread Matt Caron
It turns out the model was just incredibly large and it took some 20 minutes to 
load on my machine - thats why I figured the "unknown record" line was an error.

Thanks.

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





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


Re: [osg-users] Problem Loading .FLT

2010-10-05 Thread Gordon Tomlinson
FYI  if I remember right the opcode 91 is a sound node

Other programs will be ignoring this node as well they are just not telling
you 



__
Gordon Tomlinson 

gor...@gordontomlinson.com IM: gordon3db...@3dscenegraph.com 
www.vis-sim.com
www.gordontomlinson.com
www.PhotographyByGordon.com

__


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matt Caron
Sent: Tuesday, October 05, 2010 5:57 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Problem Loading .FLT

Hi,

I've got an .FLT file that I need to load into OSG.  I am loading it with
the following code:


Code:

osg::Node* pLoadedModel = osgDB::readNodeFile("[mypath]/campus08-19.flt");




However when I compile and run the program I get the following error:

"Unknown record, opcode=91 size=88"

I have no idea what this means and I'm hoping someone here can explain it
and perhaps help me correct it.  I have seen this .FLT run with other
programs so it should not be corrupt or anything.

Thank you!

Cheers,
Matt

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





___
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] Problem Loading .FLT

2010-10-05 Thread Gordon Tomlinson
HI

I means that the Openflight(tm) reader has found a node/data type in the
flight file it does not know about and is simple going to skip that data as
it does not know what to do with it

This typically comes from using a flight file whos format maybe newer than
what the reader supports or from older files that have deprecated data (like
SmartScene surfaces, you see this a lot in Multigen gallery files)

How to fix this, remove the data in Creator or extend the the OpengFlight
reader to handle the unknown data/record/node

To see what the Opcode is for look at the OpenFlight(tm) specs you can get
from MultiGen



__
Gordon Tomlinson 

gor...@gordontomlinson.com IM: gordon3db...@3dscenegraph.com 
www.vis-sim.com
www.gordontomlinson.com
www.PhotographyByGordon.com

__

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matt Caron
Sent: Tuesday, October 05, 2010 5:57 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Problem Loading .FLT

Hi,

I've got an .FLT file that I need to load into OSG.  I am loading it with
the following code:


Code:

osg::Node* pLoadedModel = osgDB::readNodeFile("[mypath]/campus08-19.flt");




However when I compile and run the program I get the following error:

"Unknown record, opcode=91 size=88"

I have no idea what this means and I'm hoping someone here can explain it
and perhaps help me correct it.  I have seen this .FLT run with other
programs so it should not be corrupt or anything.

Thank you!

Cheers,
Matt

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





___
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] Problem Loading .FLT

2010-10-05 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Matt,

Just for giggles, have you tried loading your .FLT file in osgviewer? In
other words, try "osgviewer campus08-19.flt" and see what happens. It should
just load your openflight file for viewing...

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matt Caron
Sent: Tuesday, October 05, 2010 10:57 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Problem Loading .FLT

Hi,

I've got an .FLT file that I need to load into OSG.  I am loading it with
the following code:


Code:

osg::Node* pLoadedModel = osgDB::readNodeFile("[mypath]/campus08-19.flt");




However when I compile and run the program I get the following error:

"Unknown record, opcode=91 size=88"

I have no idea what this means and I'm hoping someone here can explain it
and perhaps help me correct it.  I have seen this .FLT run with other
programs so it should not be corrupt or anything.

Thank you!

Cheers,
Matt

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





___
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


[osg-users] Problem Loading .FLT

2010-10-05 Thread Matt Caron
Hi,

I've got an .FLT file that I need to load into OSG.  I am loading it with the 
following code:


Code:

osg::Node* pLoadedModel = osgDB::readNodeFile("[mypath]/campus08-19.flt");




However when I compile and run the program I get the following error:

"Unknown record, opcode=91 size=88"

I have no idea what this means and I'm hoping someone here can explain it and 
perhaps help me correct it.  I have seen this .FLT run with other programs so 
it should not be corrupt or anything.

Thank you!

Cheers,
Matt

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





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


Re: [osg-users] update and cull frame-spanning issue

2010-10-05 Thread Paul Martz

On 10/5/2010 7:41 AM, Tim Moore wrote:

In your cull traversal you can push a matrix on the ModelView stack, traverse
the subgraph, and then pop the matrix without modifying the scene graph at all.
Take a look at osgUtil::CullVisitor::apply(Transform&) to see how this is done.
You do need to be careful that the bounding volume of the node is set so that
the node will be culled properly.


This is the way to go.

Note that if you're using a custom node that derives from Transform, you can 
compute the necessary matrix inside the computeLocalToWorld() function, which 
gets called during cull to obtain the matrix. Thus each individual cull thread 
obtains its own matrix without ever modifying the scene graph.


--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Blender osgExport multiple animations

2010-10-05 Thread Michail Lanam
Hello.

How do i split animations in Blender so they can be exported as separate by 
osgExport? Also how do i join multiple object animations in one?
Like, nathan.osg has different animations, not just one continuous animation, 
nor he has separate animations for each geode.

Thanks.

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





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


Re: [osg-users] osgviewerQtWidget

2010-10-05 Thread D.J. Caldwell
Hi, Christian,

I am using OSG 2.8.3, and I haven't had a chance to work with the
newer code and examples.  Your suggestion of reorganizing the classes
might help, but since I haven't looked at the code myself, that's as
much as I can say about that.

With more detail about your source code, maybe someone with more
experience can offer some advice and/or alternatives.

Good luck...

D.J.

On Tue, Oct 5, 2010 at 11:40 AM, Christian Muggeridge
 wrote:
> The virtual paintEngine is actually already in place. I believe that this 
> virtual paint engine helped a flickering problem. In my case, there is no 
> flickering, but only a solid black view.
>
> Any other suggestions?
>
> Thanks,
>
> Christian
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=32405#32405
>
>
>
>
>
> ___
> 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] [osgPPU] pipeline stall

2010-10-05 Thread Riccardo Corsi
Hi Art,

you're right about the output order of the units... I really don't know why
the order is mixed...
What I'm sure about is that all the cameras which are input to the PPU are
updated every frame, because for debug reasons I use their (attached)
texture on another quad without pipeline, and that is draw correctly every
frame.

It's a bit complicated to reproduce the issue with an example, I'll try to
set it up though.

In the meantime let me just explain you how I setup the different camera, in
case you notice something wrong with that.

I have a main scene and then, inside the main view, a phone model in 3D
which has to show on its screen the main scene plus some additional
contents.
So, without any PPU I have:

1. main viewer camera which renders main scene to the full viewport
2. phone camera (slave, RTT via FBO, shares the viewer scene data) in
PRE_RENDER to render main scene from the phone point of view
3. hud camera (RTT via FBO) in PRE_RENDER to render phone additional
contents
--> output texture from 2 and 3 are mixed by a simple shader and used on the
phone 3D model
4. another slave camera to draw only the phone model (in its own subgraph)
on the main window viewport

Now I'd like to add some post process to the camera 2. To achieve that I
would:
- attach the PPU to the main scene
- set the PPU::Processor camera to the phone camera 2
- then don't know if it's better to mix the postprocess result with hud
camera inside the pipeline, or mix them with the shader I'm using now. In
both cases I would not use a UnitOut, but simply getOrCreateOutputTexture()
from the last Unit of the pipeline.

It this a correct approach?
Thanks,
Ricky




On Tue, Oct 5, 2010 at 15:15, Art Tevs  wrote:

> Hi Ricardo,
>
> hmm, since I do not know your unit graph setup I could not give the right
> answer on this. Actually any stalling is not a correct behaviour and
> shouldn't be a consequence of wrong unit graph. Unit graphs are actually
> static, so if they start well, they should also work well without stalling.
> Only if there is dynamically any change happens, then it might create a
> problem.
>
> What is your last unit, is it the DOF_Result or the BlurVertical. I assume
> this is the DOF_Result. Due to the order of the output, you will get one
> frame delay in your results.
>
> Are you sure that your camera, which you use for the input to the Unit
> graph is updated every frame. Maybe just one of your cameras stalls. Is it
> possible, that you create a small example application showing the issue?
>
>
> Thank you!
>
> Cheers,
> Art
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=32392#32392
>
>
>
>
>
> ___
> 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] osgviewerQtWidget

2010-10-05 Thread Christian Muggeridge
The virtual paintEngine is actually already in place. I believe that this 
virtual paint engine helped a flickering problem. In my case, there is no 
flickering, but only a solid black view. 

Any other suggestions?

Thanks,

Christian

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





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


Re: [osg-users] osgviewerQtWidget

2010-10-05 Thread D.J. Caldwell
Hello, Christian.

If you overload the virtual function, QOSGWidget::paintEngine, to
return 0, you may see improvement.  In the past, that is what has
worked for me, and the option has been discussed in this list.  Do a
search on the archives for paintEngine and/or Qt paint for more
detail.  Also, check out the Qt documentation and source code for
possible implications for your project.

I hope this helps...

D.J.

On Tue, Oct 5, 2010 at 10:58 AM, Christian Muggeridge
 wrote:
> Hi,
>
> The osgviewerQtWidget is built with the examples in OSG 2.9.9 to demonstrate 
> a Qt/OSG combination. The example loads 4 osg files in 4 separate views (in a 
> Qt window), grouped in a composite view. The example code requires the usage 
> of 3 classes: QOSGWidget, ViewQOSG and CompositeViewerQOSG.
>
> QOSGWidget derives from a QWidget object.
> ViewQOSG derives from QOSGWidget and OSGViewer::View.
> CompositeViewerQOSG derives from QWidget and OSGViewer::CompositeViewer.
>
> I am trying to simplify this example to only use the QOSGWidget/ViewQOSG 
> classes, as I don't require the functionality of the composite viewer. 
> However, it seems as though that the CompositeViewerQOSG  contains a virtual 
> paintEvent, which handles the drawing of the OSG models. Thus, by eliminating 
> the composite viewer along with the paint event, when a model is loaded (e.g. 
> cow.osg), a solid black view persists in the area where the cow should load.
>
> My question is, to create a simple osg viewer in a Qt window WITHOUT the 
> composite viewer, will I need to reorganize the classes built in the example 
> file (e.g, cut out code, add new paintEvent etc.) to get a simplified example 
> working? Has anyone tried this with the OSG 2.9.9 example?
>
> Thank you!
>
> Cheers,
> Christian
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=32402#32402
>
>
>
>
>
> ___
> 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] update and cull frame-spanning issue

2010-10-05 Thread paul graham
Many thanks for the prompt responses. I've got a clear way forward now.

Cheers

Paul

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





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


[osg-users] osgviewerQtWidget

2010-10-05 Thread Christian Muggeridge
Hi,

The osgviewerQtWidget is built with the examples in OSG 2.9.9 to demonstrate a 
Qt/OSG combination. The example loads 4 osg files in 4 separate views (in a Qt 
window), grouped in a composite view. The example code requires the usage of 3 
classes: QOSGWidget, ViewQOSG and CompositeViewerQOSG. 

QOSGWidget derives from a QWidget object.
ViewQOSG derives from QOSGWidget and OSGViewer::View.
CompositeViewerQOSG derives from QWidget and OSGViewer::CompositeViewer.

I am trying to simplify this example to only use the QOSGWidget/ViewQOSG 
classes, as I don't require the functionality of the composite viewer. However, 
it seems as though that the CompositeViewerQOSG  contains a virtual paintEvent, 
which handles the drawing of the OSG models. Thus, by eliminating the composite 
viewer along with the paint event, when a model is loaded (e.g. cow.osg), a 
solid black view persists in the area where the cow should load. 

My question is, to create a simple osg viewer in a Qt window WITHOUT the 
composite viewer, will I need to reorganize the classes built in the example 
file (e.g, cut out code, add new paintEvent etc.) to get a simplified example 
working? Has anyone tried this with the OSG 2.9.9 example?

Thank you!

Cheers,
Christian

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





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


Re: [osg-users] [osgPPU] CubeMap reflection

2010-10-05 Thread Vincent Honnet
Hi,

your are right Robert. I got something working by having a look to 
osgvertexprogram (for reflection/refraction, I just converted the ARB shader 
into a glsl one) and some other shader examples that process normals.

Thanks !
Vincent

... 


Thank you!

Cheers,
Vincent

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





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


Re: [osg-users] [osgPPU] CubeMap reflection

2010-10-05 Thread Honnet Vincent

 Hi Art,

I agree, I couldn't get it working. The only way I found was to let 
osgPPU process my computation until the normals and then use it as 
output texture on the geometry that has the reflection and refraction 
shader like one do in the example osgvertexprogram.


Vincent

Le 05/10/2010 15:18, Art Tevs a écrit :

Hi Vincent,

take a look into the osgreflection example shipped with OSG. One of this 
examples shows the cubemap reflection implementation. You cannot achieve 
reflection with osgPPU, since it does not know anything about your cameras or 
other stuff.

The cubemap exampel showed with osgPPU is just to show that you can also use 
CubeMap textures as input/output with osgPPU.

Cheers,
Art

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





___
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] [osgPPU] Ping pong with osgPPU

2010-10-05 Thread Vincent Honnet
Hi Art,

I got my example of ping pong working. Here is the structure

processor
|-> unitTexture (to initialize or change the input texture through the cpu)
|-> processSimulationUnitInOut (will contain the shader for the processing of 
the simulation)
|-> blurUnitInOut
|-> computeNormalsUnitInOut
|-> outputUnitInOut to get the ouput texture

(the same as writen in my first post).

Then I set an output texturet hat has the same parameters of the input texture 
to processSimulationUnitInOut with 
processSimulationUnitInOut->setOutputTexture(processSimulationOutputTexture2D, 
0);.
Then I add a osg::Camera::DrawCallback to the camera of the viewer (that is 
also the one of the processor). In the method operator() of this callback I 
extract the output texture from processSimulationUnitInOut with
osg::Texture2D* t0 = (osg::Texture2D*) 
processSimulationUnitInOut->getOutputTexture(0);
and give it to the input unit texture (unitTexture) with 
unitTexture->setTexture(t0);


One can do ping pong with several textures because of the mrt parameter of 
setOutputTexture and getOutputTexture, and it works.

I hope I was clear enough. If not, do not hesitate to ask me.

Vincent


... 


Thank you!

Cheers,
Vincent

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





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


Re: [osg-users] update and cull frame-spanning issue

2010-10-05 Thread Tim Moore
On Tue, Oct 5, 2010 at 3:12 PM, Robert Osfield wrote:

> Hi Paul,
>
> On Tue, Oct 5, 2010 at 1:25 PM, paul graham  wrote:
> > Hi, I'm hoping someone can help - I'm calculating a scaling value in my
> cull traversal using the pixelSize() function. I then set my scaling matrix
> in the update traversal.
> >
> > The problem with this is that the scale calculated is always one frame
> out  when it get's applied - so there's a noticeable jerkiness on zooming
> in.
> >
> > If I update my matrix in the cull traversal, zooming is smooth, however I
> understand that this is a dangerous thing to do.
>
> In general I would recommend users modify the scene graph outwith the
> cull and draw traversals as this ensures the most flexible and
> robustness w.r.t any threading and multi-context work that you may
> wish to do.
>
> However, as long as your aware of the potential pitfalls it can be
> safe to modify the scene graph during cull, and it's also possible to
> compute data on the fly dynamically in cull and avoid any need to
> modify the scene graph.
>
> In your cull traversal you can push a matrix on the ModelView stack,
traverse the subgraph, and then pop the matrix without modifying the scene
graph at all. Take a look at osgUtil::CullVisitor::apply(Transform&) to see
how this is done. You do need to be careful that the bounding volume of the
node is set so that the node will be culled properly.

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


Re: [osg-users] [osgPPU] CubeMap reflection

2010-10-05 Thread Robert Osfield
Hi Art and Vincent,

On Tue, Oct 5, 2010 at 2:18 PM, Art Tevs  wrote:
> take a look into the osgreflection example shipped with OSG. One of this 
> examples shows the cubemap reflection implementation.

Just for clarification, the osgreflection examples use a multi-pass
stencil buffer based approach for planar reflections, while the
osgprerendercubemap uses a render texture based approach with a cube
map for reflections.

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


Re: [osg-users] [osgPPU] CubeMap reflection

2010-10-05 Thread Art Tevs
Hi Vincent,

take a look into the osgreflection example shipped with OSG. One of this 
examples shows the cubemap reflection implementation. You cannot achieve 
reflection with osgPPU, since it does not know anything about your cameras or 
other stuff.

The cubemap exampel showed with osgPPU is just to show that you can also use 
CubeMap textures as input/output with osgPPU.

Cheers,
Art

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





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


Re: [osg-users] [osgPPU] pipeline stall

2010-10-05 Thread Art Tevs
Hi Ricardo,

hmm, since I do not know your unit graph setup I could not give the right 
answer on this. Actually any stalling is not a correct behaviour and shouldn't 
be a consequence of wrong unit graph. Unit graphs are actually static, so if 
they start well, they should also work well without stalling. Only if there is 
dynamically any change happens, then it might create a problem.

What is your last unit, is it the DOF_Result or the BlurVertical. I assume this 
is the DOF_Result. Due to the order of the output, you will get one frame delay 
in your results. 

Are you sure that your camera, which you use for the input to the Unit graph is 
updated every frame. Maybe just one of your cameras stalls. Is it possible, 
that you create a small example application showing the issue? 


Thank you!

Cheers,
Art

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





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


Re: [osg-users] update and cull frame-spanning issue

2010-10-05 Thread Robert Osfield
Hi Paul,

On Tue, Oct 5, 2010 at 1:25 PM, paul graham  wrote:
> Hi, I'm hoping someone can help - I'm calculating a scaling value in my cull 
> traversal using the pixelSize() function. I then set my scaling matrix in the 
> update traversal.
>
> The problem with this is that the scale calculated is always one frame out  
> when it get's applied - so there's a noticeable jerkiness on zooming in.
>
> If I update my matrix in the cull traversal, zooming is smooth, however I 
> understand that this is a dangerous thing to do.

In general I would recommend users modify the scene graph outwith the
cull and draw traversals as this ensures the most flexible and
robustness w.r.t any threading and multi-context work that you may
wish to do.

However, as long as your aware of the potential pitfalls it can be
safe to modify the scene graph during cull, and it's also possible to
compute data on the fly dynamically in cull and avoid any need to
modify the scene graph.

In you case you are modify the scene graph in a way that at worst
might lead to a matrix getting the wrong values if you have multiple
cull traversals per frame, but it won't lead to a crashes as you
aren't creating or destroying data or leading to any changes that
might cause a serious threading issue.

If you do have multiple viewer cameras then you will have multiple
cull traversals and multiple possible settings for your scaling and in
this case you might want to consider one camera the dominate one, or
multi-buffering the scaling, or doing the transform completely on the
fly in cull.

Robert.


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


Re: [osg-users] [osgPPU] Ping pong with osgPPU

2010-10-05 Thread Art Tevs
Hi Vincent,

your idea about using ping pong wiht osgPPU is nice. I have already tried to do 
something similar and had no time to finish the example. 

I am not sure if I get your osgPPu graph structure right, no I think I didn't 
get it. Can you give some drawing or similar thing showing you graph strucutre.

However, you write, that you are setting a texture to unitTexture as output of 
your other unit? Can you say me what is the purpose of that? Usually 
UnitTexture was meant to be able to put some texture as input to the osgPPU 
graph. Other children unit below the unittexture could use that then to process 
it. Settings manually an output texture of an unit as an input texture to the 
UnitTexture doesn't make sense. UnitTexture has no own shader, so to be 
processed you need to have another UnitInOut as a child of this UnitTexture.

Therefore I didn't really get what you would like to achieve. At least I am 
sure, that setting input texture to UnitTexture as output texture from 
UnitInOut is a wrong way to do it.

cheers,
art

Thank you!

Cheers,
Art

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





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


[osg-users] update and cull frame-spanning issue

2010-10-05 Thread paul graham
Hi, I'm hoping someone can help - I'm calculating a scaling value in my cull 
traversal using the pixelSize() function. I then set my scaling matrix in the 
update traversal.

The problem with this is that the scale calculated is always one frame out  
when it get's applied - so there's a noticeable jerkiness on zooming in.

If I update my matrix in the cull traversal, zooming is smooth, however I 
understand that this is a dangerous thing to do.

Can anyone suggest a more sensible workaround?

Many thanks in advance

Paul

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





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


Re: [osg-users] Save texture changes via fragment shader

2010-10-05 Thread Aitor Ardanza
I asked this question in gamedev forum, and they would suggest the following:

> You can not do it like you have in your example. You need to set up an FBO 
> with multiple render targets, and bind your editedMap as one of the targets.

But I dont have idea how can I do this... How can I configure FBOs in OSG?

Thank you!

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





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


[osg-users] Autorotating scene elements (osg::Billboard vs. osg::AutoTransform)

2010-10-05 Thread Javier Taibo
  Hi all,

  In a recent thread it was commented the differences between Billboards and
AutoTransforms. For lightweight models (like trees) Billboard is a very
efficient solution. AutoTransform, on the other side, is a Group node that
orient the scene graph behind it towards the screen (or the camera).

  However, I think there is a useful feature missing. I have found in many
cases that I need to rotate a part of the scene graph around an axis (just
like billboards do), usually the Z-axis. It would be nice to have in
AutoTransform a way to define a rotation axis and a mode to activate it.

  Is there any evident way to do it that I am missing (this is probable)? In
case there is not, do you think it would be interesting to add this feature
to AutoTransform?


  Best Regards,
  Javier Taibo.


  P.S.: Maybe I am nostalgic of old VRML Billboards, that in fact were a
Group node :)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org