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

    Random Position on Surface?

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 315 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 29/07/2008 at 06:51, xxxxxxxx wrote:

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

      ---------
      Hi,

      is there a good (and fast) way to get a random position on a polygon object's surface, and maybe even the surface normal at that position?

      I didn't find anything in the SDK, maybe I just don't know what to search for.

      Thanks in advance for any tipps and hints!

      Greetings,
      Jack

      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 29/07/2008 at 07:12, xxxxxxxx wrote:

        The TP node "PSurfacePosition" does exactly what I want, but I need to implement it in C++. Is there any class I could have a look at which may help me with that?

        Thanks again,
        Jack

        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 29/07/2008 at 11:56, xxxxxxxx wrote:

          OK, I already got my answer. And a pretty good one, indeed 🙂

          Thanks anyway.

          Jack

          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 29/07/2008 at 13:00, xxxxxxxx wrote:

            Nice to hear you found a solution. Would you mind sharing what you found out?

            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 30/07/2008 at 12:33, xxxxxxxx wrote:

              Get a random polygon from the object, weight it according to its area (to prevent resulting random positions crowding on smaller polygons).

              The use random baricentric coordinates to get a position on the triangulated polygon.

              At first I wanted to do it with a GeRayCollider shootin' random rays at the geometry, but this way is much faster and less work to implement 🙂

              URL=http://en.wikipedia.org/wiki/Barycentric_coordinates\_(mathematics)]Wiki Link[/URL]

              Cheers,
              Jack[

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