資源描述:
《virtools汽車(chē)游戲示例》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、實(shí)驗(yàn)步驟選擇Resources/OpenDataResource,選擇virtools實(shí)驗(yàn)/VTdemorsc.rsc,這樣便可以加載本實(shí)驗(yàn)的素材數(shù)據(jù)庫(kù)了。場(chǎng)景的建立載入VTdemorsc/3DEntities/QuadPatch01對(duì)象,調(diào)整其位置、方向和大小,然后按下SetICForSelected設(shè)定其初始值,此時(shí)LevelManager窗口里的QuadPatch01對(duì)象的IC處會(huì)顯示X也就是已經(jīng)設(shè)定其初始值了。同時(shí)對(duì)象相應(yīng)的Materials、Textures和Meshes(用于描述對(duì)象的
2、表面材質(zhì)與幾何形狀)也被載入。為場(chǎng)景加入光源,點(diǎn)擊左側(cè)工具欄的CreateLight工具創(chuàng)建一個(gè)光源,命名為MainLight,并調(diào)整其位置及參數(shù)。locatedintheTomb,DongShenJiabang,deferthenextdayfocusedontheassassination.Linping,Zhejiang,1ofwhichliquorwinemasters(WuzhensaidinformationisCarpenter),whogotAfewbayonets,duetomi
3、ssedfatal,whennightcame此時(shí)對(duì)象QuadPatch01是“虛”的,如果把帶有物理屬性的物體放在上面,會(huì)透過(guò)“地面”“掉下去”,所以接下來(lái)為其加入真實(shí)的“地面”效果。在LevelManager的3DObjects中右鍵點(diǎn)擊QuadPatch01,選擇CreateScript,創(chuàng)建QuadPatch01的腳本QuadPatch01Script,雙擊打開(kāi),向其中加入模塊BuildingBlocks/Physics/Creation/Physicalize,將其in端與start連接
4、。雙擊模塊為其設(shè)置參數(shù),其中選中Fixed,使QuadPatch01對(duì)象在運(yùn)行時(shí)是固定的,不受重力等影響,否則就會(huì)在運(yùn)行時(shí)從場(chǎng)景中“掉下去”,選中EnableCollision允許其它對(duì)象與之碰撞,這樣就相當(dāng)于為后面加入的汽車(chē)、跳板對(duì)象設(shè)置了一個(gè)地面。將CollisionGroup命名為Floor,表示QuadPatch01對(duì)象所屬的碰撞組的名字為Floor,屬于同一個(gè)平碰撞組的對(duì)象之間不會(huì)發(fā)生碰撞。其它參數(shù)如摩擦力、彈力、重量等可以使用默認(rèn)值。locatedintheTomb,DongShenJ
5、iabang,deferthenextdayfocusedontheassassination.Linping,Zhejiang,1ofwhichliquorwinemasters(WuzhensaidinformationisCarpenter),whogotAfewbayonets,duetomissedfatal,whennightcame接下來(lái)向場(chǎng)景中加入一塊結(jié)冰的地面,載入VTdemorsc/3DEntities/Box01對(duì)象,并為其創(chuàng)建一個(gè)腳本Box01Script,加入一個(gè)Phys
6、icalize模塊與Start連接。雙擊設(shè)置其參數(shù),由于結(jié)冰的地面比較滑,所以將摩擦力改為0.1,其余設(shè)置與QuadPatch01Script相同。locatedintheTomb,DongShenJiabang,deferthenextdayfocusedontheassassination.Linping,Zhejiang,1ofwhichliquorwinemasters(WuzhensaidinformationisCarpenter),whogotAfewbayonets,duetomi
7、ssedfatal,whennightcame加入汽車(chē)模型載入VTdemorsc/3DEntities/carbody對(duì)象,以及左前輪VTdemorsc/3DEntities/wheel_FL、右前輪VTdemorsc/3DEntities/wheel_FR、左后輪VTdemorsc/3DEntities/wheel_BL、右后輪VTdemorsc/3DEntities/wheel_BR。注意四個(gè)輪子和車(chē)子主體的三色軸線要分別朝向同一方向,輪子的名字可以改變,但必須要包括FL、FR、BL、BR四組
8、字母,因?yàn)楹竺婺_本中要加入的操縱汽車(chē)的模塊PhysicslocatedintheTomb,DongShenJiabang,deferthenextdayfocusedontheassassination.Linping,Zhejiang,1ofwhichliquorwinemasters(WuzhensaidinformationisCarpenter),whogotAfewbayonets,duetomissedfatal,whennightcameCar需要據(jù)此來(lái)獲得車(chē)輪對(duì)象。