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

    UV coordinate to polygon?

    SDK Help
    0
    3
    275
    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

      On 01/07/2016 at 21:56, xxxxxxxx wrote:

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

      ---------
      Is there any easy way of converting a UV coordinate to a polygon index?

      Thus far, the only thing I've been able to figure out is to iterate over all the data of a UVWTag using the UVWTag::Get() function as described in the SDK documents, then test to see whether or not the UV coordinate I'm trying to locate actually falls within the triangle/quadrangle defined by the UVWStruct.

      This is, of course, very time consuming, since I have to iterate over all the polygons in the UVWTag each and every time my code executes. Is there some other quicker way of handling this?

      -CMPX

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

        On 02/07/2016 at 05:20, xxxxxxxx wrote:

        Howdy,

        Well, it sounds like the Neighbor class would help you there. 😉

        Adios,
        Cactus Dan

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

          On 04/07/2016 at 07:59, xxxxxxxx wrote:

          Hi CMPX,

          there is no function to achieve what you want.
          a) There's no direct 1:1 relation, there could be multiple polygons belonging to a single UW coordinate.
          b) There would be some additional data structures be needed to speed up such a look up and these do not exist.
          So it would need to be done internally in the same way you can do it on your own. Sorry.

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