[vtkusers] How to find specific point's normal....?

renlishen renlishen at gmail.com
Thu Apr 8 11:01:48 EDT 2010


David, thanks for your reply
I'm using 
=============================================================================
vtkFloatArray *PointNormalArray = vtkFloatArray::SafeDownCast(
mCubes->GetOutput()->GetPointData()->GetNormals() ) ;
float Normal2[ 8000 ] ;
float *pTR = Normal2 ;
for( int i = 0 ; i < PointNormalArray->GetNumberOfTuples() ; i++ )
	{
		PointNormalArray->GetTupleValue( i, pTR ) ;
		pTR+=3 ;
	}
===============================================================================
to get normals.
But I don't know how to assign the GetTupleValue to my point data set...
I try to use point ID to find normal, but some error happen...
My data set is 
	vtkImageData *ImageDataSrc = vtkImageData::New() ;
	ImageDataSrc->SetDimensions(512, 512, 512) ;
	ImageDataSrc->SetScalarType(VTK_UNSIGNED_CHAR) ;
	ImageDataSrc->AllocateScalars() ;
             .....
             .....
compute normal by
	vtkMarchingCubes *mCubes = vtkMarchingCubes::New() ;
	mCubes->SetInput( ImageDataSrc ) ;
	mCubes->SetValue( 0, 100 ) ;
	mCubes->ComputeNormalsOn() ;

for example: if I want to know the point( 236,236,236 )'s normal...
how can I get it~?

thanks again...

RenLi~
-- 
View this message in context: http://old.nabble.com/How-to-find-specific-point%27s-normal....--tp28178612p28179906.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list