Sampling a texture from UVW Coords?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/03/2009 at 15:48, xxxxxxxx wrote:

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

    ---------
    Hi,

    in my plugin object, I want to evaluate the color channel of the first material attached. It's not about rendering, my object should do certain things according to the texture color.

    I saw lots of threads about Bitmaps and even more threads about UV coordinates here, but I still have no clue. I don't even know where to start my research.

    Let's say, I have a position on a plane. Any position, maybe it's a vertex point of the mesh, maybe it's a random position on a polygon (determined by barycentric coordinates). How can I find out the color of the applied material at this position?

    Textures (and maybe 2D shaders) will be sufficient, no need to evaluate fancy volume shaders like SLA. Also, I just need UVW Mapping, other mapping are not required (well, if they're easy, I will implement them, too ;-) ).

    Thanks in advance for help!! I really have no idea where to start.

    Greetings,
    Jack



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/03/2009 at 20:24, xxxxxxxx wrote:

    you could probably do it with

    > GetPixel( x, y ) \> \> [vector] GetPixel([int] x, [int] y); \> \> Returns the color in the bitmap at the position given by x and y. If not 0<=x<width and 0<=y<height, the function returns NIL. \>

    this is just what i found from the doc's so it might not be what you need. (not a coffee expert)


Log in to reply