Intro to Virtual Reality Markup Language - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Intro to Virtual Reality Markup Language

Description:

http://www.xemacs.org/Download/index.html. Cortona plug-in: ... http://www.mozilla.org/ Adding VRML to your web site. Put VRML code in a separate file. ... – PowerPoint PPT presentation

Number of Views:94
Avg rating:3.0/5.0
Slides: 21
Provided by: jere69
Category:

less

Transcript and Presenter's Notes

Title: Intro to Virtual Reality Markup Language


1
Intro to Virtual Reality Markup Language
2
Overview
  • What is VRML?
  • Adding a VRML file to your web page
  • VRML Basics with example code
  • Shapes, transforms, lights
  • Info about the lab

3
What is VRML?
  • Virtual Reality Markup Language
  • Also called Vermal
  • A programming language for creating 3D worlds.
  • Can be viewed from a webpage (with a plugin)
  • Allows users interaction and exploration

4
What you need to do VRML
  • Text editor
  • Emacs (linux, windows, unix)
  • Notepad, Wordpad (windows)
  • Web browser
  • Mozilla
  • Internet Explorer
  • Opera
  • Netscape
  • Plugin
  • Cortona (the one we use)
  • CosmoPlayer

5
Where can I find that stuff?
  • Emacs for Windows
  • http//www.xemacs.org/Download/index.html
  • Cortona plug-in
  • http//www.parallelgraphics.com/products/cortona/
  • Opera, Mozilla och Netscape
  • http//www.netscape.com/
  • http//www.opera.com/
  • http//www.mozilla.org/

6
Adding VRML to your web site
  • Put VRML code in a separate file.
  • Filename should end with .vrml or .wrl
  • Use the embed command in HTML to add the file.
  • I.E.,
  • lt EMBED SRC"test.vrml" WIDTH600 HEIGHT200 gt

7
The basics
  • File header
  • Comments
  • Brackets
  • Shapes
  • Colors
  • 3D coordinates and transforms
  • Lights

8
File Header
  • IMPORTANT Your VRML file must always start with
    the with
  • VRML V2.0 utf8
  • Tells that the file is a VRML file
  • Tells the file is compatible with version 2.0 of
    the VRML specification
  • Tells that the file is encoded with the
    international standard utf8
  • The VRML header not found or unsupported
    encoding type

9
Comments
  • Comments can be added to your code by starting a
    line with a . So
  • Add this to your VRML code and everything
  • will be ok
  • Do not add this to your VRML without a
  • Why use comments?
  • It helps you formulate thoughts and keep focused
    on what you are working on.
  • It makes it easier to come back later to your
    code and remember what it does.
  • It makes it easier for other people to understand
    your code.

10
Brackets
  • Brackets and are used in order to group
    things together logically.
  • Using indentation with brackets is VERY important
    and makes code much easier to read

11
Brackets example
  • Shapegeometry Box size 2.0 2.0 2.0appearance
    Appearancematerial Material diffuseColor 0 1 0
  • Is much harder to read than
  • Shape
  • geometry Box size 2.0 2.0 2.0
  • appearance Appearance
  • material Material diffuseColor 0 1 0

12
Shapes
  • There are four primitive shapes in VRML.
  • Box, Sphere, Cone and Cylinder
  • The general syntax for a shape is
  • Shape
  • The geometry includes physical features like the
    shape and size
  • geometry
  • appearance Appearance
  • The appearance includes the color etc.
  • material Material

13
Some example shapes
  • A red sphere
  • Shape
  • Create a shpere with a radius of 2
  • geometry Sphere radius 2
  • appearance Appearance
  • diffuseColor referes to the color of a
    shape
  • lets make the sphere red
  • material Material diffuseColor 1
    0 0
  • --------------------------------------------------
    ------------------------------
  • A blue box
  • Shape
  • geometry Box size 2.0 2.0 2.0
  • appearance Appearance

14
Color
  • Colors are described in VRML using RGB values.
  • Example colors
  • 1, 1, 1 White
  • 0, 0, 0 Black
  • 1, 0, 0 Red
  • 0, 1, 0 Blue
  • 0, 0, 1 Green
  • 1, 1, 0 Yellow
  • 0, 1, 1 Cyan
  • 1, 0, 1 Magenta
  • Dark Colors
  • .5, 0, 0 Dark Red
  • 0, .5, 0 Dark Blue

15
3-Dimentional Coordinates
  • Points are represented by 3 variables
    corresponding to the x,y and z axis.
  • The point (0,0,0) is referred to as the origin
  • Other points are referenced in relation to the
    origin. E.g. (1,1,1), (-1,0,0)

16
Placing objects in VRML
  • Use the Transform function along with 3D
    coordinates
  • For example,
  • Transform
  • translation 1 1 1
  • children
  • objects (shapes etc.) added here will be at
    the point 1 1 1
  • objects added here will be at the origin
  • Note Transforms can also change scale and cause
    rotations but you dont need to know this to do
    the labs.

17
Lighting
  • VRML contains 3 types of lights.
  • Point light shoots light out in all directions
    from a single point.
  • Spot light shoots light in a single direction
    from a single point.
  • Directional light shoots light rays parallel to
    a single direction. Only effects objects in the
    same group as the light.

18
A directional light
  • Group
  • children
  • DirectionalLight
  • on TRUE
  • intensity 1
  • ambientIntensity 0
  • color 1 1 1
  • direction 0 0 -1
  • Shapes created here will be effected by the
    directional light
  • Shapes here will not be effected by the light
    because they are outside the group

19
The lab
  • In case you have not read the web page yet
  • 3 shapes, 1 light
  • There is a helper file to get you started.

20
An important tip
  • WATCH THOSE BRACKETS!
  • Easy to mess up.
  • Can take a long time to figure out what is going
    wrong.
Write a Comment
User Comments (0)
About PowerShow.com