D3D: Textures and rgb values

Started by
1 comment, last by Thomo 17 years, 11 months ago
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,.
Advertisement
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)
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.

[size=2]aliak.net
Sorry, my post wasa bit convoluted.

But you have described what I needed.

Thanks.

This topic is closed to new replies.

Advertisement