版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
2011-2012學(xué)年第一學(xué)期
《虛擬現(xiàn)實(shí)技術(shù)》
實(shí)驗(yàn)教案
授課教師:
授課班級:計算機(jī)多媒體0901-02
二○一一年九月
實(shí)驗(yàn)一VRML基本造型
一、實(shí)驗(yàn)?zāi)康?/p>
1.熟悉VRML瀏覽器的安裝及使用方法。
2.了解VRML編輯器vrmlpad的安裝及基本用法。
3.了解VRML語言的基本語法。
4.掌握VRML語言創(chuàng)建的基本幾何造型。
二、實(shí)驗(yàn)器材
硬件環(huán)境:多媒體計算機(jī)
軟件環(huán)境:
1.WindowsXP操作系統(tǒng)
2.虛擬現(xiàn)實(shí)瀏覽器插件BS_Contact_VRML-X3D.
3.VRML編輯器vrmlpad.
三、實(shí)驗(yàn)原理
任何一個VRML場景中的幾何造型都必須以Shape節(jié)點(diǎn)進(jìn)行創(chuàng)建,場景造型包括基本的立方體、
圓柱、圓錐、圓、文本造型等。
四、實(shí)驗(yàn)步驟
實(shí)例1.圓柱基本幾何造型。
1.輸入下例。
#VRMLV2.0utf8
#Background{
#skyColor1.01.01.0
#}
Shape{
appearanceAppearance{
materialMaterial{
}
}
geometryCylinder{
topFALSE
}
}
2.將本例中關(guān)于Cylinder節(jié)點(diǎn)的參數(shù)進(jìn)行更改,并觀察每個參數(shù)的影響。
實(shí)例2.圓柱基本幾何造型。
1.輸入下例。
#VRMLV2.0utf8
Background{
skyColor1.01.01.0
}
Shape{
appearanceAppearance{
materialMaterial{
}
}
geometrySphere{
radius1.6
}
}
2.將Sphere節(jié)點(diǎn)的參數(shù)進(jìn)行更改,并觀察更改后的效果。
實(shí)例3.長方體等基本幾何造型的例子。
#VRMLV2.0utf8
Shape{
appearanceAppearance{
materialMaterial{
}
}
geometryBox{
}
}
實(shí)驗(yàn)二VRML空間變換
實(shí)驗(yàn)?zāi)康?/p>
1.理解VRML空間變換的原理。
2.掌握Transform節(jié)點(diǎn)的用法。
實(shí)驗(yàn)器材
硬件環(huán)境:多媒體計算機(jī)
軟件環(huán)境:
1.WindowsXP操作系統(tǒng)
2.虛擬現(xiàn)實(shí)瀏覽器插件BS_Contact_VRML-X3D.
3.VRML編輯器vrmlpad.
實(shí)驗(yàn)原理
VRML場景中的每一個造型都是基于當(dāng)前坐標(biāo)系進(jìn)行創(chuàng)建的,而單一坐標(biāo)系的使用將在很大程
度上限制用戶的空間想象力和創(chuàng)造力的發(fā)揮。在VRML場景中改變空間位置和空間朝向,需要進(jìn)行
VRML空間變換,也即變換造型創(chuàng)建所基于的空間坐標(biāo)系。VRML空間變換使用Transform節(jié)點(diǎn)進(jìn)行。
其主要的語法格式如下:
?Chilidren[]
?Translation0.00.00.0
?Rotation0.00.01.00.0
?Scale1.01.01.0
?scaleOrientation0.00.01.00.0
?Center0.00.00.0
?Bboxcenter0.00.00.0
?bboxSzie-1.0-1.0-1.0
?addChildren
?removeChildren
實(shí)驗(yàn)內(nèi)容與步驟
實(shí)例1.樓梯造型
1.代碼如下:
#VRMLV2.0utf8
DEFstairShape{
appearanceAppearance{
materialMaterial{
}
}
geometryBox{
size1.51.05.0
}
}
Transform{
translation1.30.80.0
children[
USEstair
Transform{
translation1.30.80.0
children[
USEstair
Transform{
translation1.30.80.0
children[
USEstair
]
}
]
}
]
}
2.效果圖如下:
實(shí)例2.立體鼠標(biāo)
1.代碼如下:
#VRMLV2.0utf8
Background{
skyColor1.01.01.0
}
DEFacrossmouseShape{
appearanceAppearance{
materialMaterial{
diffuseColor1.01.00.0
}
}
geometryCylinder{
radius0.2
height4.0
}
}
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor0.60.40.2
}
}
geometryBox{
}
}
Transform{
rotation1001.571
children[
USEacrossmouse
]
}
Transform{
rotation0011.571
children[
USEacrossmouse
]
}
2.效果圖如下:
實(shí)例3.嵌套使用
1.代碼如下:
#VRMLV2.0utf8
Background{
skyColor1.01.01.0
}
Group{
children[
Shape{
appearanceAppearance{
materialMaterial{
emissiveColor1.00.80.2
transparency0.5
}
}
geometrySphere{
radius2.0
}
}
DEFspaceTransform{
translation400
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor1.00.00.0
}
}
geometrySphere{
radius0.5
}
}
]
}
Transform{
rotation0010.785
children[
USEspace
Transform{
rotation0010.785
children[
USEspace
Transform{
rotation0010.785
children[
USEspace
Transform{
rotation0010.785
children[
USEspace
Transform{
rotation0010.785
children[
USEspace
Transform{
rotation0010.785
children[
USEspace
Transform{
rotation0010.785
children[
USEspace
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
2.效果如下:
實(shí)驗(yàn)三VRML材質(zhì)及紋理
實(shí)驗(yàn)?zāi)康?/p>
1.理解VRML材質(zhì)及紋理的主要作用。
2.掌握VRML材質(zhì)及紋理節(jié)點(diǎn)的用法。
實(shí)驗(yàn)器材
硬件環(huán)境:多媒體計算機(jī)
軟件環(huán)境:
1.WindowsXP操作系統(tǒng)
2.虛擬現(xiàn)實(shí)瀏覽器插件BS_Contact_VRML-X3D.
3.VRML編輯器vrmlpad.
實(shí)驗(yàn)原理
造型的材質(zhì)屬性包括造型的反光顏色、發(fā)光顏色、明亮程度以及透明度等。造型的材質(zhì)控制使
用Appearance節(jié)點(diǎn)的material域的域值設(shè)置,material域的域值所使用的材質(zhì)節(jié)點(diǎn)為Material
節(jié)點(diǎn)。
VRML紋理映射是通過將數(shù)字紋理根據(jù)幾何體的外形,按一定規(guī)則映射到幾何造型或文本造型的
表面。紋理映射是包括VRML在內(nèi)的各種三維技術(shù)廣泛使用的一種增效渲染方法。該方法通過在造型
表面映射具有微觀細(xì)節(jié)的數(shù)字紋理,極大地改善了單純使用Material節(jié)點(diǎn)進(jìn)行材質(zhì)渲染所呈現(xiàn)的視
覺宏觀效果。
本實(shí)驗(yàn)涉及到的主要節(jié)點(diǎn):
Appearance{
material
texture
textureTransform
}
ImageTexture{
url()
repeatS
repeatY
}
TextureTransform{
translation0.00.0
rotation0.0
scale1.01.0
center0.00.0
}
實(shí)驗(yàn)內(nèi)容與步驟
實(shí)例1.廣告牌。
1.代碼如下:
#VRMLV2.0utf8
Shape{
appearanceAppearance{
textureImageTexture{
url"2.jpg"
}
}
geometryBox{
size220.04
}
}
Transform{
translation00-0.1
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor011
}
}
geometryBox{
size220.16
}
}
]
}
2.其效果如下:
實(shí)例2.視頻紋理。
1.代碼如下:
#VRMLV2.0utf8
Background{
skyColor111
}
Transform{
translation00-0.1
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor0.50.60.1
}
}
geometryBox{
size1580.2
}
}
]
}
Shape{
appearanceAppearance{
textureDEFmpegMovieTexture{
url"dahanzhan.mpeg"
loopTRUE
#speed0.1
}
}
geometryBox{
size1270.1
}
}
2.效果圖如下:
實(shí)例3.紋理縮放。
1.代碼如下:
#VRMLV2.0utf8
Background{
skyColor0.60.20.2
}
Shape{
appearanceDEFaaAppearance{
textureImageTexture{
url"front.bmp"
#repeatSTRUE
repeatTFALSE
}
textureTransformTextureTransform{
scale22
}
}
geometryBox{
size20102
}
}
Transform{
translation00-2
children[
Shape{
appearanceUSEaa
geometrySphere{
}
}
]
}
2.效果如下:
實(shí)驗(yàn)四視點(diǎn)與導(dǎo)航
實(shí)驗(yàn)?zāi)康?/p>
1.掌握VRML視點(diǎn)及導(dǎo)航控制
實(shí)驗(yàn)器材
硬件環(huán)境:多媒體計算機(jī)
軟件環(huán)境:
1.WindowsXP操作系統(tǒng)
2.虛擬現(xiàn)實(shí)瀏覽器插件BS_Contact_VRML-X3D.
3.VRML編輯器vrmlpad.
實(shí)驗(yàn)原理
VRML所提供的視點(diǎn)是在所瀏覽的場景中預(yù)先由用戶定義的觀察位置及空間朝向。在這個位置且
通過該朝向,用戶可以瀏覽到虛擬世界中相應(yīng)場景的指定部分。
同一個VRML場景中可以設(shè)置許多個視點(diǎn),但一次瀏覽只有一個視點(diǎn)是可用的。視點(diǎn)控制通過
Viewpoint節(jié)點(diǎn)進(jìn)行實(shí)現(xiàn)。
虛擬場景中,NavigationInfo導(dǎo)航信息節(jié)點(diǎn)用來提供瀏覽者化身信息以及該化身如何使用當(dāng)前
的視點(diǎn)進(jìn)行系統(tǒng)導(dǎo)航。
實(shí)驗(yàn)內(nèi)容與步驟
實(shí)例1.視點(diǎn)應(yīng)用
1.代碼如下
#VRMLV2.0utf8
Background{
skyColor0.850.850.85
}
Viewpoint{
position0.00.016.0
description"view1"
}
Viewpoint{
position0.00.03.0
description"v2"
}
Viewpoint{
orientation001-0.0
description"v3"
}
Viewpoint{
orientation0011.571
description"v4"
}
Viewpoint{
fieldOfView0.1
description"v5"
}
Viewpoint{
fieldOfView1.571
orientation001-3.14
description"v6"
}
Viewpoint{
description"v7"
position001
}
Group{
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor0.20.40.6
}
}
geometryCone{
bottomRadius1
height2
}
}
Transform{
translation01.40
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor0.20.40.6
}
}
geometryBox{
size0.80.80.8
}
}
]
}
]
}
2.效果如下:
視點(diǎn)一視點(diǎn)二
視點(diǎn)三視點(diǎn)四
視點(diǎn)五視點(diǎn)六
實(shí)例2.導(dǎo)航控制
1.代碼如下
用到的實(shí)例
#VRMLV2.0utf8
Group{
children[
DEFylineGroup{
children[
DEFxlineGroup{
children[
DEFoneGroup{
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor0.690.360.93
specularColor0.530.530.53
ambientIntensity0.1
shininess0.9
}
}
geometrySphere{}
}
Transform{
translation0-1.30
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor110
specularColor0.820.28
0.28
ambientIntensity0.12
shininess0.8
}
}
geometryCone{}
}
]
}
]
}
Transform{
translation-400
children[
USEone
]
}
Transform{
translation400
children[
USEone
]
}
]
}
Transform{
translation0-40
children[
USExline
]
}
Transform{
translation040
children[
USExline
]
}
]
}
Transform{
translation00-4
children[
USEyline
]
}
Transform{
translation004
children[
USEyline
]
}
]
}
導(dǎo)航設(shè)置代碼一:
#VRMLV2.0utf8
NavigationInfo{
type"WALK"
}
Viewpoint{
position0022
}
Inline{
url"e12.2.wrl"
}
導(dǎo)航設(shè)置代碼二:
#VRMLV2.0utf8
NavigationInfo{
speed0
}
Viewpoint{
position0020
}
Inline{
url"e12.2.wrl"
}
實(shí)驗(yàn)五VRML動畫
一、實(shí)驗(yàn)?zāi)康?/p>
1.掌握VRML動畫的基本機(jī)理。
2.掌握VRML的5中基本動畫,并能自由地進(jìn)行程序設(shè)計。
二.實(shí)驗(yàn)器材
硬件環(huán)境:多媒體計算機(jī)
軟件環(huán)境:
1.WindowsXP操作系統(tǒng)
2.虛擬現(xiàn)實(shí)瀏覽器插件BS_Contact_VRML-X3D.
3.VRML編輯器vrmlpad.
三、實(shí)驗(yàn)原理
VRML動畫依據(jù)一個給定的時間傳感器以及一系列插補(bǔ)器節(jié)點(diǎn)對場景中的動畫進(jìn)行控制。節(jié)點(diǎn)不
但擁有域?qū)傩?,還有事件屬性,分為出事件和入事件eventOut,eventIn,域則分為私有域和公共域
exposedField。某個節(jié)點(diǎn)的事件出口和其他節(jié)點(diǎn)的事件入口之間用于傳遞事件的通道稱為路由。
通常情況下,時間傳感器的startTime域被另一個對用戶動作做出反應(yīng)的傳感器或腳本傳來的
時間事件設(shè)置。在startTime設(shè)定的時刻以前,時間傳感器不產(chǎn)生任何事件,在該時刻到來時,將
產(chǎn)生值為TRUE的isActive事件,并開始產(chǎn)生time,cycleTime和fraction_changed事件,time事
件是一個總保持當(dāng)前時刻值的連續(xù)發(fā)生的事件,而其他與時間相關(guān)的事件則是周期性發(fā)生的事件。
四、實(shí)驗(yàn)步驟
實(shí)例1.朝向插補(bǔ)器動畫
#VRMLV2.0utf8
Background{
skyColor111
}
DEFbarTransform{
translation-6.000
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor0.50.30
ambientIntensity0.4
specularColor0.70.70.6
shininess0.20
}
}
geometryCylinder{
height6.0
radius0.2
}
}
]
}
DEFclockTimeSensor{
cycleInterval8
loopTRUE
}
DEFinter1OrientationInterpolator{
key[
00.1250.25
0.3750.50.625
0.750.8751.0
]
keyValue[
00-10
00-10.875
00-11.571
00-12.356
00-13.141
00-13.926
00-14.711
00-15.496
00-16.281
]
}
DEFinter2PositionInterpolator{
key[
00.51.0
]
keyValue[
-600
000
600
]
}
ROUTEclock.fraction_changedTOinter1.set_fraction
ROUTEinter1.value_changedTObar.set_rotation
ROUTEclock.fraction_changedTOinter2.set_fraction
#ROUTEinter2.value_changedTObar.set_translation
效果圖如下,該實(shí)例實(shí)現(xiàn)了物體自由轉(zhuǎn)動的效果。
實(shí)例2.位置插補(bǔ)器動畫
#VRMLV2.0utf8
Background{
skyColor111
}
DEFballTransform{
children[
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor0.580.510.09
specularColor0.920.430.01
ambientIntensity0.117
shininess0.4
}
}
geometrySphere{}
}
]
}
DEFclockTimeSensor{
cycleInterval10
loopTRUE
}
DEFinterPositionInterpolator{
key[
00.330.671
]
keyValue[
-3.000
3.000
030
-300
]
}
ROUTEclock.fraction_changedTOinter.set_fraction
ROUTEinter.value_changedTOball.set_translation
該實(shí)例實(shí)現(xiàn)了造型的自由運(yùn)動
實(shí)例3.標(biāo)量插補(bǔ)器動畫
#VRMLV2.0utf8
Background{
skyColor111
}
DEFrotTransform{
children[
Shape{
appearanceAppearance{
materialDEFcolorMaterial{
diffuseColor0.80.50.8
transparency0
}
}
geometrySphere{
radius2
}
}
Shape{
appearanceAppearance{
materialMaterial{
diffuseColor100
}
}
geometryCone{
bottomRadius1
height2
}
}
]
}
DEFclockTimeSensor{
cycleInterval10
loopTRUE
}
DEFinter1ScalarInterpolator{
key[
00.250.50.751
]
keyValue[
00.500.50
]
}
DEFinter2OrientationInterpolator{
key[
00.1250.250.375
0.50.6250.750.875
1
]
keyValue[
1110.0
1110.785
1111.571
1112.356
1113.141
1114.711
1115.496
1116.281
]
}
ROUTEclock.fraction_changedTOinter1.set_fraction
ROUTEinter1.value_changedTOcolor.set_transparency
ROUTEclock.fraction_changedTOinter2.set_fraction
ROUTEinter2.value_changedTOrot.set_rotation
該實(shí)例通過標(biāo)量插補(bǔ),實(shí)現(xiàn)了物體透明度的變化。
實(shí)驗(yàn)六Cult3D技術(shù)
一、實(shí)驗(yàn)?zāi)康?/p>
1.掌握Cult3D技術(shù)的特點(diǎn),了解Cult3D技術(shù)的應(yīng)用領(lǐng)域
2.掌握Cult3D軟件的安裝與運(yùn)行,Cult3D作品的瀏覽
3.掌握Cult3D軟件的基本操作。
二、實(shí)驗(yàn)器材
硬件環(huán)境:多媒體計算機(jī)
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025云南昆明安寧市連然街道辦事處(第一批)招聘村(社區(qū))工作人員7人備考題庫附答案
- 2025年三原縣選聘縣直事業(yè)單位工作人員真題匯編附答案
- 商品選品員安全專項水平考核試卷含答案
- 辦公設(shè)備維修工9S考核試卷含答案
- 糖坯制造工標(biāo)準(zhǔn)化知識考核試卷含答案
- 注聚工QC管理考核試卷含答案
- 鍋爐設(shè)備裝配工操作評估評優(yōu)考核試卷含答案
- 水聲測量工安全生產(chǎn)能力模擬考核試卷含答案
- 2024年湖南信息學(xué)院輔導(dǎo)員招聘備考題庫附答案
- 2024年湖北省直屬機(jī)關(guān)業(yè)余大學(xué)輔導(dǎo)員招聘備考題庫附答案
- 離婚協(xié)議標(biāo)準(zhǔn)版(有兩小孩)
- 浙江省臺州市路橋區(qū)2023-2024學(xué)年七年級上學(xué)期1月期末考試語文試題(含答案)
- 假體隆胸后查房課件
- 2023年互聯(lián)網(wǎng)新興設(shè)計人才白皮書
- DB52-T 785-2023 長順綠殼蛋雞
- c語言知識點(diǎn)思維導(dǎo)圖
- 關(guān)于地方儲備糧輪換業(yè)務(wù)會計核算處理辦法的探討
- GB/T 29319-2012光伏發(fā)電系統(tǒng)接入配電網(wǎng)技術(shù)規(guī)定
- GB/T 1773-2008片狀銀粉
- GB/T 12007.4-1989環(huán)氧樹脂粘度測定方法
- (完整版)北京全套安全資料表格
評論
0/150
提交評論