[vtkusers] Texture mapping a cube

Bill Lorensen bill.lorensen at gmail.com
Tue May 24 11:11:48 EDT 2011


TextureMapToPlane only generates texture coordinated for planes or
nearly planar objects. A cube is not planar.

There are a couple of approaches.

1) Build your cube from six planes. Texture coordinates for each plane
can be genearted with TextuteMapToPlane
2) Imaginge your cube is unfolded. Create a texture map that
corresponds to the unfolded cube. Here is a website that shows a few
cube maps:
http://www.humus.name/index.php?page=Textures
Then you will need to generate your own texture coordinates.


On Tue, May 24, 2011 at 6:14 AM, sudhanshu gupta
<sudhanshugupta2511 at gmail.com> wrote:
> Hi
>
> I have tried to texture map a cube using texture mapping of plane .In that
> file vtkTextureMapToPlane.h there is SetOrigin,SetPoint1,SetPoint2. I dont
> understand how they are set by us.
> I tried to set them as simple coordinates I was not getting what i meant to
> be.
> like I take default cube of size x=1,y=1,z=1. and I tried to use
> vtkTextureMapToPlane by defining point1(0,0,0),point2(1,1,0) origin
> (0.5,0.5,0) but it was mapping the image on all over the cube scaling it.
>
> tell me if there is any way I can remove that.
>
> Thank you
>
> Sudhanshu
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list