Picking using MouseEvent3D on model mesh which has been scaled

Software: Away3D 4.x

TheBard, Newbie
Posted: 27 July 2014 01:30 PM   Total Posts: 8

I’m having problems using MouseEvent3D to pick a humanoid mesh.

When I hover the mouse near the centre of the mesh, the picking works fine, however the picking does not trigger anywhere else on the mesh.

It occurs to me that that the picking could be triggered by the original size of the mesh (it has been scaled x50) and not the full size. 

The mesh is held within an objectContainer3D.  I have tried scaling the object container, or the mesh itself - and the picking acts the same way.

mesh.mouseEnabled=true;
mesh.addEventListener(MouseEvent3D.MOUSE_OVERmouseOverfalse0true);
mesh.addEventListener(MouseEvent3D.MOUSE_OUTmouseOutfalse0true);

container.addChild(mesh);

container.rotationY angle;
container.x;
container.y;
container.z;
         
//mesh.scale(50)    
container.scale(50);

scene.addChild(container); 

I tried running the program without the scaling and the mesh was tiny.  Hovering the mouse over it produced no pickings.  It could be that the scaled down mesh and the scaled up mesh have the same relative area of selectable mesh, roughly in the centre or abdomen area, and the smaller mesh was just so tiny I couldn’t find this area with the mouse.

Something seems to have gone wrong with the bounding areas, any ray of light people could shine on this would be appreciated!

Update:  I used

mesh.showBounds true 

to highlight the mesh.bounds being used for the picking - and it shows that the original (small) size position and orientation of the mesh is being used for the picking

- how can I get the picking mechanism to use the up to date size and position of the mesh?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X