Sprite3D MouseEvent3D

Software: Away3D 4.x

cub, Newbie
Posted: 30 August 2012 02:49 PM   Total Posts: 3

Hi,

I have a problem with the MouseEvent3D on Sprite3D (@Away3D 4.0.9). All MouseEvent3D works badly… more the Sprite3D is far from the camera, more the “hitbox” is small. But with a normal mesh cube it works fine. What’s wrong ?

var spriteSquareMaterial:ColorMaterial = new ColorMaterial(0xFFFF00);
// with Sprite is works bad
var sprite3DSquare:Sprite3D = new Sprite3D(spriteSquareMaterial256256);
sprite3DSquare.600;
sprite3DSquare.0;
scene.addChild(sprite3DSquare);

// with normal Mesh it works well
var cube:Mesh = new Mesh(new CubeGeometry(), spriteSquareMaterial);
cube.600;
cube.200;
scene.addChild(cube);

// listeners
sprite3DSquare.mouseEnabled true;
sprite3DSquare.addEventListener(MouseEvent3D.CLICKpwetClick);
sprite3DSquare.addEventListener(MouseEvent3D.MOUSE_OVERpwetOver);
sprite3DSquare.addEventListener(MouseEvent3D.MOUSE_OUTpwetOut);
cube.mouseEnabled true;
cube.addEventListener(MouseEvent3D.CLICKpwetClick);
cube.addEventListener(MouseEvent3D.MOUSE_OVERpwetOver);
cube.addEventListener(MouseEvent3D.MOUSE_OUTpwetOut); 
   

Ontheronix, Jr. Member
Posted: 02 September 2012 08:51 AM   Total Posts: 37   [ # 1 ]

What do you mean with ‘works badly’?

   

cub, Newbie
Posted: 05 September 2012 07:40 AM   Total Posts: 3   [ # 2 ]

The hitbox is smaller than the sprite3D displayed. If the sprite is close to the camera, the difference is small. But more the sprite3D is far from the camera, more the difference is great.

   

Donny, Jr. Member
Posted: 06 September 2012 06:00 AM   Total Posts: 34   [ # 3 ]

I had a similar problem. I instead placed both the Sprite3D and a Sphere within an ObjectContainer3D and listened for selection on the Sphere instead. As the Textures I used for the Sprite3D were circular in shape, this worked fine.

   

cub, Newbie
Posted: 06 September 2012 03:34 PM   Total Posts: 3   [ # 4 ]

Yeah thanks for this trick.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X