Re: [osg-users] PolytopeIntersector with AutoTransform
Thanks for the answer. How could I solve this? 2016-12-04 12:47 GMT+00:00 Robert Osfield: > Hi Bruno, > > The complication with AutoTransform is the it computes it's values > only in the CullVisitor so you'll inherit what ever the last frame > used for it's settings. This should work OK most of the time. If you > have multiple views on the scene this will mean that there are > multiple stats but only the last one will be left in place for the > next frame. > > Robert. > > > > On 3 December 2016 at 17:55, Bruno Oliveira > wrote: > > Hello, > > > > in my scene graph I'm using an AutoTransform to add a circle with > Radius=10, > > centered on (0,0,0): > > > > float Radius = 10; > > for (int i = 0; i < nPointsInCircle; i++) > > vertArray[i] = Vec3d( radius * sin(...), radius* cos(...), 0.)); > > > > then I add this to a Drawable + Geode, and add that Geode to an > > AutoTransform: > > > > auto* autoTransform = new osg::AutoTransform; > > autoTransform->addChild(circleGeode); > > autoTransform->setAutoScaleToScreen(true); > > autoTransform->setPosition(100, 100, 0); > > > > This results in a circle located in (100, 100, 0), with radius 10, > scaling > > automatically to screen. VISUALLY this is what I want. > > Now when I use a PolytopeIntersector on this node, it returns > intersection > > coordinates of the circle , in the Circle's geometry frame, centered in > > (0,0,0) with radius 10. This means that, if I hover my mouse over the > > Circle, which is located in world coordinates in (100, 100, 0), the > > PolytopeIntersector returns coordinates centered in (0,0,0) with maximum > > radius 10. > > > > > > How can I obtain true world coordinates with Autotransforms? > > > > ___ > > 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 mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PolytopeIntersector with AutoTransform
Hi Bruno, The complication with AutoTransform is the it computes it's values only in the CullVisitor so you'll inherit what ever the last frame used for it's settings. This should work OK most of the time. If you have multiple views on the scene this will mean that there are multiple stats but only the last one will be left in place for the next frame. Robert. On 3 December 2016 at 17:55, Bruno Oliveirawrote: > Hello, > > in my scene graph I'm using an AutoTransform to add a circle with Radius=10, > centered on (0,0,0): > > float Radius = 10; > for (int i = 0; i < nPointsInCircle; i++) > vertArray[i] = Vec3d( radius * sin(...), radius* cos(...), 0.)); > > then I add this to a Drawable + Geode, and add that Geode to an > AutoTransform: > > auto* autoTransform = new osg::AutoTransform; > autoTransform->addChild(circleGeode); > autoTransform->setAutoScaleToScreen(true); > autoTransform->setPosition(100, 100, 0); > > This results in a circle located in (100, 100, 0), with radius 10, scaling > automatically to screen. VISUALLY this is what I want. > Now when I use a PolytopeIntersector on this node, it returns intersection > coordinates of the circle , in the Circle's geometry frame, centered in > (0,0,0) with radius 10. This means that, if I hover my mouse over the > Circle, which is located in world coordinates in (100, 100, 0), the > PolytopeIntersector returns coordinates centered in (0,0,0) with maximum > radius 10. > > > How can I obtain true world coordinates with Autotransforms? > > ___ > 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] PolytopeIntersector with AutoTransform
Hello, in my scene graph I'm using an AutoTransform to add a circle with Radius=10, centered on (0,0,0): float Radius = 10; for (int i = 0; i < nPointsInCircle; i++) vertArray[i] = Vec3d( radius * sin(...), radius* cos(...), 0.)); then I add this to a Drawable + Geode, and add that Geode to an AutoTransform: auto* autoTransform = new osg::AutoTransform; autoTransform->addChild(circleGeode); autoTransform->setAutoScaleToScreen(true); autoTransform->setPosition(100, 100, 0); This results in a circle located in (100, 100, 0), with radius 10, scaling automatically to screen. VISUALLY this is what I want. Now when I use a PolytopeIntersector on this node, it returns intersection coordinates of the circle , in the Circle's geometry frame, centered in (0,0,0) with radius 10. This means that, if I hover my mouse over the Circle, which is located in world coordinates in (100, 100, 0), the PolytopeIntersector returns coordinates centered in (0,0,0) with maximum radius 10. How can I obtain true world coordinates with Autotransforms? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org