[vtkusers] texture map to cube

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Thu May 6 20:57:24 EDT 2004


Dave,

> Is vtkTextureMapToBox any use?

S'funny you mention that, because I was going to suggest it, but look

-----------
Revision 1.12, Wed Sep 19 23:44:50 2001 UTC (2 years, 7 months ago) by
lorensen
CVS Tags: HEAD
Changes since 1.11: +2 -2 lines
FILE REMOVED
ERR: removed defunct class.
--------------
No wonder I couldn't find it!

However. If I remember correctly, this actually generates 3D texture coords,
by mapping r,s,t relative to the box corners. No use for our cube, so I'm
afraid Dean'll still have to knock one up. It wouldn't take long, just do
face 1
0-> width/4 : 1/3height -> 2/3 height
face 2
width/4->width/2 : 1/3height -> 2/3 height

etc etc for all 6, the top and bottom ones will have
0-height/3 and 2/3 height->height

you can simply read the values off the bad ascii art image in the previous
posts. Vertices can be shared at the corners except for the discontinous
points on the image (ie all the shared point on the unfolded image can be
shared, the others will need duplicating. Probably it'd be easier to just
redo CubeSource to output the texture coords initially)

JB




More information about the vtkusers mailing list