1、VRML虚拟现实开发文档含源代码虚拟现实开发文档 罗维 030913501. 功能概述运用vrml语言构造了一个虚拟现实世界。运动物体包括气球,火车,汽车,交通灯等,静止物体包括山脉,树林,房屋,人物,花草,电话亭,国旗,座椅,广告牌,雨伞等,另外还包含背景和声音。2. 使用说明广告牌 截图: 程序: #VRML utf8Transform translation #背景颜色 children Transform translation 0 children #创建广告牌造型 Shape appearance Appearance material Material diffuseColor
2、geometry Box #广告牌 size 12 Transform translation children Shape appearance Appearance texture ImageTexture url material Material diffuseColor geometry Box size 11 #广告屏幕 DEF leg Transform #广告柱子 translation 5 -4 scale children Shape # Shape 模型节点 appearance Appearance material Material #空间物体造型外观 diffuse
3、Color #一种材料的漫反射颜色 geometry Cylinder #柱体节点 radius #圆柱体半径 height #圆柱体高 top TRUE #圆柱体有顶 #bottom TRUE #圆柱体有底 bottom FALSE side TRUE #圆柱体有曲面 Transform #椅子腿 translation -10 0 0 children USE leg 热气球 截图: 程序: #VRML utf8Group children Background skyColor #创建月球造型 Transform translation 0 0 scale 1 1 1 children
4、Shape #银白颜色 appearance Appearance texture ImageTexture url material Material #空间物体造型外观 diffuseColor #一种材料的漫反射颜色 ambientIntensity #多少环境光被该表面反射 specularColor #物体镜面反射光线的颜色 shininess #造型外观材料的亮度 geometry Sphere #球体 radius 4 Transform translation 0 -4 scale 1 children Shape appearance Appearance texture I
5、mageTexture url material Material #空间物体造型外观 diffuseColor #一种材料的漫反射颜色 ambientIntensity #多少环境光被该表面反射 specularColor #物体镜面反射光线的颜色 shininess #造型外观材料的亮度 geometry Cylinder #潜艇舰桥(嘹望塔) radius height side TRUE top TRUE bottom TRUE 热气球运动程序: #VRML utf8DEF fly1 Transform #引入月球造型 children Inline url DEF Time1 Tim
6、eSensor #时间传感器 cycleInterval 32 loop TRUE DEF flyinter1 PositionInterpolator #移动位置节点 key #相对时间的逻辑值 , keyValue #空间坐标的位置值与相对时间的逻辑值 0 0 -20, 0 -15, 0 -9, 20 0 0, 0 9, 0 15 0 0 20 0 15 0 9 -20 0 0 0 -9 0 -15 0 0 -20 ROUTE TO ROUTE TO 国旗截图: 程序: #VRML utf8Group children Transform translation -22 -3 22 sca
7、le children Transform children Shape appearance Appearance texture ImageTexture url geometry Box size 27 27 Transform translation 0 15 0 children Shape appearance Appearance texture ImageTexture url geometry Cylinder radius bottom TRUE top TRUE height 30 side TRUE Transform children Shape appearance
8、 Appearance texture ImageTexture url geometry Cylinder radius bottom TRUE top TRUE height side TRUE Transform translation 4 28 0 scale 2 2 2 children Shape appearance Appearance texture ImageTexture url geometry Box size Viewpoint orientation 0 1 0 position -15 -2 25 公共汽车 截图: 程序: #VRML utf8DEF Bus T
9、ransform children DEF body Shape appearance Appearance material DEF LtGray_Color Material ambientIntensity diffuseColor texture ImageTexture url geometry IndexedFaceSet coord Coordinate point 0 , 0 , , , , , 0 , 0 , , , , coordIndex 0, 5, 4, 2, -1, 0, 2, 1,-1, 4, 3, 2, -1, 11, 6, 7,8, -1, 9, 10, 11,
10、 8, -1 texCoord TextureCoordinate point , , , , , , , , , , , DEF front01 Shape appearance Appearance material USE LtGray_Colortexture ImageTexture url geometry IndexedFaceSet coord Coordinate point 0 , , , 0 , , coordIndex 3, 0, 1, 4, -1, 4, 1, 2,5, -1 texCoord TextureCoordinate point , , , , , DEF
11、 top01 Shape appearance Appearance material USE LtGray_Colorgeometry IndexedFaceSet coord Coordinate point , , , coordIndex 2, 0, 1, 3, -1 DEF back01 Shape appearance Appearance material USE LtGray_Colorgeometry IndexedFaceSet coord Coordinate point 0 , , , 0 , , coordIndex 4, 1, 2, 5, -1, 5, 2, 0,3
12、, -1 translation 0 汽车 截图: 程序: #VRML utf8Background #空间背景中,空中无颜色,即黑色。 topUrl #顶部 frontUrl #前面 backUrl #后面 leftUrl #左面 rightUrl #右面 bottomUrl #底部 DEF car Transform rotation 0 1 0 children Transform translation 0 0 3 rotation 1 0 0 children Shape appearance Appearance texture ImageTexture url material
13、Material diffuseColor .1 .1 .1 geometry Cylinder radius 1 height .5 Transform translation 0 0 -3 rotation 1 0 0 children Shape appearance Appearance texture ImageTexture url material Material diffuseColor .1 .1 .1 geometry Cylinderradius 1 height .5 Transform translation 10 0 3 rotation 1 0 0 childr
14、en Shape appearance Appearance texture ImageTexture url material Material diffuseColor .1 .1 .1 geometry Cylinder radius 1 height .5 Transform translation 10 0 -3 rotation 1 0 0 children Shape appearance Appearance texture ImageTexture url material Material diffuseColor .1 .1 .1 geometry Cylinder ra
15、dius 1 height .5 #车轮 Transform translation 6 2 0 children Shape appearance Appearance texture ImageTexture url material Material geometry Box size 16 3 8 Transform translation 4 0 children Shape appearance Appearance texture ImageTexture url material Material geometry Box size 14 3 7 #车身 Transform t
16、ranslation -2 3 -3 children Shape appearance Appearance material Material diffuseColor 1 1 1 geometry Sphereradius .5 Transform translation -2 3 3 children Shape appearance Appearance material Material diffuseColor 1 1 1 geometry Sphereradius .5 #车灯Transform translation 0 2 2 rotation 0 1 0 children
17、 Shape appearance Appearance texture ImageTexture url material Material geometry Box size 3 8 #车正面Transform translation 0 rotation 0 1 0 children Shape appearance Appearance texture ImageTexture url material Material geometry Box size #车窗户Transform translation 0 rotation 0 1 0 children Shape appeara
18、nce Appearance texture ImageTexture url material Material geometry Box size #车窗户 后面Transform translation -7 rotation 0 0 1 children Shape appearance Appearance texture ImageTexture url material Material geometry Box size 13 #车窗户 侧面Transform translation -7 rotation 0 0 1 children Shape appearance App
19、earance texture ImageTexture url material Material geometry Box size 13 #车窗户 侧面椅子 截图: 程序: #VRML utf8Transform translation children Shape appearance Appearance texture ImageTexture url material Material diffuseColor geometry Box size 11 #椅子背 Transform translation 0 rotation 1 0 0 children Shape appea
20、rance Appearance texture ImageTexture url material Material diffuseColor geometry Box size 11 #椅子坐 DEF leg Transform translation #椅子腿 rotation 0 0 0 children Shape appearance Appearance texture ImageTexture url material Material diffuseColor geometry Cylinder radius #圆柱体半径 height #圆柱体高 top TRUE #圆柱体
21、有顶 #bottom TRUE #圆柱体有底 bottom FALSE side TRUE #圆柱体有曲面 Transform #椅子腿 translation 0 0 children USE leg Transform #椅子腿 translation 0 0 5 children USE leg Transform #椅子腿 translation 0 5 children USE leg 广告牌 截图: 程序: #VRML utf8Transform translation 0 scale 5 5 5 children DEF side1 Shape appearance Appear
22、ance texture ImageTexture url material DEF Blue_Color Material ambientIntensity diffuseColor geometry Extrusion creaseAngle crossSection , , , , , , , orientation 0 0 1 0 scale 1 1 solid FALSE spine 0 0, 0 0 Transform translation 0 rotation 0 1 0 children Shape appearance Appearance texture ImageTexture
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1