Ok, it appears to be working now. I had to normalize rayDir before assigning it to ray.dir.
On Aug 7, 11:42 am, abowman <[email protected]> wrote: > Now I'm trying the Ray class. > > I created a Ray, added the camera position as the origin, and this as > my scene mouse down handler: > > public function sceneMouseDown(e:MouseEvent3D):void { > > rayDir.x = e.sceneX - ray.orig.x; > rayDir.y = e.sceneY - ray.orig.y; > rayDir.z = e.sceneZ - ray.orig.z; > > ray.dir = rayDir; > > var intersect:Boolean = > ray.intersectBoundingRadius(myTestObject.position, > myTestObject.boundingRadius); > > trace("intersect="+ intersect); > > } > > ray.intersectBoundingRadius always returns true no matter where I > click. Can someone tell me how to make this work correctly? > > On Aug 7, 10:54 am,abowman<[email protected]> wrote: > > > > > Can someone here recommend and alternate method for detecting a mouse > > down event on a 3d object? > > > I'm doing something else now and it works until the object moves past > > a certain point in my scene. > > > I've seen that some people have been using the Ray helper class. Is > > there an example anywhere for using getIntersect or > > intersectBoundingRadius to detect whether the mouse is over an object? > > > Thanks > > > On Aug 6, 8:33 am,abowman<[email protected]> wrote: > > > > It turns out the problem was caused by nesting the object inside of > > > two ObjectContainer3Ds. It's working to some degree now that it's > > > inside of one ObjectContainer3D. > > > > What I'm doing is creating a ball that I can pick up and throw. For > > > some reason, it doesn't register a click when the ball is moving > > > (unless it's very slow). Sometimes it breaks completely. > > > > On Aug 5, 9:13 am,abowman<[email protected]> wrote: > > > > > Unfortunately, it doesn't. I'm not setting screenZOffset at any point > > > > in my code. > > > > > On Aug 5, 8:48 am, savagelook <[email protected]> wrote: > > > > > > is this thread > > > > > helpful:http://groups.google.com/group/away3d-dev/browse_thread/thread/806be6... > > > > > > On Aug 5, 8:18 am,abowman<[email protected]> wrote: > > > > > > > MouseEvent3D > > > > > > > On Aug 5, 8:14 am, savagelook <[email protected]> wrote: > > > > > > > > Are you using MouseEvent or MouseEvent3D? > > > > > > > > On Aug 5, 7:35 am,abowman<[email protected]> wrote: > > > > > > > > > How can I get a mouse down event listener to work on an object > > > > > > > > that > > > > > > > > has ownCanvas set to true?
