D3DLOCKED_RECT rect;
tex->LockRect(0, &rect, NULL, 0);
if (rect.pBits)
land.HeightField = (BYTE*)rect.pBits; //the HeightField is type BYTE*
tex->UnlockRect(0);
My texture is created with D3DPOOL_MANAGED and 0 for usage.
Now that I have my data, How should I make a list of the heights?
Thanks
Getting the height values from a greyscale bitmap
I am trying to make a terrain engine and thus, I must retrieve the height values from the bitmap. This is my current code:
Drunken Hyena (www.drunkenhyena.com) has code that does this, as far as I recall. Take a look at it.
Cheers,
Muhammad Haggag
Cheers,
Muhammad Haggag
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement