Re: LANG: repeating textures

Gavin Bell ([email protected])
Wed, 6 Dec 1995 14:18:57 -0800


On Dec 6, 1:07pm, Adrian Scott wrote:
> How do you make a texture repeat like wallpaper or fabric,
> rather than scaling itself to fit the size of the poly?

> How would one create a cube with a repeated
> wallpaper paper texture on it? I though it'd be as simple
> as (the following VRML fragment):
>
> Texture2 { filename "wallpaper.gif" }
> Cube { }

The texture coordinates at the vertices of a cube range from 0.0 to 1.0
(e.g. lower-left-front vertex of front-face has tex coords (0,0),
upper-right-front vertex of front face has tex coords (1,1)).

Texture2Transform can be used to scale these texture coordinate. You'll
only get repeated textures if the texture coordinate are greater than 1
(or less than zero). So:
Texture2 { filename "wallpaper.gif" }
Texture2Transform { scaleFactor 3 3 }
Cube { }

should give you these by these (9) copies of wallpaper across each face of
the cube.

That's equivalent to giving texture coordinates of (0,0) to (3,3) over a
cube-shaped IndexedFaceSet.

-- 
--gavin     ([email protected],  (415)933-1024)
My home page:  http://reality.sgi.com/employees/gavin_engr/
Inventor Info: http://www.sgi.com/Technology/Inventor.html
WebSpace Info: http://www.sgi.com/Products/WebFORCE/WebSpace

  • Next message: Jan Hardenbergh: "RE: LANG: repeating textures"
  • Previous message: Marc de Groot: "Re: Java? Ja no va."
  • Next in thesad: Christopher Fouts: "Re: LANG: repeating textures"