[vtkusers] Texture Mapping

Sathya Krishnamurthy skrishna at cscs.ch
Wed Jun 14 14:07:12 EDT 2000


Ciao

it is not a straight forward solution texture mapping a 3ds file in vtk


i had a hack some time back..

i did somethink like this..

from renderwindow i went back to polydata and then assigned the texture
and then added the texture + polydata to the scene

may be somebody has better solution..

cheers
~sathya
-----------
vtk3DSImporter mano
mano SetFileName "scocca.3ds"
mano SetRenderWindow renWin
# first create the 3Ds actor
mano Update


set actorlist [[mano GetRenderer] GetActors]

$actorlist InitTraversal

#get the polydata.. basically i do a 
# reverse engineering..

set thePolyData [[[$actorlist GetNextItem] GetMapper] GetInput]

# now read the bmp file..
vtkBMPReader pnmReader
  pnmReader SetFileName "cscs.bmp"

vtkTexture atext
  atext SetInput [pnmReader GetOutput]

vtkTextureMapToPlane ntext
  ntext SetInput $thePolyData
 
vtkDataSetMapper manoMapper
  manoMapper SetInput [ntext GetOutput]

vtkActor manoActor
  manoActor SetMapper manoMapper
  manoActor SetTexture atext

# Add the New Textured Top
ren1 AddActor manoActor

#may be you want to remove the old actor..

------------------------------------------------------------------
Sathya Krishnamurthy
Research Scientist  , CSCS
Galleria 2 , Via Cantonale
CH - 6928 , Manno Switzerland
Ph: 41-91-6108260 ----- mobile: 41-76-574-0069
------------------------------------------------------------------
The views, opinions and information contained in this message do not
necessarily reflect the opinions or policies of CSCS, nor does
publication of this information imply an endorsement by CSCS.







More information about the vtkusers mailing list