[vtkusers] Question about texture coordinate?
shrinivas kulkarni
kshrinivas at operamail.com
Fri Jun 11 01:14:50 EDT 2004
Hi Hui,
Apart from the classes you provided here, we can specify texture coordinates for each vertex independetly as follows:
pTCoords = vtkFloatArray::New();
pTCoords->SetNumberOfComponents( 2 );
pTCoords->SetNumberOfTuples( nNoOfPoints );
// (..for each point in polydata do this )
pTCoords->SetTuple2( nIndex, fX, fY );
// At the end assign this as TCoords to polydata.
pMeshPolyData->GetPointData()->SetTCoords( pTCoords );
Note that, assumption here is you use vtkPolydata.( I have played with only vtkPolydata for texture mapping).
Hope this helps you.
Thanks and regards,
Shrinivas
----- Original Message -----
From: "Hui Zhang (James)" <zhang at isis.imac.georgetown.edu>
Date: Thu, 10 Jun 2004 11:10:44 -0400
To: <vtkusers at vtk.org>
Subject: [vtkusers] Question about texture coordinate?
> Hi,
>
> I am trying to use the texture mapping in VTK. For example, I have some geometry shapes like triangle cells, for each vertex, we have different texture coordinate. So I want to set each point's coordinate like common OpenGL routine. But I find VTK only have vtkTextureMapToPlane vtkTextureMapToSphere vtkTextureMapToBox vtkTransformTexture vtkThresholdTextureCoords. So which one should be used for assign each point's coordinates? Anyone can provide a simple example for two triangles with user-specified texture coordinate?
>
> Thanks
>
Hui Zhang
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
--
_____________________________________________________________
Web-based SMS services available at http://www.operamail.com.
>From your mailbox to local or overseas cell phones.
Powered by Outblaze
More information about the vtkusers
mailing list