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

    GetPixelInfoPoint trouble [SOLVED]

    SDK Help
    0
    3
    252
    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 19/12/2014 at 15:50, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   15,16 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      I'm using GetPixelInfoPoint in a tool to get information about vertexes of an object that are inside an area.
      The information is returned inside a ViewportPixel structure and the vertex is returned in variable i.
      But if the x,y coordinates provided in GetPixelInfoPoint don't match with any vertex of the object, the i variable returns 0.
      However, the x,y coordinates could match the vertex number 0 of the object.
      How can I know if a value of zero in the i variable means that there is no vertex in that coordinate or if it is reporting vertex number 0?

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

        On 20/12/2014 at 06:29, xxxxxxxx wrote:

        _<_t_>_ViewportPixel[URL-REMOVED]* GetPixelInfoPoint ( Int32[URL-REMOVED] x,
        Int32[URL-REMOVED] y
        ) <_<_t_>_

        Retrieves point information at the pixel position ( x , y ).
        Parameters
        | [in]| x| An X coordinate within the viewport. Must be  0  <=  x  <  w , where  w  is the width given to Init()[URL-REMOVED].

        [in] y A Y coordinate within the viewport. Must be  0  <=  y  <  h , where  h  is the height given to Init()[URL-REMOVED]_<_t_>_d>

        Returns
        The retrieved point information, or  nullptr  if no information could be retrieved. The ViewportSelect[URL-REMOVED] instance owns the pointed viewport pixel..

        check against nullptr not 0


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

          On 20/12/2014 at 12:59, xxxxxxxx wrote:

          Thank you, Mohamed.
          I made it work now 🙂

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