[vtkusers] How to build depth map of a 3D model?
Bill Lorensen
bill.lorensen at gmail.com
Thu May 10 08:49:27 EDT 2012
Wenlong,
Thanks for adding an example to the Wiki that shows how to create a
depth map in VTK:
http://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ZBuffer
I made some minor style changes. Also, you'll notice
1) The use of SmartPointer's. This prevents memory leaks.
2) Replaced SetInput/GetOutput with SetInputConnection/GetOutputPort.
These changes work with both VTK5 and VTK6.
Thanks again,
Bill
On Wed, May 9, 2012 at 8:23 AM, David Doria <daviddoria at gmail.com> wrote:
> On Wed, May 9, 2012 at 8:20 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> vtkRenderWindow has methods
>> // Set/Get the zbuffer data from the frame buffer.
>> // (x,y) is any corner of the rectangle. (x2,y2) is its opposite corner on
>> // the diagonal.
>> virtual float *GetZbufferData(int x, int y, int x2, int y2) = 0;
>> virtual int GetZbufferData(int x, int y, int x2, int y2, float *z) = 0;
>> virtual int GetZbufferData(int x, int y, int x2, int y2,
>> vtkFloatArray *z) = 0;
>>
>
> Wenlong - this would be a great addition to the VTK examples wiki.
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
--
Unpaid intern in BillsBasement at noware dot com
More information about the vtkusers
mailing list