Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

26. May 2012, 09:34:49 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Picking error
Pages: [1]
Print
Author Topic: Picking error  (Read 716 times)
dprakash
Enjoying the stay
*
Offline Offline

Posts: 25


View Profile
« on: 11. April 2007, 06:28:25 am »

I have created a sphere(triangle strip array) in my application and i am using Picking Library to pick it.I have made my class work like PickingLibraryTest class.
But my picking results are null.

After debugging i have found that in method pickAll(List<? super GroupNode> groups, View view, Ray3f pickRay, int button, AllPickListener l, Object userObject) of Picking Library.....


       
        SortableList<PickResult> intersecting = getPickCandidates(groups, view, pickRay, button);


       
        if (intersecting.size() > 0)
        {
            if (!isGeometryIgnored()) {
                intersecting = checkGeomIntersections(intersecting, pickRay, false);
            }
            intersecting.sort();
           
           

here getPickCandidates returns correct result but checkGeomIntersections sets the intersecting objects to 0.

So if i comment out checkGeomIntersections my picking works smooth.

Actually i cant understand how this method sets intersecting objects to 0.
« Last Edit: 11. April 2007, 06:30:28 am by dprakash » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 11. April 2007, 10:01:18 am »

I don't have time to investigate this today. But checkGeomIntersections() takes all so called "pick candidates", which's bounds intersect the pick ray, and does a real triangles-pickray intersection test. The bounds test is only a cheap preselction, but it is not accurate. So if checkGeomIntersections() returns no result, your sphere is not actually picked (but the bounds are). I suppose, with "sets to 0" you mean, that the returned list is empty.

Well, I guess, your mouse is actually over the sphere. So it is a bug, that it is not picked. But is the geometry picked in the PickingLibraryTest?`(You should not use picking like in the PLTest, but better like in the ScheduledPickingTest)

btw. You can also eliminate the geom-pickray test by invoking
Code:
PickingLibrary.setGeometryIgnored( true );

Marvin
« Last Edit: 11. April 2007, 10:02:59 am by Marvin Fröhlich » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic