<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div>> Hi,</div><div>> I need to align a set of 3D points and would like to render the points separately as "non-aligned" and "aligned" data.</div><div>I have created an array of mappers and actors one for each set of points.<br>> Also have set opacity for each actor .But I could not establish the<br>> transparency among the different set of points before alignment.I can view<br>> only the last set of 3D points.<br>> Here is the code:<br>><br>> lm3Mapper=[]<br>> lm3Actor=[]<br>><br>> ren = vtk.vtkRenderer()<br>><br>> colors=vtk.vtkUnsignedCharArray()<br>>
colors.SetNumberOfComponents(4)<br>> colors.SetName("Colors")<br>> i=0<br>> for files in lm3List:<br>> lm3pts=get_3Dlandmark(files) #Get the 3D points in a numpy array<br>> lm3Point = vtk.vtkPolyData()<br>> lm3Point.SetPoints(gen_3DVTKPts(lm3pts)) #Create vtkPoints usingdouble<br>> array<br>> delny = vtk.vtkDelaunay3D()<br>> delny.SetInput(lm3Point)<br>> delny.SetTolerance(0.001)<br>> delny.Update()<br>><br>> usg=vtk.vtkUnstructuredGrid()<br>> usg=delny.GetOutput()<br>><br>> lm3Point1=vtk.vtkPolyData()<br>> lm3Point1.SetPoints(usg.GetPoints())<br>> lm3Point1.SetVerts(usg.GetCells())<br>># Also tried setting colour and scalar values for each point<br>><br>> scalars = vtk.vtkFloatArray()<br>>
scalars.SetNumberOfComponents(1)<br>>
scalars.SetName("3DLMK Scalars")<br>><br>> for s in range(22):# total no.of 3D points=22<br>> scalars.InsertNextValue(vtk.vtkMath.Random(0.0,1.0))<br>> colors.InsertNextTupleValue((0,255,0,128))<br>><br>> lm3Point1.GetPointData().AddArray(colors)<br>> lm3Point1.GetPointData().SetScalars(scalars)<br>><br>> lm3Mapper+= [vtk.vtkPolyDataMapper()]<br>> lm3Mapper[i].SetInput(lm3Point1)<br>> lm3Mapper[i].ScalarVisibilityOn()<br>> lm3Mapper[i].SetScalarModeToUsePointFieldData()<br>> lm3Mapper[i].SelectColorArray("Colors")<br>><br>> lm3Actor+=[vtk.vtkActor()]<br>> lm3Actor[i].SetMapper(lm3Mapper[i])<br>> lm3Actor[i].GetProperty().SetPointSize(6)<br>>
#lm3Actor[i].GetProperty().SetColor(200.0,0.0,0.0)<br>> #lm3Actor[i].GetProperty().SetOpacity(0.5)<br>><br>> ren.AddActor(lm3Actor[i])<br>> ren.SetBackground(0.0, 0.0, 210.0)<br>> i=i+1<br>><br>> Please throw light on this.<br>></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div class="y_msg_container"><div id="yiv2560522028"><div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; background-color: rgb(255, 255, 255);"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div dir="ltr"> </div><div dir="ltr">> -Judith<br><br><br></div> </div> </div> </div></div></div><br><br><var
id="yui-ie-cursor"></var></div> </div> </div> </div></body></html>