Getting the height values from a greyscale bitmap

Started by
0 comments, last by aker_jus 21 years ago
I am trying to make a terrain engine and thus, I must retrieve the height values from the bitmap. This is my current code:

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
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
Advertisement
Drunken Hyena (www.drunkenhyena.com) has code that does this, as far as I recall. Take a look at it.

Cheers,
Muhammad Haggag

This topic is closed to new replies.

Advertisement