Hi Valentin,
How complex is you apps needs? The new work on osgsimpleviewer might
well be good enough for your needs and much simpler to integrate with
MFC. Please do a check of resent posts on the lists on this topic to
track all the details down.
We don't yet have a MFC integration ready, but the framework for it is
in place, so it needn't be too long before we get there.
Robert.
On 10/25/06, Valentin Nedyalkov <[EMAIL PROTECTED]> wrote:
Dear osg-users,
I am working on a project, in which I must use OSG and MFC. I
make eparate class, which contains only OSG function for initalize a
viewer, drawing and these variables:
// Application main 3D viewer
osgProducer::Viewer *_pViewer;
//node for transformation
osg::ref_ptr<osg::PositionAttitudeTransform>
_objectXform;
In GUI there is a button to load 3D model and show in a viewer and
another button to start animation(for example move along x axis). When user
click on irst button, viewer is created and its scene contain two node: one
is objectXform and another is 3Dmodel, which is child of first one. I
don't use glut window and only do this to show viewer:
// create the windows and run the threads.
_pViewer->realize ();
_pViewer->sync();
_pViewer->update();
_pViewer->frame();
but in this case window with a veiwer is not repaint. If I put the code
above in cycle in this way:
while( _pViewer->done() )
{
_pViewer->realize ();
_pViewer->sync();
_pViewer->update();
_pViewer->frame();
}
to correct update of viewer, user can interact with window contains
GUI, while the viewer is opened, because the main thread of my application
is occupied by this cicle. What could you advise me to do?
I thought to use a worker thread to repaint viewer constanly, but it
didn't work.And the other problem is that when user click on button to start
animation viewer is not refresh.The scene stays in its initial state, in
spite
of that:
//animation
for( int i=1; ; i++)
{
_pViewer->sync();
_pViewer->update();
osg::Vec3 newPosit(i,0.0,0);
_objectXform->setPosition( shipPosit1 );
_objectXform->setAttitude(
osg::Quat(osg::DegreesToRadians( 10.0 ),
osg::Vec3 (0,0,1) ) );
_pViewer->frame();
}
This code is in separate function in my OSG class. I think that there
is a problem with reference.If this code is in the same function where
_objectXform node is add to scene there is no problem.
Thank you in advance
Valentin Nedyalkov
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/