Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    PointInRange,Circle3D and maths

    SDK Help
    0
    3
    313
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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 🙂

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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).

          1 Reply Last reply Reply Quote 0
          • First post
            Last post