<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Dear all,</div><div><br>I've tried to texture map an .obj file using the PNG file.<br>But I could not see the texture after rendering.Here is my code:</div><div>*************************************************<br>from vtk import *<br>object = vtkOBJReader()<br>object.SetFileName('aa.obj')<br>objectMapper = vtkPolyDataMapper()<br>objectMapper.SetInputConnection(object.GetOutputPort())<br>objectActor=vtkActor()<br>objectActor.SetMapper(objectMapper)</div><div># Read the image data from a file<br>pngreader = vtkPNGReader()<br>pngreader.SetFileName('aa.png')<br>pngreader.Update()<br> </div><div># Create texture object<br>texture = vtkTexture()<br>texture.SetInputConnection(pngreader.GetOutputPort())<br>texture.InterpolateOn()<br>objectActor.SetTexture(texture)</div><div>ren =
vtkRenderer()<br>ren.AddActor(objectActor)</div><div>.<br>.<br>.<br>***********************************</div><div>How can I view the texture on the top of the .obj file.Pls throw light on this</div><div>Thank you<br></div></div></body></html>