0

I am new to MATLAB and am wondering if anybody could help me with this (probably basic) question:

I would like to view/save the depth value for each screen pixel (the z-buffer) of a 3D surf(), ideally in a file. I have read Using OpenGL in Matlab to get depth buffer which was helpful but I can't seem to figure out how to save the buffer values instead of just outputting them as an image.

Any help with this would be greatly appreciated.

Community
  • 1
  • 1
  • Hi and welcome to SO! If you read the accepted answer to that question carefully, you will notice the line `imshow(depthMap, []);` in the function `trytodisplaydepthmap`. This displays the depth data captured in the matrix `depthMap` as an image. Just change this function to do with the data what ever else you want to do. – A. Donda Apr 08 '15 at 17:54
  • possible duplicate of [Using OpenGL in Matlab to get depth buffer](http://stackoverflow.com/questions/8862467/using-opengl-in-matlab-to-get-depth-buffer) – A. Donda Apr 08 '15 at 17:55

0 Answers0