虚拟现实技术实验报告一

虚拟现实技术实验报告一
虚拟现实技术实验报告一

华北水利水电大学虚拟现实技术实验报告2015~2016学年第二学期 2013 级专业计算机科学与技术班级:2013156 学号: 201315616 姓名:张亚

实验一创建VRML基本形体

一、实验目的:

熟悉虚拟现实建模语言的编辑环境,掌握创建基本形体和复杂形体的步骤

二、试验内容:

1、熟悉VRML的编辑环境;

2、网格造型节点的使用;

3、纹理贴图的使用;

4、创建复合形体(带有文字注释的透明木板)

5、挤出造型节点的使用

三、核心程序源代码:

1、熟悉VRML的编辑环境

2、网格造型节点的使用

#VRML V2.0 utf8

Background {

skyColor 0.0 0.6 0.8}

Shape {

appearance Appearance {

material Material {

diffuseColor 0.8 0.2 0.2

specularColor 0.5 0.5 0.5

shininess 0.2

}

}

geometry ElevationGrid{

xDimension 2

xSpacing 1

zDimension 12

zSpacing 0.2

height [

2,2,1,2,2,1,2,0,2,2,1,0,2,0,1,2,

1,2,1,1,0,2,2,1,2,2,1,2,0,1,0,1

1,2,0,0,1,1,1,0,1,2,0,1,1,0,2,0,

0,2,0,2,1,2,1,1,1,2,2,0,2,1,1,1,

0,2,2,0,2,2,0,1,2,0,2,1,0,1,1,0,

2,0,2,2,0,2,0,2,0,0,1,0,1,1,0,1,

2,0,1,0,1,2,2,1,1,0,1,1,2,1,0,0,

1,0,1,2,2,0,2,2,2,0,0,1,0,2,2,2,

1,0,0,1,0,0,1,1,0,1,2,2,1,1,2,1,

2,0,2,0,1,0,1,0,1,0,2,1,1,2,1,2,

0,1,1,1,2,0,0,2,2,1,1,2,0,2,1,1,

1,1,1,0,0,1,2,0,0,1,1,1,0,2,0,2,

2,1,0,2,1,0,1,2,1,1,0,0,2,2,0,1,

0,1,0,1,2,1,1,0,1,1,0,2,2,0,2,0,

1,1,2,2,0,1,0,2,0,2,2,0,1,0,2,2,

2,2,2,1,1,1,0,1,0,1,2,2,1,0,1,0, ]

creaseAngle 1.2

solid FALSE

}

}

3、纹理贴图的使用;

#VRML V2.0 utf8

Shape {

appearance Appearance {

material Material { }

texture ImageTexture {

url "E:\qq\1.jpg"

}

}

geometry Box {

size 1 1 1

}

}

Transform {

translation -1 0 1

children [

Shape {

appearance Appearance {

material Material {

diffuseColor 0 1 1

}

}

geometry Box {

size 2 2 0.16

}

}

]

}

4、创建复合形体(带有文字注释的透明木板)#VRML V2.0 utf8

Shape {

appearance Appearance {

material Material {

diffuseColor 0.8 0.2 0.1

specularColor 0.2 0 0

transparency 0.1

}

}

geometry Box {

size 20 15 5

}

}

Shape {

geometry Text {

string ["hello huashui!"]

maxExtent 10

fontStyle FontStyle {

family "hello"

size 8.0

spacing 5.0

style "PLAIN"

horizontal TRUE

justify ["MIDDLE"]

leftToRight TRUE

topToBottom TRUE

}

}

}

5、挤出造型节点的使用Background {

skyColor [

0.0 0.6 0.8]

}

Shape {

appearance Appearance {

material Material {

diffuseColor 0.8 0.1 0.1

ambientIntensity 0.2

specularColor 0.8 0.8 0.8

shininess 0.15

}

}

geometry Extrusion {

crossSection

[

0,-1,1,0,0,1,-8,1 -8,

2.0 2.2,2,2,-2,0,-2,-8,-5,

-1.0,-1,]

spine[

1,0,0,-1,0,0,]

scale [

0.00.0

0.5 0.5

1.0 1.0

1.2 1.2

2.0 2.0

]

orientation [

0 1 0 0

0 1 0 1.57

0 1 0 3.14

0 1 0 4.71

0 1 0 6.28

]

solid TRUE

creaseAngle 1.57

}

}

五、小结(包括收获、心得体会、存在的问题及解决问题的方法、建议等)

通过这次实验以及前段时间老师的讲解我对虚拟现实这门课有了初步的了解,并且产生了浓厚的兴趣,本次实现我主要是了解了vrml的编译环境,学会了使用节点做出网络造型以及挤出造型节点和纹理的使用,以及初步的复合体的知识,能够运用知识制作一些基本的形状,感觉像是走进了一个奇妙的世界,以后还会继续学习,努力制作更多造型。

相关文档
最新文档