VRML虚拟现实开发文档(含源代码).
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Transform{
children [
Shape{
appearance Appearance{
texture ImageTexture {
url "flag.gif"}}
geometry Box {
size 27 0.1 27 }
}
]
}
Transform {
translation 0 15 0
children [
children Inline{url "balloon.wrl"}
}
DEFTime1 TimeSensor{ #时间传感器
cycleInterval 32
loop TRUE
}
DEFflyinter1 PositionInterpolator { #移动位置节点
key [ #相对时间的逻辑值
0.0,0.083,0.166,0.252,0.332,0.412,0.496,0.581,0.664,0.747,0.83,0.913,1.0
ROUTE flyinter1.value_changed TOfly1.set_translation
2.3国旗
截图:
程序:
#VRML V2.0 utf8
Group {
children [
Transform {
translation -22 -3 22
scale 0.10.10.1
children [
Shape{
appearance Appearance{
texture ImageTexture {
shininess 0.20 #造型外观材料的亮度
}
}
geometry Sphere { #球体
radius 4
}
}
]
}
]
}
Transform{
translation 0 -4 0.0
scale 1 0.6 0.6
children[
Shape {
appearance Appearance{
textureImageTexture {
}
}
geometry Box { #广告牌
size 12 6.5 0.2
}
}
]
}
Transform {
translation0.0 0.0 -0.02
children [
Shape {
appearance Appearance{
textureImageTexture {
url"advertisement.png"
url"balloon.png"
}
material Material { #空间物体造型外观
diffuseColor 0.5 0.5 0.7 #一种材料的漫反射颜色
ambientIntensity 0.4 #多少环境光被该表面反射
specularColor 0.8 0.8 0.9 #物体镜面反射光线的颜色
]
keyValue [ #空间坐标的位置值与相对时间的逻辑值
0 0 -20,
6.6 0 -15,
13.2 0 -9,
20 0 0,
13.2 0 9,
6.6 0 15
0 0 20
-6.6 0 15
-13.2 0 9
-20 0 0
-13.2 0 -9
-6.6 0 -15
0 0 -20
]
}
ROUTE Time1.fraction_changedTO flyinter1.set_fraction
children[
Shape { # Shape模型节点
appearance Appearance{
material Material { #空间物体造型外观
diffuseColor 0.2 0.3 0.3#一种材料的漫反射颜色
}
}
geometry Cylinder { #柱体节点
radius 2.0 #圆柱体半径
url"color.png"
}
material Material { #空间物体造型外观
diffuseColor 0.3 0.2 0.0 #一种材料的漫反射颜色
ambientIntensity 0.4 #多少环境光被该表面反射
specularColor 0.7 0.7 0.6 #物体镜面反射光线的颜色
Group {
children [
Background{
skyColor[
0.2 0.5 0.6
]
}
#创建月球造型
Transform{
translation 0 0 0.0
scale 1 1 1
children[
Shape { #银白颜色
appearance Appearance{
textureImageTexture {
虚拟现实开发文档
罗维03091350
1.功能概述
运用vrml语言构造了一个虚拟现实世界。运动物体包括气球,火车,汽车,交通灯等,静止物体包括山脉,树林,房屋,人物,花草,电话亭,国旗,座椅,广告牌,雨伞等,另外还包含背景和声音。
2.使用说明
2.1广告牌
截图:
程序:
#VRML V2.0 utf8
Transform {
}
material Material {
diffuseColor 0.0 0.0 0.0
}
}
geometry Box {
size 11 5.6 0.4 #广告屏幕
}
}
]
}
]
}
DEF leg Transform{#广告柱子
translation 5 -4 0.1
scale 0.04 0.04 0.04
height 100.0 #圆柱体高
top TRUE #圆柱体有顶
#bottom TRUE #圆柱体有底
bottom FALSE
side TRUE #圆柱体有曲面
}
}
]
}
Transform{ #椅子腿
translation -10 0 0
children USE leg
}
2.2热气球
截图:
程序:
#VRML V2.0 utf8
translation0.0 0.0 0.0 #背景颜色
children [
Transform {
translation0.0 0.0 0
children [
#创建广告牌造型
Shape {
appearance Appearance{
material Material {
diffuseColor 0.2 0.3 0.3
shininess 0.2 #造型外观材料的亮度
}
}
geometry Cylinder { #潜艇舰桥(嘹望塔)
radius 1.0
height 3.0
side TRUE
topTRUE
bottom TRUE
}
}
]
}
热气球运动程序:ຫໍສະໝຸດ Baidu
#VRML V2.0 utf8
DEFfly1 Transform { #引入月球造型
children [
Shape{
appearance Appearance{
texture ImageTexture {
url "flag.gif"}}
geometry Box {
size 27 0.1 27 }
}
]
}
Transform {
translation 0 15 0
children [
children Inline{url "balloon.wrl"}
}
DEFTime1 TimeSensor{ #时间传感器
cycleInterval 32
loop TRUE
}
DEFflyinter1 PositionInterpolator { #移动位置节点
key [ #相对时间的逻辑值
0.0,0.083,0.166,0.252,0.332,0.412,0.496,0.581,0.664,0.747,0.83,0.913,1.0
ROUTE flyinter1.value_changed TOfly1.set_translation
2.3国旗
截图:
程序:
#VRML V2.0 utf8
Group {
children [
Transform {
translation -22 -3 22
scale 0.10.10.1
children [
Shape{
appearance Appearance{
texture ImageTexture {
shininess 0.20 #造型外观材料的亮度
}
}
geometry Sphere { #球体
radius 4
}
}
]
}
]
}
Transform{
translation 0 -4 0.0
scale 1 0.6 0.6
children[
Shape {
appearance Appearance{
textureImageTexture {
}
}
geometry Box { #广告牌
size 12 6.5 0.2
}
}
]
}
Transform {
translation0.0 0.0 -0.02
children [
Shape {
appearance Appearance{
textureImageTexture {
url"advertisement.png"
url"balloon.png"
}
material Material { #空间物体造型外观
diffuseColor 0.5 0.5 0.7 #一种材料的漫反射颜色
ambientIntensity 0.4 #多少环境光被该表面反射
specularColor 0.8 0.8 0.9 #物体镜面反射光线的颜色
]
keyValue [ #空间坐标的位置值与相对时间的逻辑值
0 0 -20,
6.6 0 -15,
13.2 0 -9,
20 0 0,
13.2 0 9,
6.6 0 15
0 0 20
-6.6 0 15
-13.2 0 9
-20 0 0
-13.2 0 -9
-6.6 0 -15
0 0 -20
]
}
ROUTE Time1.fraction_changedTO flyinter1.set_fraction
children[
Shape { # Shape模型节点
appearance Appearance{
material Material { #空间物体造型外观
diffuseColor 0.2 0.3 0.3#一种材料的漫反射颜色
}
}
geometry Cylinder { #柱体节点
radius 2.0 #圆柱体半径
url"color.png"
}
material Material { #空间物体造型外观
diffuseColor 0.3 0.2 0.0 #一种材料的漫反射颜色
ambientIntensity 0.4 #多少环境光被该表面反射
specularColor 0.7 0.7 0.6 #物体镜面反射光线的颜色
Group {
children [
Background{
skyColor[
0.2 0.5 0.6
]
}
#创建月球造型
Transform{
translation 0 0 0.0
scale 1 1 1
children[
Shape { #银白颜色
appearance Appearance{
textureImageTexture {
虚拟现实开发文档
罗维03091350
1.功能概述
运用vrml语言构造了一个虚拟现实世界。运动物体包括气球,火车,汽车,交通灯等,静止物体包括山脉,树林,房屋,人物,花草,电话亭,国旗,座椅,广告牌,雨伞等,另外还包含背景和声音。
2.使用说明
2.1广告牌
截图:
程序:
#VRML V2.0 utf8
Transform {
}
material Material {
diffuseColor 0.0 0.0 0.0
}
}
geometry Box {
size 11 5.6 0.4 #广告屏幕
}
}
]
}
]
}
DEF leg Transform{#广告柱子
translation 5 -4 0.1
scale 0.04 0.04 0.04
height 100.0 #圆柱体高
top TRUE #圆柱体有顶
#bottom TRUE #圆柱体有底
bottom FALSE
side TRUE #圆柱体有曲面
}
}
]
}
Transform{ #椅子腿
translation -10 0 0
children USE leg
}
2.2热气球
截图:
程序:
#VRML V2.0 utf8
translation0.0 0.0 0.0 #背景颜色
children [
Transform {
translation0.0 0.0 0
children [
#创建广告牌造型
Shape {
appearance Appearance{
material Material {
diffuseColor 0.2 0.3 0.3
shininess 0.2 #造型外观材料的亮度
}
}
geometry Cylinder { #潜艇舰桥(嘹望塔)
radius 1.0
height 3.0
side TRUE
topTRUE
bottom TRUE
}
}
]
}
热气球运动程序:ຫໍສະໝຸດ Baidu
#VRML V2.0 utf8
DEFfly1 Transform { #引入月球造型