Re: [osg-users] PolytopeIntersector returns no hits when zoomed in (3.6.5)

2020-05-01 Thread OpenSceneGraph Users
To answer my own question. The approach that worked was to just remove the "zNear" plane from the Polytope. It is the last plane. Seems like an unnecessary hack. PolytopeIntersector* picker = new PolytopeIntersector ( osgUtil::Intersector::PROJECTION, nx1, ny1, nx2, ny2 ); auto

[osg-users] PolytopeIntersector returns no hits when zoomed in (3.6.5)

2020-05-01 Thread OpenSceneGraph Users
Hi, I am using the PolytopeIntersector to select objects in a "selection box" Works as expected in most cases. However when I am "zoomed in" (perspective view) fairly tightly ( the eye point is inside the bounding box of the geometry), the PolytopeIntersector returns "no hits" on the geometry.

[osg-users] PolytopeIntersector::Intersection::primitiveIndex

2017-05-28 Thread tom spencer
Hi, I am looking for some clarification of the primitiveIndex value of polytope intersection. I have added a very simple scene file containing 3 planar faces of a cube with 6 triangles in a primitive set. I have been testing the polytope intersector with osgkeyboardmouse using the following

Re: [osg-users] PolytopeIntersector with AutoTransform

2016-12-04 Thread Bruno Oliveira
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.

Re: [osg-users] PolytopeIntersector with AutoTransform

2016-12-04 Thread 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

[osg-users] PolytopeIntersector with AutoTransform

2016-12-03 Thread Bruno Oliveira
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

Re: [osg-users] PolytopeIntersector LIMIT_NEAREST (or LIMIT_ONE) different distances for different groupnodes

2016-06-01 Thread David Knipp
Hi robertosfield, Thank you for you reply. This absolutley understandable. Every group can have it's own transformation and so every group has it's own local coordinates. Quite clear. So i guess there is absolutley no way to caluclate distances in Worldcoordinates? I admit, I don't

Re: [osg-users] PolytopeIntersector LIMIT_NEAREST (or LIMIT_ONE) different distances for different groupnodes

2016-06-01 Thread Robert Osfield
Hi David, Way too much detail in a difficult form to follow when skimming over things to spot what might going amiss. The best I can suggest right now is think about the coordinate frame that the distance and coordinate values are being reported in. If you have transforms in your scene graph

[osg-users] PolytopeIntersector LIMIT_NEAREST (or LIMIT_ONE) different distances for different groupnodes

2016-06-01 Thread David Knipp
Hi, I'm very sorry that i have to create a new post. I'm currently facing a problem i can't solve on my own. Im working on a single Model which has a lot of group nodes and geometry nodes. This model is categorized in a few "main" groups. In the beginning i worked only with one of this main

[osg-users] PolytopeIntersector and LineSegmentIntersector

2014-11-03 Thread Gianni Ambrosio
Hi All, I'm trying to handle mouse movements to show some informations to the user. I have basically two questions. 1) Lookig at osgkeyboardmouse.cpp example found the following code: Code: if (_useWindowCoordinates) { // use window coordinates

Re: [osg-users] PolytopeIntersector and LineSegmentIntersector

2014-11-03 Thread Christian Buchner
Hello Gianni, 2) line geometry is infinitely thin. To create an exact intersection with another line in floating point precision is like winning the lottery. You will want to use PolytopeIntersector to intersect with non-polygonal geometry instead. 2014-11-03 10:37 GMT+01:00 Gianni Ambrosio

Re: [osg-users] PolytopeIntersector and LineSegmentIntersector

2014-11-03 Thread Gianni Ambrosio
Hi Peter, thank you for the fast reply. I need some clarifications about question 1. In my application I will use the picked point to calculate, and then show, the arclength of a path, i.e. the length of the path from start to the picked point. So I would not need to show coordinates to the

Re: [osg-users] PolytopeIntersector and LineSegmentIntersector

2014-11-03 Thread Peter Hrenka
Hi Gianni, On 03.11.2014 11:47, Gianni Ambrosio wrote: Hi Peter, thank you for the fast reply. I need some clarifications about question 1. In my application I will use the picked point to calculate, and then show, the arclength of a path, i.e. the length of the path from start to the

Re: [osg-users] PolytopeIntersector, LineSegmentIntersector, and PagedLOD

2014-03-13 Thread Olivier Tournaire
Hi Chris, I also fight a long time with PolytopeIntersector and PagedLOD. Did you add callback to read your PagedLOD? See osgSim::LineOfSight for an example. Does it help? Regards 2014-03-12 21:15 GMT+01:00 Chris Long cl...@setcorp.com: Hi, I'm getting unexpected behavior from

Re: [osg-users] PolytopeIntersector, LineSegmentIntersector, and PagedLOD

2014-03-13 Thread Robert Osfield
HI Chris, It really is hard to know what is going on with your usage as I don't know you data or the code that you are using with the OSG. It could be a problem with the orientation of the planes of the Polytope - they are need to be consistent with all their normals pointing inwards. If you

Re: [osg-users] PolytopeIntersector, LineSegmentIntersector, and PagedLOD

2014-03-13 Thread Chris Long
Hi, Thanks for the tips. I know the planes' orientations need to be right. I assumed that by creating the Polytope from a BoundingBox that they would be, and when I inspect the values I think they're correct. I did try flipping them all in case I was wrong about the orientation, but that

[osg-users] PolytopeIntersector, LineSegmentIntersector, and PagedLOD

2014-03-12 Thread Chris Long
Hi, I'm getting unexpected behavior from PolytopeIntersector and was wondering if it might have something to do with the PagedLODs in my scene graph. I want to find all polygons in a rectilinear volume in my model, in model coordinates (not related to any view on the screen) based on two

Re: [osg-users] PolytopeIntersector distance and Transform

2013-03-07 Thread Robert Milharcic
On 4.3.2013 11:05, Andreas Roth wrote: hanks to Aurelien for the work-around. Hi Andreas, That is of course my personal opinion, but i think PolytopeIntersector is overkill for most, if not all usage scenarios plus it doesn't work correctly on a scaled geometry. I simply took

Re: [osg-users] PolytopeIntersector distance and Transform

2013-03-07 Thread Glenn Waldron
On Thu, Mar 7, 2013 at 4:53 AM, Robert Milharcic robert.milhar...@ib-caddy.si wrote: On 4.3.2013 11:05, Andreas Roth wrote: hanks to Aurelien for the work-around. Hi Andreas, That is of course my personal opinion, but i think PolytopeIntersector is overkill for most, if not all usage

Re: [osg-users] PolytopeIntersector distance and Transform

2013-03-07 Thread Aurelien Albert
Hi, I'm also interested if you have a solution to easily pick points lines ! Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52972#52972 ___ osg-users mailing list

Re: [osg-users] PolytopeIntersector distance and Transform

2013-03-04 Thread Andreas Roth
Hi, i tried to use the osgEarth::Picker class, which uses the PolytopeIntersector for picking and came across the same issue. I used Aurelien work-around and recalculate the distance, but as Aurelien already mentioned it's quite slow because of all the recalculation and sorting. Since Aurelien

Re: [osg-users] PolytopeIntersector distance and Transform

2012-01-23 Thread Aurelien Albert
Hi, Yes, I'm facing the same problem. I found a workaround by resorting intersections in a new container : for each intersection : - I compute the worldIntersectionPoint by transfoming the localIntersectionPoint in world coordinates - I compute the camera world position - worldIntersectionPoin

Re: [osg-users] PolytopeIntersector distance and Transform

2011-09-21 Thread Nick McEvoy
Peter Hrenka wrote: I had a partial fix which helped as long as there is no projection involved. Unfortunately that is probably the main use-case... I think the proper way to do this involves storing the inverse matrices in the result-structure and back-transforming the intersection

Re: [osg-users] PolytopeIntersector usage

2011-09-08 Thread Peter Hrenka
Hi Vincent, Am 08.09.2011 08:51, schrieb Vincent Bourdier: Hi all, I'm currently trying to compute an intersection between a sphere and a node. PolytopeIntersector seems to be the best choice according to the documentation, but I didn't find any example of implementation. Have a look at

Re: [osg-users] PolytopeIntersector usage

2011-09-08 Thread Vincent Bourdier
Hi Peter Le 08/09/2011 09:40, Peter Hrenka a écrit : The goal is to compute if a point is at less than a fixed distance from a node, and to my mind the intersection is the best way but maybe there is something more adapted ? I think that should be possible. I would recommend using a cube which

Re: [osg-users] PolytopeIntersector usage

2011-09-08 Thread Peter Hrenka
Hi Vincent, Am 08.09.2011 10:00, schrieb Vincent Bourdier: Hi Peter Le 08/09/2011 09:40, Peter Hrenka a écrit : The goal is to compute if a point is at less than a fixed distance from a node, and to my mind the intersection is the best way but maybe there is something more adapted ? I

Re: [osg-users] PolytopeIntersector usage

2011-09-08 Thread Vincent Bourdier
Hi Peter, Yes this is a nice precision, the euclidian distance will be a second pass to check the intersected results. Thanks a lot :-) Regards, Vincent Le 08/09/2011 10:21, Peter Hrenka a écrit : Hi Vincent, Am 08.09.2011 10:00, schrieb Vincent Bourdier: Hi Peter Le 08/09/2011

Re: [osg-users] PolytopeIntersector and containment

2010-05-26 Thread Andrew Cunningham
Hi Peter, Just I did notice that for long/skinny objects the bounding sphere is a very poor fit. One option for me is to dig down and get the boundingBox() of the drawable that lies as the basis of my geometry. In my experience, that can allow for a much tighter fit for this type of selection.

[osg-users] PolytopeIntersector and

2010-05-25 Thread Andrew Cunningham
Hi, I am using the PolytopeIntersector to select , using a mouse based screen rectangle, objects in my scene. Works great. However, when post-processing the intersections returned by the PolytopeIntersector I would like to check for certain nodes whether the (bounding box of the ) node is

Re: [osg-users] PolytopeIntersector and containment

2010-05-25 Thread Andrew Cunningham
Umm, I think I found my own answer. - Subclass PolytopeIntersector to get access to the _polyTope member - transform this PolyTope by the inverse camera projection matrix to put it into world coords - When processing the Node, get the Node's bounding sphere, and transform that by the

Re: [osg-users] PolytopeIntersector distance and Transform

2009-08-11 Thread Peter Hrenka
Hi Andrew, Andrew Cunningham schrieb: Hi Peter, Did you ever work up a fix for this? ... I had a partial fix which helped as long as there is no projection involved. Unfortunately that is probably the main use-case... I think the proper way to do this involves storing the inverse matrices

Re: [osg-users] PolytopeIntersector distance and Transform

2009-08-11 Thread Andrew Cunningham
Hi Peter, I have no time to work on this either at the moment. I will just avoid the scale transforms and scale the objects 'manually'. Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16108#16108

Re: [osg-users] PolytopeIntersector distance and Transform

2009-08-10 Thread Andrew Cunningham
Hi Peter, Did you ever work up a fix for this? ... Thank you! Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16056#16056 ___ osg-users mailing list

Re: [osg-users] PolytopeIntersector distance and Transform

2009-06-22 Thread Peter Hrenka
Hi Andrew, Andrew Cunningham schrieb: Hi Peter, Although your fix did not work - it is definitely the scale part of the transform causing the problem. If I remove the scaling part of the transform , then the polytope picking works as expected ... Thank you for the example. It turns

Re: [osg-users] PolytopeIntersector distance and Transform

2009-06-22 Thread Andrew Cunningham
Hi, Peter Thanks for looking into this a tricky bug ... I got really lost trying to trace the problem myself. good luck! I think as a workaround I will scale the geometry manually without using a transform. Andrew -- Read this topic online here:

Re: [osg-users] PolytopeIntersector

2009-06-19 Thread Peter Hrenka
Hi Maxime, Maxime BOUCHER schrieb: Hi, Just a question. The polytopeIntersections compute the intersections with planes or all objects in the Polytope? I mean if I draw the local intersection points will I get an empty or full shape of the polytope? The polytopeIntersector performs the

Re: [osg-users] PolytopeIntersector distance and Transform

2009-06-19 Thread Peter Hrenka
Hi again Andrew, Andrew Cunningham schrieb: Hi, I am having some problems with the distance found by the PolytopeIntersector but only when the geometry I am trying to pick has a non-null (Matrix)Transform in it's parent. The PolytopeIntersector registers that object as a 'hit', BUT the

Re: [osg-users] PolytopeIntersector distance and Transform

2009-06-19 Thread Andrew Cunningham
Hi Peter, Although your fix did not work - it is definitely the scale part of the transform causing the problem. If I remove the scaling part of the transform , then the polytope picking works as expected ... Andrew -- Read this topic online here:

[osg-users] PolytopeIntersector distance and Transform

2009-06-18 Thread Andrew Cunningham
Hi, I am having some problems with the distance found by the PolytopeIntersector but only when the geometry I am trying to pick has a non-null (Matrix)Transform in it's parent. The PolytopeIntersector registers that object as a 'hit', BUT the distance recorded appears to be incorrect ( the

[osg-users] PolytopeIntersector

2009-06-17 Thread Maxime BOUCHER
Hi, I have a lot of questions for you! But, there is one really more critical than the others. Let me just introduce the problem :). (I am sorry if I bother, but I searched on the net, in the doc and examples and didn't find answers. I apologize if this is because I badly searched.) I want

Re: [osg-users] PolytopeIntersector

2009-06-17 Thread Peter Hrenka
Hi Maxime, Maxime BOUCHER schrieb: Hi, I have a lot of questions for you! But, there is one really more critical than the others. Let me just introduce the problem :). (I am sorry if I bother, but I searched on the net, in the doc and examples and didn't find answers. I apologize if this

Re: [osg-users] PolytopeIntersector

2009-06-17 Thread Peter Hrenka
Hi Maxime, Maxime BOUCHER schrieb: [...] Peter Hrenka wrote: You call the method accept(osg::NodeVisitor) of your model (which is a osg::Node). See the example osgkeyboardmouse. My bad, I should have seen it. We certainly need an osgpolytopeintersector example... Meanwhile grep is your

Re: [osg-users] PolytopeIntersector

2009-06-17 Thread Martin Beckett
[quote]The point of Polytopes is that they are convex which makes all kinds of tests very easy. If you want to modell something non-convex (something like Constructive Solid Geometry) then PolytopeIntersector will not help you as it is.[quote] My solutution was to triangulate the convex

[osg-users] PolytopeIntersector and occlusion

2008-10-22 Thread Jean-Sébastien Guay
Hello all, I am implementing box-selection of objects using osgUtil::PolytopeIntersector. When I use LineSegmentIntersector, I know that the first intersection returned is the closest object that was intersected. In the case of PolytopeIntersector, I need something more. Basically, I need

Re: [osg-users] PolytopeIntersector and occlusion

2008-10-22 Thread Robert Osfield
Hi J-S, The PolytopeIntersector just detects and records objects that intersect with the Polytope, there is no interrelation between the objects, there are all just independent intersections. So for the functionality you are after you'll need to post process the list of intersections. I'm not

Re: [osg-users] PolytopeIntersector and occlusion

2008-10-22 Thread Jean-Sébastien Guay
Hi Robert, The PolytopeIntersector just detects and records objects that intersect with the Polytope, there is no interrelation between the objects, there are all just independent intersections. So for the functionality you are after you'll need to post process the list of intersections. OK,

Re: [osg-users] polytopeIntersector

2008-01-17 Thread Peter Hrenka
Hi Gianloca, Gianluca Natale wrote: Hi, I went deeply in debug into my code, and I discovered that the problem is in OSG v.2.2. Actually it returns the object with the shortest node path among those in the intersection vector. Was it a known bug? No, I do not consider this a bug. As a

Re: [osg-users] polytopeIntersector

2008-01-16 Thread Gianluca Natale
] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Thursday, January 10, 2008 9:05 PM To: OpenSceneGraph Users Subject: Re: [osg-users] polytopeIntersector HI Gianluca, In the 2.3.x dev release and SVN of the OSG there are improvements to the PolytopeIntersector that might help you so it'd

Re: [osg-users] polytopeIntersector

2008-01-10 Thread Daniel Moos
Hi Gianluca You say you wish to get the nearest intersection with the PolytopeIntersector... I think the mistake is here: osg::NodePath nodePath = /*picker-getFirstIntersection()*/closestIntersection.nodePath; If you want to have the nearest intersection, you must get the first intersection

Re: [osg-users] polytopeIntersector

2008-01-10 Thread Robert Osfield
HI Gianluca, In the 2.3.x dev release and SVN of the OSG there are improvements to the PolytopeIntersector that might help you so it'd be worth trying out over using 2.2 Robert. On Jan 10, 2008 5:46 PM, Gianluca Natale [EMAIL PROTECTED] wrote: Hi all! I'm trying to use a