Jump to content
  • Advertisement
Sign in to follow this  
Thomo

D3D: Textures and rgb values

This topic is 4490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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,.

Share this post


Link to post
Share on other sites
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_width
y = ty_of_vertex * texture_height
DWORD color = texture_data[y * texture_width + x]


tx and ty are your respective texture coordinates.

Share this post


Link to post
Share on other sites
Sorry, my post wasa bit convoluted.

But you have described what I needed.

Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!