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

    Ray Collider

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 280 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

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

      On 26/04/2010 at 00:19, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi,

      first of all, im kind of new in programming plugins in Cinema4D. But i have a question, where i cant find anything related to in the internet.

      Im using the GeRayCollider to get to know if a certain area is illuminated by a source of light (sun). If the plugin emits a ray from a specific point there are at least four intersections found, although there should be only one. The first three intersections are the startingpoint of the ray. Faces, which are hit by the ray, are sometimes counted twice. I havn't foundd any solution yet.

      If someone knows why this happen, it would be very nice to give me a hand.

      Cheers
      Falk

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

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

        On 26/04/2010 at 02:52, xxxxxxxx wrote:

        Please post some example code and maybe test scenes showing the problem.

        cheers,
        Matthias

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

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

          On 01/06/2010 at 07:26, xxxxxxxx wrote:

          Hi,

          i found a solution to my problem posted above. Right now i have another one, related to the first one.

          I still want to know if a point is shadowed by another object. There are now problems with the object MoonTerrain. But whenever the plugin checks MoonTerrain, there is no intersection found, although there should be.

          Here is an abstract of my code

            
            
          Bool shadow = ray->Init(MoonTerrain); //MoonTerrain is a polygonised BaseObject   
            
          shadow = ray->Intersect(c,Sun,Sun_Laenge,FALSE); -> shadow is always FALSE, i believe here is the major problem, but i dont know how to fix it :(   
          //c = position of ray origin   
          //Sun = direction   
          //Sun_Laenge = length of ray   
            
          if (shadow)   
          {   
            
          long hits = ray->GetIntersectionCount();   
          //... do something more, but shadow is always FALSE   
          }   
            
          //checks if moon station shades itselfs   
          shadow = ray->Init(MoonStation);   
          shadow = ray->Intersect(c,Sun,Sun_Laenge,FALSE);   
          if(shadow)                                           
          {   
          long hits = ray->GetIntersectionCount();   
          // true -> here i dont have any problems ...   
          }   
          

          I hope, that someone understood the problem. Thanks for your help

          [EDIT]: Ups, my ray lenght was zero, i checked everything, except this one. 😞

          Cheers
          Falk

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