TEXTURES, LIGHTNING AND CONSTRUCTION OF A BASIC ISLAND IN VRML PowerPoint PPT Presentation

presentation player overlay
1 / 17
About This Presentation
Transcript and Presenter's Notes

Title: TEXTURES, LIGHTNING AND CONSTRUCTION OF A BASIC ISLAND IN VRML


1
  • TEXTURES, LIGHTNING AND CONSTRUCTION OF A
    BASIC ISLAND IN VRML

2
Models with Textures in VRML
  • Texture Applying a picture to an object
  • Textures in VRML Applying involves everything
    from an image to an MPEG video.

3
Types of Textures
  • There are 3 types of textures in VRML
  • ImageTexture
  • PixelTexture
  • MovieTexture

4
ImageTexture
  • Enough to supply it with the URL like
  • Url
    texture.gif
  • Texture ImageTexture
  • .jpg and .png also supported
  • Texturetransform center,rotate,scale the texture
  • Texture Coordinates modify the place of a
    texture with S (vertical) and T (horizontal) axes.

5
PixelTexture
  • Advantage Reduces connection traffic.
  • Disadvantage Initial loading times are
    increased.
  • using texture Pixeltexture
  • Image 1 2 1 0XFF 0X00

6
Building Texture Maps
  • Import image formats and convert to a supported
    format.
  • Manipulate the Image
  • Map the image to the surface by using an Indexed
    FaceSet

7
Example for an IndexedFaceSet
  • Shape
  • appearance appearance
  • Texture ImageTexture url
    picture.jpg
  • geometry IndexedFaceSet
  • Coord Coordinate
  • Point
  • 0 0 0, 1 0 0, 1 1 0, 0 1
    0,
  • -1 1 -.5, -1 0 -.5, 0 -1 -.5, -1 -1 -.5
  • 0 0 -1, 1 0 -1, 1 -1 -1, 0 -1 -1
  • CoordIndex
  • 0, 1, 2, 3, -1,
  • 0, 3, 4, 5, -1,
  • 0, 5, 7, 6, -1,
  • 11, 10, 9, 8, -1

8
MovieTexture
  • You can put a movie wherever you can have a
    standard image.
  • MPEG-1 Video must be supported.
  • Example Shape
  • appearance appearance
  • Texture MovieTexture
  • Url movie.mpg
  • Loop TRUE
  • StartTime 1
  • geometry IndexedFaceSet
  • coords Coordinate
  • Point -1 0 0, -1 1 0, 1 1 0, 1
    0 0
  • CoordIndex 0,1,2,3,-1

9
Adding Lights
  • Three Types of Light Sources
  • Spotlight
  • Directional Light
  • Point Light

10
Adding Directional Light
  • The rays are parallel to each other.
  • Example Sunlight
  • using DirectionalLight
  • direction -1 -1 -1
  • on the scene Transform
  • translation 1 .5 1
  • Children
  • ()
  • Shape

  • appearance appearance

  • material Material diffuseColor 0.7 0.1 0.1

  • geometry Box size 1 1 1

11
Adding Spotlight
  • To add a spotlight to a particular object, just
    replace () with
  • Spotlight
  • direction 1 -1 -1
  • location -5 5 5
  • radius 30
  • beamwidth 1.57
  • cutoffangle 1.57

12
Adding Pointlights
  • Example A Bulb that sends light in all
    directions.
  • PointLight
  • radius 10
  • Location 0 10
  • radius 10 means that the whole scene will be
    enlighted.

13
The Collision Node
  • Came with VRML 2.0
  • Stops the visitors from walking through walls.
  • Collision
  • Children
  • Shape
  • appearance appearance
  • material Material
    emissiveColor 1 0 0
  • geometry Cylinder
  • --------------------------------------------------
    -------------
  • proxy Sphere radius 2
  • (Putting the Sphere is optional)

14
Other Features
  • Setting LOD (Level of Detail)
  • Needed because of speed concerns.
  • Principle Define a set of ranges and adjust how
    the object seems from the respectable ranges.
  • Setting Point of View
  • Example Viewpoint
  • position 0 3 3
  • orientation 1 0 0
    -.785
  • Description camera
    1

15
Constructing a basic island
  • Shape
  • appearance appearance
  • material Material
  • diffuseColor 0.1 0.5 0.2

  • emissiveColor 0.05 0.1 0.05
  • geometry IndexedFaceSet
  • coord Coordinate
  • Point
  • 20 0 0, 15 0 15, 0 0 20, -15 0 15 , -20 0
    0, -15 0 -15 0 0 -20 ,15 0 -15, 0 10 0
  • coordIndex
  • 8, 1, 0, 8, -1,
  • 8, 2, 1, 8, -1,
  • 8, 3, 2, 8, -1,
  • 8, 4, 3, 8, -1,
  • 8, 5, 4, 8, -1,

16
Advancing the Environment
  • When creating more Islands, we can use def and
    use keywords to reuse the same objects.
  • It's also possible to add a background to our
    world using variables like
  • Background groundAngle
  • groundColor
  • backUrl
  • bottomUrl
  • skyColor0 0 0
  • .
  • .
  • .

17
  • Thank You For Listening.
Write a Comment
User Comments (0)
About PowerShow.com