13

Click here to load reader

VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Embed Size (px)

DESCRIPTION

Visual Reality and VRML student..

Citation preview

Page 1: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

PREPARED BY : NURAINI MOHD GHANI 1

Page 2: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

PREPARED BY : NURAINI MOHD GHANI 2

Shapes are the building blocks of a VRML world

Primitive Shapes are standard building blocks:

•Box

•Cone

•Cylinder

•Sphere

•Text

Page 3: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Syntax: Shape

A Shape node builds a shape

appearance - color and texture

geometry - form, or structure

shape {

appearance . . .

geometry . . .

}

PREPARED BY : NURAINI MOHD GHANI 3

Page 4: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Specifying appearance

Shape appearance is described by appearance nodes

For now, we'll use nodes to create a shaded white

appearance:

Shape {

appearance Appearance {

material Material { }

}

geometry . . .

}

PREPARED BY : NURAINI MOHD GHANI 4

Page 5: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Specifying geometry:

Shape geometry is built with geometry nodes:

Box { . . . }

Cone { . . . }

Cylinder { . . . }

Sphere { . . . }

Text { . . . }

• Geometry node fields control dimensions

• Dimensions usually in meters, but can be anything

PREPARED BY : NURAINI MOHD GHANI 5

Page 6: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Syntax: Box

A Box geometry node builds a box

size - width, height, depth

Shape {

appearance Appearance {

material Material { }

}

geometry Box {

size 2.0 2.0 2.0

}

}

PREPARED BY : NURAINI MOHD GHANI 6

Page 7: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Syntax: Cone

• A Cone geometry node builds an upright cone

• height and bottomRadius - cylinder size

• bottom and side - parts on or off

Shape {

appearance Appearance {

material Material { }

}

geometry Cone {

height 2.0

bottomRadius 1.0

bottom TRUE

side TRUE

}

}

PREPARED BY : NURAINI MOHD GHANI 7

Page 8: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Syntax: Cylinder

• A Cylinder geometry node builds an upright cylinder

• height and radius - cylinder size

• bottom, top, and side - parts on or off

Shape {

appearance Appearance {

material Material { }

}

geometry Cylinder {

height 2.0

radius 1.0

bottom TRUE

top TRUE

side TRUE

}

}PREPARED BY : NURAINI MOHD GHANI 8

Page 9: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Syntax: Sphere

• A Sphere geometry node builds a sphere

• radius - sphere radius

Shape {

appearance Appearance {

material Material { }

}

geometry Sphere {

radius 1.0

}

}

PREPARED BY : NURAINI MOHD GHANI 9

Page 10: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Syntax: Text• A Text geometry node builds text

• string - text to build • fontStyle - font control

Shape {

appearance Appearance {

material Material { }

}

geometry Text {

string [ "Text","Shape" ]

fontStyle FontStyle {

style "BOLD"

}

}

}

PREPARED BY : NURAINI MOHD GHANI 10

Page 11: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

#VRML V2.0 utf8# A cylinder

Shape {

appearance Appearance {

material Material { }}

geometry Cylinder {

height 2.0

radius 1.5}

}

PREPARED BY : NURAINI MOHD GHANI 11

Page 12: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

• Shapes are built centered in the world

• A VRML file can contain multiple

shapes

• Shapes overlap when built at the

same location

PREPARED BY : NURAINI MOHD GHANI 12

Page 13: VISUAL REALITY AND VRML [Chapter 2 - BUILDING PRIMITIVE SHAPES]

Shapes are built using a Shape node

Shape geometry is built using geometry

nodes, such as Box, Cone, Cylinder,

Sphere, and Text

·Text fonts are controlled using a

FontStyle node

PREPARED BY : NURAINI MOHD GHANI 13