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

    Phong normal for *any* position on poly?

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 271 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 02/01/2009 at 14:19, xxxxxxxx wrote:

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

      ---------
      Hi,

      using barycentric coordinates, I get random positions on the polygons of an object. Now I'd like to get the Phong normals for all these positions.

      I know, I can use CreatePhongnormals to get the Phong normals of all polygons, but that only gives me one Phong normal for each polygon, right? So how can I get a nice normal for every position *on* a polygon?

      Thanks for any help 🙂

      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 02/01/2009 at 19:44, xxxxxxxx wrote:

        Howdy,

        The CreatePhongNormals() function gives you an array of the normals at each point of each polygon (4*GetPolygonCount()). You use this along with the barycentric coordinates to interpolate the normal at the point on each triangular part of a quad.

        For the interpolated phong normal at a given point on a triangle I use this:

        > \> phongN = !(vertNormA \* bryCrd.x + vertNormB \* bryCrd.y + vertNormC \* bryCrd.z); \>

        Adios,
        Cactus Dan

        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 03/01/2009 at 03:38, xxxxxxxx wrote:

          Ah! Great! Thanks again, Dan!
          Now I can do what I want 🙂

          Greetings,
          Jack

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