Page 1 of 1

collision with a sphere

Posted: Mon Jan 23, 2006 9:27 pm
by warden
hi there

i'm working on 3d user interface that features circular buttons.

as i'm not into 3d modeling, i'm planning to use simple rectangles with a circular texture and have the outer parts transparent

the problem is to check if the mouse hovers across such a widget:

a ray cast from mouse position into the scene should be the solution, but it would cause a collision even if the transparent part of the texture is being hit

is there a way to have a boundingsphere around a scenenode or something like it? or any other simple way to solve this problem...?

thanks for any help
warden

Posted: Mon Jan 23, 2006 9:40 pm
by pfo
If you can get the collision point, why don't you check the point's distance from the center of the button and do a radius test?

Posted: Tue Jan 24, 2006 7:41 am
by Guest
yeah youre right, I just woke up and had the same solution. keep it simple, stupid! :-D thanks!!