|
From: Roger H. <rog...@mi...> - 2004-07-02 12:58:52
|
On Thursday, July 1, 2004, at 10:50 pm, Dair Grant wrote: > >>> I have been investigating why my program is so slow when a user does >>> a marquee selection. I set up a reasonable test case of 50 to 60 >>> spheres and pulled out a rectangle around about 80% of the spheres. >>> Quesa returned about 28000 hits, and my program works through the >>> list asking for the data on each of the hits in turn. >> >> How did 50 to 60 spheres turn into 28000 hits? What kind of hit data >> are you asking for? > > Yes, that does seem very high: presumably you use a window rect to > implement the selection, in which case you'd expect the number of hits > to be <= the number of objects in the scene? I set up my PickData thus: TQ3WindowRectPickData myWPPickData ; myWPPickData.data.sort = kQ3PickSortNone ; myWPPickData.data.mask = kQ3PickDetailMaskPickID | kQ3PickDetailMaskPath ; myWPPickData.data.numHitsToReturn = 0x7FFFFFFF ; // I want all the objects myWPPickData.rect.min.x = newFrame.left ; myWPPickData.rect.min.y = newFrame.top ; myWPPickData.rect.max.x = newFrame.right ; myWPPickData.rect.max.y = newFrame.bottom ; I ask for the path, but actually only use the rootGroup and element zero of the returned array. I just tried out removing kQ3PickDetailMaskPickID but it made no difference. In this test, my spheres are actually 25 x 13 vertex TriGrids which I guess are being split up into 650 triangles each. 650 x 60 = 39000 so it sounds like that is what's happening. It could be that the problem has already been fixed in the latest CVS source but I don't remember anything being checked in which sounded relevant since my branch divided. Roger. |