[osg-users] osgViewer

Michael W. Hall mwhall at hiwaay.net
Thu Jan 3 17:23:32 PST 2008


I have attached the screenshot of my application running.  I have also
attached the view class.  Again the class was generated by KDevelop and
I have modified it.

I have been looking at the example Rafa mentioned, but I still cannot
find the solution to the issue I am having.  I select the cube.osg file
from the following location: OSG_OP_OT-1.2/Producer/Test/Trackball

My application reads the file and it displays.  However, what you see in
my screenshot disappears and I get a full screen of the cube.  I am
hoping some one can tell me what I am missing.  I would like the cube to
be displayed in the window of the application.

I am a beginner with OSG, so forgive me if this is trivial.  If someone
has any advice, please send it my way.  Now back to the reference
documentation.

Thanks,
Michael

On Wed, 2008-01-02 at 08:53 +0100, Rafa Gaitan wrote:
> Hi Michael, 
> 
> 
> mmh I don't know, I successfully created a Viewer in Java, so,
> probably you are missing
> something...Have you called to setUpViewerAsEmbedded method?.. .You
> should have
> all you need in the viewer examples of the OSG source tree.
> 
> 
> Rafa.
> 
> On Jan 1, 2008 11:45 PM, Michael W. Hall <mwhall at hiwaay.net> wrote:
>         Thanks for the info Rafa.  I appear to have something
>         working.  I my
>         KMapView class is derived from QGLWidget and
>         osgViewer::Viewer.  The 
>         application compiled successfully.
>         
>         To test it I tried to open cube.osg that came with my osg
>         source.  It
>         appeared to open the file.  It was a yellow cube with a symbol
>         that
>         looked like a lamda.  However, when the file was opened it was
>         showing 
>         full screen.  My question is how do you keep this from
>         happening?  Was
>         it the file or is there something wrong in my code?
>         
>         Thanks,
>         Michael
>         
>         
>         On Thu, 2007-12-27 at 08:18 +0100, Rafa Gaitan wrote:
>         > Hi Michael,
>         >
>         > I'm not an expert in QT, but probably you can take a look
>         > to osgviewerQT example inside OSG source tree.
>         >
>         > Rafa.
>         >
>         > On Dec 27, 2007 4:35 AM, Michael W. Hall <mwhall at hiwaay.net>
>         wrote:
>         >         I have created a KDevelop project using the
>         Application
>         >         framework 
>         >         template.  I have made my kmapview.cpp class derive
>         from
>         >         QGLWidget.  I
>         >         created a member variable, m_Viewer in the KMapView
>         class.  I
>         >         have in my
>         >         constructor for KMapView the following: 
>         >
>         >
>          m_Viewer.getCamera()->setProjectionMatrixAsPerspective(
>         >                40., 1., 1., 100. );
>         >
>          m_Viewer.getCamera()->setClearColor( osg::Vec4( 0., 0., 0.,
>         >         1. ) ); 
>         >
>         >         However, it doesn't appear that anything is
>         changing.  I ran
>         >         the
>         >         application after creating the project to see how it
>         looked.
>         >          With the
>         >         above changes, it appears that nothing is being
>         effected.  The 
>         >         window
>         >         still looks the same as when I first ran it.  I have
>         still
>         >         have a window
>         >         with a white background.  I have attached a picture
>         of the
>         >         application 
>         >         running.
>         >
>         >         I was hoping the big white field would have changed
>         to an
>         >         osgViewer as
>         >         the window where the white field is.  Any ideas as
>         how to
>         >         replace the 
>         >         white field with an osgViewer?  I am a beginner with
>         OSG.  I
>         >         am playing
>         >         to learn.  I have read the OpenSceneGraph Quick
>         Start Quide.
>         >
>         >         Thanks for any help. 
>         >
>         >         _______________________________________________
>         >         osg-users mailing list
>         >         osg-users at lists.openscenegraph.org
>         >
>         http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>         >
>         >
>         >
>         > -- 
>         > Rafael Gaitán Linares
>         > Instituto de Automática e Informática Industrial
>         >  http://www.ai2.upv.es
>         > Ciudad Politécnica de la Innovación
>         > Universidad Politécnica de Valencia 
>         
>         > _______________________________________________
>         > osg-users mailing list
>         > osg-users at lists.openscenegraph.org
>         >
>         http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>         
>         
>         _______________________________________________ 
>         
>         osg-users mailing list
>         osg-users at lists.openscenegraph.org
>         http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>         
> 
> 
> 
> -- 
> Rafael Gaitán Linares 
> Instituto de Automática e Informática Industrial
>  http://www.ai2.upv.es
> Ciudad Politécnica de la Innovación
> Universidad Politécnica de Valencia
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot-KMap.png
Type: image/png
Size: 11231 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080103/81cde751/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmapview.cpp
Type: text/x-c++src
Size: 2932 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080103/81cde751/attachment.cpp 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmapview.h
Type: text/x-chdr
Size: 3215 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080103/81cde751/attachment.h 


More information about the osg-users mailing list