RE: LANG: repeating textures

Jan Hardenbergh (jch@nell.oki.com)
Wed, 06 Dec 95 17:36:00 E


>> 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 { }

You cannot with Cube. Cube states that the entire texture goes on each face.

From: "Cindy Reed" <cindy@shark.ywd.com> suggests using Texture2Transform
but that seems too easy. :-)

In order to wrap, you need texture coordinates outside of 0..1, so
try this out:

Texture2 { filename "ip.gif" }
Separator {
Coordinate3 {
point [
1 1 1, -1 1 1, -1 -1 1, 1 -1 1,
1 1 -1, -1 1 -1, -1 -1 -1, 1 -1 -1]
}
TextureCoordinate2 {
point [ 3 3, 0 3, 0 0, 3 0, 0 1, 1 1, 1 0, 0 0]
}
IndexedFaceSet {
coordIndex [ 0, 1, 2, 3, -1,
0, 1, 5, 4, -1,
0, 3, 7, 4, -1,
6, 2, 1, 5, -1,
6, 7, 3, 2, -1,
6, 5, 4, 7, -1
]
}
}

Looks pretty strange going from 3x to 1x on the sides, but that's
just so I could tell which end was which.

YON, jch@oki.com, Jan C. Hardenbergh, Oki Advanced Products 508-460-8655
www.oki.com/people/jch/ =|= 100 Nickerson Rd., Marlborough, MA 01752
Imagination is more important than knowledge - Albert Einstein (1879-1955)


  • Next message: Marc de Groot: "Re: Java? Ja no va."
  • Previous message: Gavin Bell: "Re: LANG: repeating textures"
  • Next in thesad: Adrian Scott: "RE: LANG: repeating textures"