displaying z buffer

hello,
i am relatively new to programming and completely new to OF, xCode, C++, etc.

i am working on different screen displays using depth information. what i am trying to do is display/record the depth information of a 3D model as a grayscale image (kind of like the input from the kinect). i will then use this array for something else.

i have been looking through the 3DModelLoaderExample for OF 0.062 but don’t understand everything that’s going on.
do I get the information from the model3DS.cpp? would it be vertexZ? vertices?

thanks for any advice.

this image comes from Rhino

Sorry but i don’t see the mistake, or don’t understand the question,

To me, depth information is an image representing the distance of each point of your 3D shape,
More far from your camera you are, more black the render image is.
You can maybe set the contrast if you set the near plane and the far plane of your 3D camera.

Your grayscale image seems correct relative to your shape.

Can you re-explain your difficulties…

OK, i understand,

http://fr.wikipedia.org/wiki/Z-buffer

You can close your 3D scene to have the “real” distance information, because Z-buffer just render vertex from a shape.
You can also try to look about the near/far planes and invert both to have white at the end of your 3D world.

Seb, trying to help :confused:

sorry, I didn’t specify… the image i posted comes from Rhino.
what i’d like to do is display this kind of image with OF. but i don’t know where to get the Z info.

One way is to render your 3d-scene into a FBO, and read back the depth-texture from the GPU.

ok. fbo and gpu sound sexy.
how should i proceed?

Hi everybody,
I recall this post because I am a newbie and I have the same problem.
thank you for your help

Hello, I didn’t see this question so i made a similar one, can you please write here if and how you solved this? Thanks