New topic in General: selecting vector objects under mouse click
marcus - Sun Mar 30, 2008 11:05 am <http://forums.realsoftware.com/viewtopic.php?t=21529> hi, im trying to make a simple 2d cad program and have been wondering what the best way to approach this problem is. Suppose I have several lines, arcs, circles occupying an area on the screen, and I want to select one of them for editting, I need to test what object lies under the mouse pointer. I'm guessing that the best way to do this is to send out a ray - as say a 10 pixel circle - from the mouses' x&y position and see if any objects intersect the circle. If this is the best way to go - do you need to check every object in the scene with the ray? Im storing the objects in an array, so perhaps you could exit the routine when the first intersect is discovered - but I was wondering if there was any other way of doing this. -- Over 900 classes with 18000 functions in one REALbasic plug-in. The Monkeybread Software Realbasic Plugin v8.1. <http://www.monkeybreadsoftware.de/realbasic/plugins.shtml> [email protected]
