GetPixelInfoPoint trouble [SOLVED]
-
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? -
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 toInit()
[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. TheViewportSelect
[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.
-
On 20/12/2014 at 12:59, xxxxxxxx wrote:
Thank you, Mohamed.
I made it work now