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
    • Recent
    • Tags
    • Users
    • Login

    Some kind of collision problem

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 319 Views
    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 Offline
      Helper
      last edited by

      On 16/10/2013 at 04:39, xxxxxxxx wrote:

      Hi there!

      Is there any way to check if a null object lies within a given arbitrary object? Not a simple object but rather deformed ones. Maybe some kind of collision detection can do the trick?

      Any advice would be great!

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

        On 16/10/2013 at 06:20, xxxxxxxx wrote:

        Depends on the complexity of your objects and what qualities you can assure about them
        (single hull / multiple hulls, normals facing outwards and so on). You have to tell us more 
        than one line. Until then the short answer is GeRayCollider.

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

          On 16/10/2013 at 06:48, xxxxxxxx wrote:

          For this technique, you have to make sure your object is closed and its normals are aligned
          correctly. You can send out a ray from an arbitrary position in world space into the direction of
          your point using the GeRayCollider. If the first surface's normal points towards the origin of your ray, your
          starting number is 0. If it points away from you, your starting number is 1.

          You can now count the number of surfaces they ray strikes through (including the first surface you
          have used to determine the starting number). If the count is odd, the point lies in the object.

          Best,
          -Niklas

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

            On 16/10/2013 at 22:24, xxxxxxxx wrote:

            Thanks for your quick help!GeRayCollider sounds like a good plan, I'll try that.
            For illustration I've made some quick picture to show you how my objects behave. In general I get some sort of mechanical parts out of a CAD program exported via VRML and import them in C4D for calculation and rendering purposes. A part of the calculations is mentioned collision calculation to dtermine if specific points lie within the given objects. Each object is imported as Polygon Object and it's normals face outwards as they should.
            I suppose that your approach will work with my given geometry so I'll try it as soon as possible!

            Greetings!

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