<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2716.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>hi all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I m trying to simulate bump mapping on a sphere by 
changing the normals in a random manner. I actually make a vtkFloatArray with 
random numbers and copy that array with the SetNormals to a vtkPointData of the 
sphere. <BR>The methode doesnt work. What I m I doing wrong?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>kind regards</FONT></DIV>
<DIV><FONT face=Arial size=2>Stijn </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=1>
<P>#------------------------------ <BR># BUMP 
MAPPING<BR>#------------------------------ </P>
<P><FONT face=Arial size=2># create the sphere<BR></FONT>vtkSphereSource 
bump<BR>&nbsp;&nbsp;&nbsp; bump SetThetaResolution 20<BR>&nbsp;&nbsp;&nbsp; bump 
SetPhiResolution 20<BR>&nbsp;&nbsp;&nbsp; bump SetRadius 
1.8<BR>&nbsp;&nbsp;&nbsp; bump Update </P>
<P>vtkPolyDataNormals qqq <BR>&nbsp;&nbsp;&nbsp; qqq SetInput [bump GetOutput] 
<BR>&nbsp;&nbsp;&nbsp; qqq ComputePointNormalsOn <BR>&nbsp;&nbsp;&nbsp; qqq 
Update </P>
<P></P>
<P>vtkPolyData pDatat<BR>&nbsp;&nbsp;&nbsp; set pDatat [bump GetOutput] 
<BR>&nbsp;&nbsp;&nbsp; puts [$pDatat GetNumberOfPoints]<BR>&nbsp;&nbsp;&nbsp; 
pDatat Update</P>
<P></P>
<P>vtkPointData pData1 <BR>&nbsp;&nbsp;&nbsp; set pData1 [[[qqq GetOutput] 
GetPointData] GetNormals]&nbsp; #get the normals data<BR>&nbsp;&nbsp;&nbsp; puts 
[$pData1 GetNumberOfTuples ]<BR>&nbsp;&nbsp;&nbsp; pData1 Update</P>
<P>vtkFloatArray floatArrayNormals<BR>&nbsp;&nbsp;&nbsp; vtkMath rand 
<BR>&nbsp;&nbsp;&nbsp; floatArrayNormals SetNumberOfComponents 3 
<BR>&nbsp;&nbsp;&nbsp; floatArrayNormals SetNumberOfTuples 362 </P>
<P><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR>for {set i 
0} {$i&lt;362} {incr i} { <BR>&nbsp;&nbsp;&nbsp; floatArrayNormals 
InsertNextValue [rand Random 0 1]<BR>&nbsp;&nbsp;&nbsp; # puts 
[floatArrayNormals GetValue $i]<BR>} </P>
<P>puts [floatArrayNormals GetNumberOfTuples]<BR><BR>&nbsp;&nbsp;&nbsp; pData1 
SetNormals floatArrayNormals <BR>&nbsp;&nbsp;&nbsp; pData1 Update 
<BR>&nbsp;&nbsp;&nbsp; pDatat Update<BR>&nbsp;&nbsp;&nbsp; qqq 
Update<BR>&nbsp;&nbsp;&nbsp; bump Update<BR><BR>vtkPolyDataMapper 
bumpMapper<BR>&nbsp;&nbsp;&nbsp; bumpMapper SetInput [bump 
GetOutput]&nbsp;<BR><BR>vtkActor bumpActor<BR>&nbsp;&nbsp;&nbsp; bumpActor 
SetMapper bumpMapper<BR>&nbsp;&nbsp;&nbsp; [bumpActor GetProperty] SetColor 0.9 
0.1 0.15 <BR>&nbsp;&nbsp;&nbsp; bumpActor SetPosition 2.5 1.6 2.55 
<BR>&nbsp;&nbsp;&nbsp; eval [bumpActor GetProperty] 
SetInterpolationToGouraud</P></FONT></DIV></BODY></HTML>