is it possible to do precise mouse click on png transparent texture

Software: Away3D 4.x

ddmsama, Jr. Member
Posted: 02 January 2013 04:34 PM   Total Posts: 34

we wonder if it is possible to do precise mouse click on png transparent texture?
That means not to detect mouse event on the transparent part of the, for example, png texture on sprite3D object.
This is useful and important when doing 2d and 3d combine situation.
is there a pixel hittest to use in away3d?


Thanks a million if anyone can cast us some guide light on this matter.

   

Avatar
80prozent, Sr. Member
Posted: 03 January 2013 07:08 PM   Total Posts: 430   [ # 1 ]

hi

the mouseevent3d gives you the uv-coordinate you clicked on.
using this uv-coordinates you can detect the alpha-value you clicked on.

hope that helps

 Signature 

sorry…i hope my actionscript is better than my english…

   

Ben, Newbie
Posted: 13 March 2013 08:32 PM   Total Posts: 5   [ # 2 ]

I agree with that, but how to click on an object which is behind it and we can see thanks to the alpha channel?

   

beers, Member
Posted: 13 March 2013 09:06 PM   Total Posts: 53   [ # 3 ]

Thats a good question. I had a similar problem a while ago, and never found a solution.

I think you need to find exactly what ‘picking’ code is being run on a mouseDown3D, and use that directly.

So when you’ve clicked on a transparent part of your model (via uv), you could continue picking the models behind it by running the ‘picking’ code directly.

I’ve no idea what code does the picking, but I imaging it involves raycasting. I’d love to hear back if you find a solution.

beers

   

Ben, Newbie
Posted: 13 March 2013 09:11 PM   Total Posts: 5   [ # 4 ]

I’m not a jedi enough with away3D to solve this kind of problem wink
I think it is very important to be able to check this in a 3D interface project. I hope the away3D Jedis have this in their mind.
I’ll change a bit my design to solve it…

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X