Re: [osg-users] Step by step addDrawable and visualize current scene graph

2021-03-23 Thread Paul Jurczak
Thank you, Nathan. It solves my problem.

On Tuesday, March 23, 2021 at 12:14:59 PM UTC-6 nmiel...@gmail.com wrote:

> Paul,
>
> Looking at the OSG Viewer.cpp code, the run() function contains this code:
> if (!getCameraManipulator() && getCamera()->getAllowEventFocus())
> {
> setCameraManipulator(new osgGA::TrackballManipulator());
> }
>
> Therefore, by adding this line before viewer.frame() is called makes the 
> spheres appear as you expected:
> viewer.setCameraManipulator(new osgGA::TrackballManipulator());
>
> -Nathan
>
>
> On Sun, Mar 21, 2021 at 5:31 PM 'Paul Jurczak' via OpenSceneGraph Users <
> osg-...@googlegroups.com> wrote:
>
>> I'm just starting with OSG. I would like this (or similar) code: 
>>
>> int main() {
>>   osgViewer::Viewer viewer;
>>   osg::Geode*   geode = new osg::Geode();
>> 
>>   viewer.setSceneData(geode);
>>   geode->addDrawable(new osg::ShapeDrawable(new 
>> osg::Sphere(osg::Vec3(0, 0, 0), 1)));
>> 
>>   viewer.frame();
>>   this_thread::sleep_for(seconds(2));
>> 
>>   geode->addDrawable(new osg::ShapeDrawable(new 
>> osg::Sphere(osg::Vec3(2, 0, 0), 1)));
>>   
>>   return viewer.run();
>> }
>>
>> to display the first sphere and after 2s the second sphere, but it 
>> displays a blank screen for 2s instead and 2 spheres afterwards. What do I 
>> have to change?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "OpenSceneGraph Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to osg-users+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/osg-users/8d8ad5ea-8080-401c-b1c2-26345345c84en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/osg-users/8d8ad5ea-8080-401c-b1c2-26345345c84en%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/e5dab9a2-111f-47bc-81a7-e7ef949e3d20n%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Step by step addDrawable and visualize current scene graph

2021-03-21 Thread 'Paul Jurczak' via OpenSceneGraph Users
I'm just starting with OSG. I would like this (or similar) code: 

int main() {
  osgViewer::Viewer viewer;
  osg::Geode*   geode = new osg::Geode();

  viewer.setSceneData(geode);
  geode->addDrawable(new osg::ShapeDrawable(new 
osg::Sphere(osg::Vec3(0, 0, 0), 1)));

  viewer.frame();
  this_thread::sleep_for(seconds(2));

  geode->addDrawable(new osg::ShapeDrawable(new 
osg::Sphere(osg::Vec3(2, 0, 0), 1)));
  
  return viewer.run();
}

to display the first sphere and after 2s the second sphere, but it displays 
a blank screen for 2s instead and 2 spheres afterwards. What do I have to 
change?

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/8d8ad5ea-8080-401c-b1c2-26345345c84en%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org