2012虚拟现实技术实验教案.pdf
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《2012虚拟现实技术实验教案.pdf》由会员分享,可在线阅读,更多相关《2012虚拟现实技术实验教案.pdf(27页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、实验一 VRML基本造型 一、实验目的 1.熟悉 VRML浏览器的安装及使用方法。2.了解 VRML编辑器 vrmlpad的安装及基本用法。3.了解 VRML语言的基本语法。4.掌握 VRML语言创建的基本几何造型。二、实验器材 硬件环境:多媒体计算机 软件环境:1.Windows XP 操作系统 2.虚拟现实浏览器插件 BS_Contact_VRML-X3D.3.VRML 编辑器 vrmlpad.三、实验原理 任何一个 VRML场景中的几何造型都必须以 Shape节点进行创建,场景造型包括基本的立方体、圆柱、圆锥、圆、文本造型等。四、实验步骤 实例 1.圆柱基本几何造型。1.输入下例。#VR
2、ML V2.0 utf8#Background#skyColor 1.0 1.0 1.0#Shape appearance Appearance material Material geometry Cylinder top FALSE 2.将本例中关于 Cylinder 节点的参数进行更改,并观察每个参数的影响。实例 2.圆柱基本几何造型。1.输入下例。#VRML V2.0 utf8 Background skyColor 1.0 1.0 1.0 Shape appearance Appearance material Material geometry Sphere radius 1.6
3、2.将 Sphere 节点的参数进行更改,并观察更改后的效果。实例 3.长方体等基本几何造型的例子。#VRML V2.0 utf8 Shape appearance Appearance material Material geometry Box 实验二 VRML空间变换 实验目的 1 理解 VRML空间变换的原理。2 掌握 Transform节点的用法。实验器材 硬件环境:多媒体计算机 软件环境:1.Windows XP 操作系统 2.虚拟现实浏览器插件 BS_Contact_VRML-X3D.3.VRML 编辑器 vrmlpad.实验原理 VRML场景中的每一个造型都是基于当前坐标系进行
4、创建的,而单一坐标系的使用将在很大程度上限制用户的空间想象力和创造力的发挥。在 VRML场景中改变空间位置和空间朝向,需要进行VRML空间变换,也即变换造型创建所基于的空间坐标系。VRML空间变换使用 Transform节点进行。其主要的语法格式如下:Chilidren Translation 0.0 0.0 0.0 Rotation 0.0 0.0 1.0 0.0 Scale 1.0 1.0 1.0 scaleOrientation 0.0 0.0 1.0 0.0 Center 0.0 0.0 0.0 Bboxcenter 0.0 0.0 0.0 bboxSzie-1.0-1.0-1.0 a
5、ddChildren removeChildren 实验内容与步骤 实例 1.楼梯造型 1.代码如下:#VRML V2.0 utf8 DEF stair Shape appearance Appearance material Material geometry Box size 1.5 1.0 5.0 Transform translation 1.3 0.8 0.0 children USE stair Transform translation 1.3 0.8 0.0 children USE stair Transform translation 1.3 0.8 0.0 childre
6、n USE stair 2.效果图如下:实例 2.立体鼠标 1.代码如下:#VRML V2.0 utf8 Background skyColor 1.0 1.0 1.0 DEF acrossmouse Shape appearance Appearance material Material diffuseColor 1.0 1.0 0.0 geometry Cylinder radius 0.2 height 4.0 Shape appearance Appearance material Material diffuseColor 0.6 0.4 0.2 geometry Box Tran
7、sform rotation 1 0 0 1.571 children USE acrossmouse Transform rotation 0 0 1 1.571 children USE acrossmouse 2.效果图如下:实例 3.嵌套使用 1.代码如下:#VRML V2.0 utf8 Background skyColor 1.0 1.0 1.0 Group children Shape appearance Appearance material Material emissiveColor 1.0 0.8 0.2 transparency 0.5 geometry Sphere
8、 radius 2.0 DEF space Transform translation 4 0 0 children Shape appearance Appearance material Material diffuseColor 1.0 0.0 0.0 geometry Sphere radius 0.5 Transform rotation 0 0 1 0.785 children USE space Transform rotation 0 0 1 0.785 children USE space Transform rotation 0 0 1 0.785 children USE
9、 space Transform rotation 0 0 1 0.785 children USE space Transform rotation 0 0 1 0.785 children USE space Transform rotation 0 0 1 0.785 children USE space Transform rotation 0 0 1 0.785 children USE space 2.效果如下:实验三 VRML材质及纹理 实验目的 1 理解 VRML材质及纹理的主要作用。2 掌握 VRML材质及纹理节点的用法。实验器材 硬件环境:多媒体计算机 软件环境:1.Win
10、dows XP 操作系统 2.虚拟现实浏览器插件 BS_Contact_VRML-X3D.3.VRML 编辑器 vrmlpad.实验原理 造型的材质属性包括造型的反光颜色、发光颜色、明亮程度以及透明度等。造型的材质控制使用 Appearance节点的 material域的域值设置,material域的域值所使用的材质节点为 Material节点。VRML纹理映射是通过将数字纹理根据几何体的外形,按一定规则映射到几何造型或文本造型的表面。纹理映射是包括 VRML在内的各种三维技术广泛使用的一种增效渲染方法。该方法通过在造型表面映射具有微观细节的数字纹理,极大地改善了单纯使用 Material节点
11、进行材质渲染所呈现的视觉宏观效果。本实验涉及到的主要节点:Appearance material texture textureTransform ImageTexture url()repeatS repeatY TextureTransform translation 0.0 0.0 rotation 0.0 scale 1.0 1.0 center 0.0 0.0 实验内容与步骤 实例 1.广告牌。1.代码如下:#VRML V2.0 utf8 Shape appearance Appearance texture ImageTexture url 2.jpg geometry Box s
12、ize 2 2 0.04 Transform translation 0 0-0.1 children Shape appearance Appearance material Material diffuseColor 0 1 1 geometry Box size 2 2 0.16 2 其效果如下:实例 2.视频纹理。1.代码如下:#VRML V2.0 utf8 Background skyColor 1 1 1 Transform translation 0 0-0.1 children Shape appearance Appearance material Material diff
13、useColor 0.5 0.6 0.1 geometry Box size 15 8 0.2 Shape appearance Appearance texture DEF mpeg MovieTexture url dahanzhan.mpeg loop TRUE#speed 0.1 geometry Box size 12 7 0.1 2.效果图如下:实例 3.纹理缩放。1.代码如下:#VRML V2.0 utf8 Background skyColor 0.6 0.2 0.2 Shape appearance DEF aa Appearance texture ImageTexture
14、 url front.bmp#repeatS TRUE repeatT FALSE textureTransform TextureTransform scale 2 2 geometry Box size 20 10 2 Transform translation 0 0-2 children Shape appearance USE aa geometry Sphere 2.效果如下:实验四 视点与导航 实验目的 1 掌握 VRML视点及导航控制 实验器材 硬件环境:多媒体计算机 软件环境:1.Windows XP 操作系统 2.虚拟现实浏览器插件 BS_Contact_VRML-X3D.
15、3.VRML 编辑器 vrmlpad.实验原理 VRML所提供的视点是在所浏览的场景中预先由用户定义的观察位置及空间朝向。在这个位置且通过该朝向,用户可以浏览到虚拟世界中相应场景的指定部分。同一个 VRML场景中可以设置许多个视点,但一次浏览只有一个视点是可用的。视点控制通过Viewpoint节点进行实现。虚拟场景中,NavigationInfo导航信息节点用来提供浏览者化身信息以及该化身如何使用当前的视点进行系统导航。实验内容与步骤 实例 1.视点应用 1.代码如下#VRML V2.0 utf8 Background skyColor 0.85 0.85 0.85 Viewpoint pos
16、ition 0.0 0.0 16.0 description view1 Viewpoint position 0.0 0.0 3.0 description v2 Viewpoint orientation 0 0 1-0.0 description v3 Viewpoint orientation 0 0 1 1.571 description v4 Viewpoint fieldOfView 0.1 description v5 Viewpoint fieldOfView 1.571 orientation 0 0 1-3.14 description v6 Viewpoint desc
17、ription v7 position 0 0 1 Group children Shape appearance Appearance material Material diffuseColor 0.2 0.4 0.6 geometry Cone bottomRadius 1 height 2 Transform translation 0 1.4 0 children Shape appearance Appearance material Material diffuseColor 0.2 0.4 0.6 geometry Box size 0.8 0.8 0.8 2 效果如下:视点一
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2012 虚拟现实 技术 实验 教案
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内