[Paraview] Use existing texture map for 3D surface
Eric E. Monson
emonson at cs.duke.edu
Tue Apr 20 12:09:02 EDT 2010
Hey Olumide,
If you're writing your data yourself and you already have texture coordinates calculated, then you shouldn't have to use my script at all -- you can just write the texture coordinates into your file and they will be loaded and ready to use when you open your vtp file. The script was useful in the case where someone was loading their data as comma-separated values and so the texture coordinate vector components were being seen by PV as individual scalar attribute arrays.
If you make that sphere in PV and run the Texture Map to Sphere filter, you can Save Data from PV and look at both the vtp and vtk format outputs. Texture coordinates will show up as two-component Point Data vectors in both formats, and there is an indicator that this vector, whatever you name it, is being used as the "official" texture coordinates for that polydata.
So, write your TCoords out properly in your files, forget the script, and enjoy! :)
Talk to you later,
-Eric
On Apr 19, 2010, at 11:18 PM, Olumide wrote:
> Hi Eric,
>
> Thanks for the example. I've textured my very first sphere :)
>
> I've taken another look at the VTK file format and I now realize that it is possible embed extra scalar (UV) <PointData> information in a VTK/VTP file (I'm a novice, but I'm learning).
>
> I've got a mesh with texture coordinates, and I can modify my external VTP file writer to embed texture coordinates in my VTP file, so that the programmable filter extracts it. Is this the correct approach? And will the line:
>
> Uarray = pdi.GetPointData().GetArray('U')
>
> in your script extract U coordinates in the file?
>
> Regards,
>
> - Olumide
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
More information about the ParaView
mailing list