# PointInRange,Circle3D and maths

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 10/03/2003 at 12:49, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   8.012
Platform:      Mac OSX  ;
Language(s) :     C++  ;

---------
OK, so i have drawn a 3d circle (loop), i want to use it as a handle, possible? How? what maths?

Not only that but i want to know where on the circle the user clicked (in either degrees or percent from a start point). How do i do this

How do i change the "Hit Range" to make it greater or smaller depending on which handle i want to detect?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/03/2003 at 13:37, xxxxxxxx wrote:

Ok, mmm, off the top of my head (while I'm here on plugincafe), I'd use the SW() functions to create a ray that goes through the screen coordinates of the mouse, like:

``````

Vector p=bd->SW(Vector(mx,my,0));
Vector v=bd->SW(Vector(mx,my,1000))-p;

``````

then I'd find the intersection of that ray with the plane of your handle (circle is 2D so is in a plane, you just need a point and the plane normal), from this you can easily then check if it is within your handle and also find the angle (atan2() is the best function for this). The maths is very simply, intersection of a ray and plane is common practice and very basic vector maths (just basically some dot products with normals and points). If I get more time and you need I'll give more info, if you let me know which bit needs more info

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/03/2003 at 09:04, xxxxxxxx wrote:

thanks, that seems to make pretty good sense to me, i'll give it a shot, hopefully i'll be able to work out he math for the point of intersection on a plane with a little help form teh web (if not expect me back here soon).