Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 05:18:17 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)[SOLVED] Weird picking issue with lines
Pages: [1]
Print
Author Topic: [SOLVED] Weird picking issue with lines  (Read 293 times)
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« on: 21. April 2011, 10:58:24 pm »

Marvin,

So, I'm near my sanity's end on this issue.

Background

My scene graph consists of TransformGroups, each of which contains some number of Shape3D-derived objects (Line, Sphere, etc.) and TransformGroups as defined above (so, tree of TransformGroups which occasional Shape3Ds).

Problem

When I try to select certain groups by using a NearestPickListener (think that's the name), I'm unable to get any selection. Now, if I have no lines, selection works fine, and I am able to pick objects in the scene. However, when there are Line objects, in some cases I am unable to pick anything in the scene, including objects which are above the afflicted nodes in the scenegraph (which should be unaffected if it were just a bad local transform or bounds or something).

Any ideas about this?
Also, what is a PickHost and what is it for?
« Last Edit: 27. April 2011, 05:04:43 pm by ChrisE » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 22. April 2011, 10:46:39 am »

PickHost: IF you have a complex object O built from several Shape3Ds, you might only want to get notified of O to get picked. So if you set O as the PickHost to all the contained shapes and one of these shapes gets picked, the pick listeners are notified, that O was picked.

It doesn't matter for the picking algorithm, if an object is "above" another. It won't get tested first. The order is computed later. So, if there is a bug, that keeps the picking algorithm from working correctly with a specific object, if might mess up picking before a closer object gets tested.

Lines have been an issue for picking in the past, because they have no geometrical size. They need a special pick test. This might be buggy.

Could you please build a small testcase for me?
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #2 on: 27. April 2011, 05:03:02 pm »

So, funny thing... if one of the coordinates of the line is a NaN, the bounding volume for the line becomes filled with NaNs as well. And during the recursive calculation of the BVH for the scene, you get even more NaNs.

So, I fixed my code to reject malformed points, and all works again. However, we might want to consider skipping over the inclusion of NaN bounds in the BVH code.

-Chris
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic