Re: [osg-users] rendering to existing gtk window

2009-08-25 Thread Vinay Shah
Sorry, that was a typo.  The computer my code is on isn't connected to the 
internet so I mistyped it as I rewrote it.  

So yes, I do have what you have written below.  I have taken a look at the 
osgViewerMFC and didn't see anything else that I was missing.  I will look into 
the osgviewerQT example and see if I find anything.  

Thanks

-Vinay

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





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


[osg-users] rendering to existing gtk window

2009-08-24 Thread Vinay Shah
Hello, 

I'm trying to port some code which worked in OpenSceneGraph 1.0 and used the 
old Producer's viewer.  

previously i had a statement which said: 


Code:
viewer.getCamera(0)-getRenderSurface()-setWindow(gtk_plug_id);  



I tried creating a graphics context and setting the inheritedWindowData traits 
as: 


Code:

traits-inheritedWindowData = new osgViewer::GraphicsWindowX11(gtk_pli_id);





I noticed that it does black out the appropriate window (so it seems like its 
doing something right) but then fails to render anything to that area.  Is 
there another step that I might be missing?  

thanks in advance, 

-vinay

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





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


[osg-users] segmentation fault in Group::Traverse

2009-08-12 Thread Vinay Shah
Hello, 

I'm getting a segmentation fault in Group::traverse() and have no idea how to 
even start debugging this.  The stack trace looks like this: 


 
 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 0x9e23eb90 (LWP 13804)]
 0x006783f8 in osg::Group::traverse () from /usr/lib/libosg.so.55
 (gdb) bt
 #0  0x006783f8 in osg::Group::traverse () from /usr/lib/libosg.so.55
 #1  0x003bd88c in osgUtil::GLObjectsVisitor::apply () from 
 /usr/lib/libosgUtil.so.55
 #2  0x006bc028 in osg::NodeVisitor::apply () from /usr/lib/libosg.so.55
 #3  0x0067a3bd in osg::Group::accept () from /usr/lib/libosg.so.55
 #4  0x00918d3c in osgViewer::Renderer::compile () from 
 /usr/lib/libosgViewer.so.55
 #5  0x0091d933 in osgViewer::Renderer::draw () from 
 /usr/lib/libosgViewer.so.55
 #6  0x00917cb8 in osgViewer::Renderer::operator() () from 
 /usr/lib/libosgViewer.so.55
 #7  0x0066e4c9 in osg::GraphicsContext::runOperations () from 
 /usr/lib/libosg.so.55
 #8  0x00675fbd in osg::RunOperations::operator() () from /usr/lib/libosg.so.55
 #9  0x006760c7 in osg::GraphicsOperation::operator() () from 
 /usr/lib/libosg.so.55
 #10 0x006c8598 in osg::OperationThread::run () from /usr/lib/libosg.so.55
 #11 0x00676149 in osg::GraphicsThread::run () from /usr/lib/libosg.so.55
 #12 0x00c5ec2b in OpenThreads::ThreadPrivateActions::StartThread () from 
 /usr/lib/libOpenThreads.so.11
 #13 0x00c4749b in start_thread () from /lib/libpthread.so.0
 #14 0x010c242e in clone () from /lib/libc.so.6
 


I am running multiple threads, one creates the scene graph and there are 4 
camera threads that render it with different perspectives.  I noticed that OSG 
has mutex's built in, but I haven't been able to find much documentation on 
them and don't know how to use them correctly.  I would appreciate any help 
that could get me going in the right direction.  

Thanks!

-vinay

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





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


Re: [osg-users] segmentation fault in Group::Traverse

2009-08-12 Thread Vinay Shah
There is a scene generation thread which builds up the scene graph and updates 
position of various nodes.

Each camera thread has it's own viewer which renders (using the viewer.frame() 
) part of the same scene graph.  The only different in the 
scene graphs between the camera threads is that each has it's own camera node.  
The camera position, view direction, and zoom are altered in the camera thread. 
 

I believe I am in violation of the general rule, but is there a way around this 
using mutex protection?  

Thanks, 

-Vinay

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





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


Re: [osg-users] segmentation fault in Group::Traverse

2009-08-12 Thread Vinay Shah
Thanks for the suggestion Jason.  

There are a few other questions that you might be able to help me with also.  

But first, I should also mention that I am writing to an off screen pbuffer .  
I have attached an image to viewer's camera 
(viewer.getCamera()-attach(osg::camera::COLOR_BUFFER, imageBuffer).  I then 
send a pointer to the image's data to another thread (the frame generation 
thread) which compresses it and adds it to a video stream.  I'm using two image 
buffers so that when the frame generation thread is compressing the image we 
can write to the other buffer).  

It looks like sometimes we are accessing the imageBuffer before it is filled as 
I'm passing a black frame to the camera frame generation thread.  

When I call viewer.frame() is the rendering completed or is that kicking off 
another thread which does the rendering?

If so, how do I know when the rendering has finished? 

Also, can you provide some information on the various threading models? If I 
use singlethreading, does the viewer spawn it's own thread or will it render in 
the existing thread (the one that makes the call to viewer.frame). 

Thanks again, 

-Vinay

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





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


Re: [osg-users] Rendering image to memory

2009-07-16 Thread Vinay Shah
I want rendering enabled, but I only want to render to the frame buffer object. 
 Currently it is still trying to draw something to the screen.  Thanks, 

-Vinay

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





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


Re: [osg-users] Rendering image to memory

2009-07-16 Thread Vinay Shah
Oh ok, I misunderstood.  Currently I have my main camera writing to the frame 
buffer and don't have a RTT camera.  Is it required that I use two cameras like 
this?  Thanks, 
-Vinay

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





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


Re: [osg-users] Rendering image to memory

2009-07-16 Thread Vinay Shah
I changed the context to a pbuffer using the osgscreencapture example and it no 
longer tries to spawn a window.  thanks for all the help!

-Vinay

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





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


Re: [osg-users] Rendering image to memory

2009-07-15 Thread Vinay Shah
Hi,

Thanks for the response.  I originally wanted to use the older version of osg 
because that's what is currently being used on the project I am working on.  
However, I have since upgraded to 2.8.2.  

I am now able to draw into a frame buffer and then get the frame data into 
memory by using the following commands: 


Code:


viewer.getCamera()-setRendertargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
viewer.getCamera()-attach(osg::Camera::COLOR_BUFFER, image);





Now I'm having a problem that even though I'm writing to a frame buffer, the 
viewer still wants to draw something to the screen.  When I run my code it 
blacks out the entire screen.  I tried using


Code:

viewer.setupViewInWindow(0,0,0,0,0);




which eliminates the problem of blacking out the entire screen, but this 
results in an OpenGL error.  Does anybody know the proper way of disabling 
drawing to the screen for the viewer?  

Thank you!

Cheers,
Vinay

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





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


Re: [osg-users] Rendering image to memory

2009-06-10 Thread Vinay Shah
Hi,

Thanks for responding.  Do you know if this can be done using OSG 1.0?  It 
looks like osg::Camera doesn't exist back then.  

Thanks again, 

-vinay

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





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