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

    UV coordinates to position vector

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 233 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 20/08/2014 at 10:34, xxxxxxxx wrote:

      Hi guys,

      I'm trying to reverse lookup a position in space based on the UV coordinates of an object. The way I'm doing it now is loop through the UVW tag and compare each polygon/point's UVW coordinate to the one I'm looking for, and pick the closest. For obvious reasons this is far from accurate (on a low poly object it can be all over the place...). Have I overlooked some straight forward UVW > Position conversion somewhere?

      Thanks!

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

        On 21/08/2014 at 12:06, xxxxxxxx wrote:

        Hello,

        I don't think there is a specific function to get a position from a set of UV-coordinates. This because a set of UV-coordinates can be found at various positions in space. Take Cinema's "Cube" primitive as an example. Each polygon has the exact same set of UV-coordinates, so any specific UV-set would be found on every polygon.

        So what you need to do is to check if your given UV-coordinate is inside a specific polygon. If so you could calculate the position. One way may be to calculate the barycentric coordinates of your UV-set. With that barycentric coordinates you would be able to get the correct position from the polygon's vertices.

        Best wishes,
        Sebastian

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