
VRML虚拟现实开发文档(含源代码).docx
40页虚拟现实开发文档罗维030913501 .功能概述运用vrml语言构造了一个虚拟现实世界运动物体包括气球,火车,汽车,交通灯等,静止物体包括山脉,树林,房屋,人物,花草,亭,国旗,座椅,广告牌,雨伞等,另外还包含背景和声音2 .使用说明广告牌截图:#VRML utf8程序:Transform{#背景颜色translationchildren[Transform{translationchildren[#创建广告牌造型Shape{#广告牌appearanceAppearance{materialMaterial{diffuseColorgeometryBox{size12Transform{translationchildren[Shape{appearanceAppearance{textureImageTexture{url""}materialMaterial{diffuseColor#广告屏幕geometryBox{size11}}热气球DEFlegTransform{translation5-4scalechildren[Shape{appearanceAppearance{materialMaterial{diffuseColor}}geometryCylinder{radiusheighttopTRUE#bottomTRUEbottomFALSEsideTRUE}}#广告柱子#Shape模型节点#空间物体造型外观#一种材料的漫反射颜色#柱体节点#圆柱体半径#圆柱体高#圆柱体有顶#圆柱体有底#圆柱体有曲面Transform{translation-1000childrenUSEleg}#椅子腿截图:程序:#VRML utf8Group {children [Background{skyColor[}#创建月球造型Transform{translation 0 0scale 1 1 1children]Shape {appearance Appearance{#银白颜色textureImageTexture { url ""} materialMaterial {diffuseColor ambientintensity specularColor shininess}#空间物体造型外观#一种材料的漫反射颜色#多少环境光被该表面反射#物体镜面反射光线的颜色#造型外观材料的亮度}geometry Sphere { radius 4 }}]#球体Transform{translation 0 -4scale 1children]Shape {appearance Appearance{ textureurlImageTexture {""} material Material { diffuseColor ambientintensity specularColor shininess}#空间物体造型外观#一种材料的漫反射颜色#多少环境光被该表面反射#物体镜面反射光线的颜色#造型外观材料的亮度geometryCylinder{#潜艇舰桥(噫望塔)radiusheightsideTRUEtopTRUEbottomTRUE}}]}热气球运动程序:#VRMLutf8#引入月球造型#时间传感器#移动位置节点#相对时间的逻辑值#空间坐标的位置值与相对时间的逻辑值DEFfly1Transform{childrenInline{url""}}DEFTime1TimeSensor{cycleInterval32loopTRUE}DEFflyinter1PositionInterpolator{key[,,,,,,,,,,,,]keyValue[00-20,0-15,0-9,2000,09,015002001509-20000-90-1500-20]}ROUTETOROUTETO国旗截图:程序:#VRMLutf8Group{children[Transform{translation-22-322scalechildren[Transform{children[Shape{appearanceAppearance{textureImageTexture{url""}}geometryBox{size2727}}]}Transform{translation0150children[Shape{appearanceAppearance{textureImageTexture{url""}}geometryCylinder{radiusbottomTRUEtopTRUEheight30sideTRUE}}]}Transform{children[Shape{appearanceAppearance{textureImageTexture{url""}}geometryCylinder{radiusbottomTRUEtopTRUEheightsideTRUE}}]}Transform{translation4280scale222children[Shape{appearanceAppearance{textureImageTexture{url""}}geometryBox{size}}]}]}]}Viewpoint{orientation010position-15-225公共汽车截图:程序:#VRMLutf8DEFBusTransform{children[DEFbodyShape{appearanceAppearance{materialDEFLtGray_ColorMaterial{ambientIntensitydiffuseColor}textureImageTexture{url""}}geometryIndexedFaceSet{coordCoordinate{point[0,0,]}coordIndex[0,5,4,2,-1,0,2,1,-1,4,3,2,-1,11,6,7,8,-1,9,10,11,8,-1]texCoordTextureCoordinate{point[,}}}DEFfront01Shape{appearanceAppearance{materialUSELtGray_ColortextureImageTexture{url""}}geometryIndexedFaceSet{coordCoordinate{point[0,}coordIndex[3,0,1,4,-1,4,1,2,5,-1]texCoordTextureCoordinate{point[,}}}DEFtop01Shape{appearanceAppearance{materialUSELtGray_Color}geometryIndexedFaceSet{coordCoordinate{point[,}coordIndex[2,0,1,3,-1]}}DEFback01Shape{appearanceAppearance{materialUSELtGray_Color}geometryIndexedFaceSet{coordCoordinate{point[0,coordIndex[4,1,2,5,-1,5,2,0,3,-1]translation0汽车截图:程序:#VRMLutf8Background{#空间背景中,空中无颜色,即黑色topUrl""#顶部frontUrl""#前面backUrl""#后面leftUrl""#左面rightUrl""#右面bottomUrl""#底部DEFcarTransform{rotation010children]Transform{translation003rotation100childrenShape{appearanceAppearance{textureImageTexture{url""}materialMaterial{diffuseC010r.1.1.1}}geometryCylinder{radius1height.5}}}Transform{translation00-3rotation100childrenShape{appearanceAppearance{textureImageTexture{url""}materialMaterial{diffuseColor.1.1.1}}geometryCylinder{radius1height.5}}}Transform{translation1003rotation100childrenShape{appearanceAppearance{textureImageTexture{url""}materialMaterial{diffuseColor.1.1.1}geometryCylinder{radius1height.5}}}Transform{translation100-3rotation100childrenShape{appearanceAppearance{textureImageTexture{url""}materialMaterial{diffuseColor.1.1.1}}geometryCylinder{radius1height.5}}}#车轮Transform{translation620childrenShape{appearanceAppearance{textureImageTexture{url""}materialMaterial{}}geometryBox{size1638}}}Transform{translation40childrenShape{appearanceAppearance{textureImageTexture{url""}materialMaterial{}}geometryBox{size1437}}}#车身Transform{translation-23-3childrenShape{appearanceAppearance{materialMaterial{diffuseColor111}}。
