Re: LANG: syntax for image files

Reb Matrix (matrix@inch.com)
Fri, 13 Oct 1995 14:01:59 -0400 (EDT)


Paul was nice enough to take the time to send me the following
code in response to my question about how to "paste" an image (from a
.bmp or other image file) onto one side of a cube in my .wrl file. Since
I am just getting started with VRML, I don't understand much of what's
here, and I don't know where to find the esserence material. Could someone
explain, for example, what Coordinate3 is? Is it a user-defined variable?
What about ShapeHints, what is this? Any help would be much appreciated.

> Coordinate3 { point [100 102.4 -102.4, 100 102.4 102.4, 100 0 102.4,
> 100 0 -102.4 ] }
>
> # identifies in this case, only 1 face, a rectangle; in your case,
> all the points
>
> # of the block would be identified.
>
> ShapeHints {
>
> vertexOrdering CLOCKWISE
>
> faceType CONVEX
>
> }
>
> # IndexedFaceSet node here could setup other faces of the block,
>
> # using current material & texture.
>
> Texture2 {
>
> filename "earth.bmp"
>
> }
>
> IndexedFaceSet {
>
> coordIndex [ 0,1,2,3,-1,]
>
> } # the face you want the graphic pasted on.
>
>
>
> How well this works would depend on your VRML Browser, at this stage of
>
> development - some don't handle bitmaps yet, some don't handle them well.
>
>
>
> You can also use TextureCoordinate2 to scale & position the graphic, if
> the
>
> Browser supports that node.
>
>
>
> Your alternative is to place the texture on the face of the Cube in a
> world-
>
> building program such as 3DWeb Spinner (if you're working on a PC in
>
> Windows).
>
>
>
>
>
> Good luck,
>
> Paul S. Hoffman
>
> VP/Creative Director
>
> Cognetics Corporation
>
> paul@cognetics.com
>
> http://www.cognetics.com
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> At 4:28 PM on 10/12/95, P.J. O'Rourke wrote:
>
>
>
> > I have a simple .wrl file featuring, among other things, a square
>
> >block, floating out there in space. What I want to do is to "paste" an
>
> >image (file) onto one side of this block, could be a .gif or .jpeg file,
>
> >doesn't matter to me. Is this possible, and if so, what would the syntax
>
> >look like?
>
>
>
> It is only possible if your "block" is an indexed face set, rather than
>
> a Cube primitive. (setting the Texture2 to a graphic file for a Cube
> texturizes
>
> the entire Cube)
>
>
>
> Here's a sample I've used:
>
>
>


  • Next message: Bob Crispen: "Re: Distributed Collision Detection"
  • Previous message: Joseph Lombardo: "Re: Q#3 Crystal Balls or something...."
  • In reply to: PAUL: "Re: LANG: syntax for image files"