D3D: Textures and rgb values
I have a d3dmesh and a d3dtexture.
Does anybody know how to retrieve the rgb values associated with a particualr vertex???
Can't find anything in the MSDN cetnre.
Thanks,.
Kind of unclear what exactly you're trying to accomplish, but if you want to get the rgb value of the texture that's associated with a particular vertex, then you just get the texture coordinates of that vertex and calculate which texel it represents on your texture.
(assuming 32 bit textures)
tx and ty are your respective texture coordinates.
(assuming 32 bit textures)
x = tx_of_vertex * texture_widthy = ty_of_vertex * texture_heightDWORD color = texture_data[y * texture_width + x]
tx and ty are your respective texture coordinates.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement