Fwd: Re: [vtkusers] Problem Interpreting z-buffer data. -- how to convert z-buffer values to quantitative measurements !!!!!!

Deepak Roy cdeepakroy at yahoo.com
Thu Dec 8 15:41:57 EST 2005


Hello clinton,
   
  Here is the loop which computes the difference with your suggestions incorporated....
   
    vtkMatrix4x4 *pMatrix = vtkMatrix4x4::New();
  pMatrix->DeepCopy( pOffScreenRenderer->GetActiveCamera()->GetCompositePerspectiveTransformMatrix(1,0,1) );
  pMatrix->Invert();

   
    for( int i = 0 ; i < wx ; i++ )
  {
    for( int j = 0 ; j < wy ; j++ )
  {
    long index = i * j;
  float coons_depth, sphere_depth;
  displayPoint[0] = i;
  displayPoint[1] = j;
   
  
  // get sphere z
  displayPoint[2] = pSphereZBuffer[index];
  pOffScreenRenderer->SetDisplayPoint( displayPoint );
  pOffScreenRenderer->DisplayToView();
  pOffScreenRenderer->GetViewPoint( viewPoint );
  pMatrix->MultiplyPoint( viewPoint , worldPoint );
  sphere_depth = worldPoint[2] / worldPoint[3];
   
  
  // get coons z
  displayPoint[2] = pCoonsZBuffer[index];
  pOffScreenRenderer->SetDisplayPoint( displayPoint );
  pOffScreenRenderer->DisplayToView();
  pOffScreenRenderer->GetViewPoint( viewPoint );
  pMatrix->MultiplyPoint( viewPoint , worldPoint );
  coons_depth = worldPoint[2] / worldPoint[3];
  
  double diff = ( sphere_depth - coons_depth );
  dblSphereVolume += diff;
  }
  }
  
  printf( "\ncomputed Sphere volume = %f\n" , dblSphereVolume );


Note: forwarded message attached.

			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051208/c4b879c7/attachment.htm>
-------------- next part --------------
An embedded message was scrubbed...
From: Deepak Roy <cdeepakroy at yahoo.com>
Subject: Re: [vtkusers] Problem Interpreting z-buffer data. -- how to convert
	z-buffer values to quantitative measurements !!!!!!
Date: Thu, 8 Dec 2005 12:36:29 -0800 (PST)
Size: 9913
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051208/c4b879c7/attachment.eml>


More information about the vtkusers mailing list