I'm new to game development and XNA. I have this depthmap image and I want to render it in 3D, how do I do it, any tutorial or blog post would be helpful.
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
Load a texture:
Put the texture data into a color array:
Iterate the array to generate vertices:
Follow this article to draw them: http://msdn.microsoft.com/en-us/library/bb196414.aspx Or examine this tutorial project: http://xbox.create.msdn.com/en-US/education/catalog/sample/primitives_3d |
|||
|
|
|
For a simple vizualisation you can create plane mesh tessalated in you depth buffer resolution (for example 1024x728 vertices). If the plane is in xz axis, move vertices in y axis based on values in depth buffer. You can also use near and far plane information to have correct depth range and if you use perspective camera, you should take into account FoV angle too. |
|||
|
|
