【正文】
1]keyValue [1 1 0 0 0 0 0 0 0 0]}material DEF D Material {transparency 1}texture ImageTexture {url }DEF SW Switch {whichChoice 0choice [DEF s1 Transform {Children [Inline {url }] translation 0 1 0}DEF s2 Transform {children[Inline {url }]}]}DEF S Script {eventIn SFTime sfield SFNode SW USE SWurl javascript:function s(){ =1 }}ROUTE TO ROUTE TO ROUTE TO ROUTE TO 圖57收獲物品和收銀之間切換的效果圖1 圖58收獲物品和收銀之間切換的效果圖2程序中第一條路由的作用是接觸傳感器TF的touchTime事件域傳遞域值給時(shí)間傳感器TT的startTime域;第二條路由作用是時(shí)間傳感器TT的fraction_changed事件域傳遞域值給標(biāo)量插補(bǔ)器dou3的set_fraction事件域;第三條作用是標(biāo)量插補(bǔ)器dou3的value_changed事件域傳遞域值給Material節(jié)點(diǎn)的transparency域;第四條路由的作用是接觸傳感器toucher的touchTime事件域傳遞域值給腳本S的事件域ss,完成收獲物品和先后因之間切換的交互功能并最終顯示消費(fèi)總金額。結(jié)論隨著虛擬現(xiàn)實(shí)技術(shù)的不斷發(fā)展,虛擬現(xiàn)實(shí)技術(shù)的應(yīng)用領(lǐng)域越來越廣泛,終有一天要走入尋常百姓家。雖然就目前來說這一目標(biāo)還有些遙遠(yuǎn),但隨著技術(shù)的不斷進(jìn)步,人們的日常生活越來越方便快捷,虛擬日常生活總有一天會(huì)展示他強(qiáng)大的生命力,在社會(huì)生活中扮演重要的角色。虛擬現(xiàn)實(shí)技術(shù)在日常生活中的應(yīng)用不應(yīng)該只停留在演示階段,在完善功能技術(shù)的同時(shí)提高外部硬件設(shè)備的支持,使用戶能夠真正感受到虛擬現(xiàn)實(shí)帶來的“真實(shí)生活”。合理充分的運(yùn)用虛擬現(xiàn)實(shí)技術(shù)使目標(biāo)客戶可以在虛擬現(xiàn)實(shí)場(chǎng)景中自由行走、任意觀看,隨意的使用場(chǎng)景中的任何帶有交互功能的物體,徹底顛覆傳統(tǒng)三維動(dòng)畫被動(dòng)觀察無法互動(dòng)的弊端,給目標(biāo)客戶帶來前所未有的的真實(shí)感與沉浸感,使他們獲得身臨其境的真實(shí)感受。“虛擬現(xiàn)實(shí)在超市及餐廳中的控制”正是實(shí)現(xiàn)了此項(xiàng)功能,該系統(tǒng)具有多種帶有交互功能的物體場(chǎng)景,操作簡(jiǎn)單,用戶只需輕輕點(diǎn)擊或旋轉(zhuǎn)便可隨意操控各種廚房用電器,還可在虛擬的超市中購物,感受虛擬購物帶來的樂趣。該系統(tǒng)設(shè)具有多個(gè)視點(diǎn),方便用戶全面而具體的了解整個(gè)場(chǎng)景設(shè)置,方便用戶完成各種交互功能。程序中所提供的各種廚房電器和超市用品都是現(xiàn)實(shí)生活中常見的,用戶在操作上不會(huì)有任何不了解的地方,更好地讓用戶了解虛擬日常生活帶來的方便和樂趣。由于硬件、軟件條件和時(shí)間所限制,該系統(tǒng)還存在不足之處。例如:(1)程序應(yīng)具備強(qiáng)大的后臺(tái)數(shù)據(jù)庫,使超市場(chǎng)景中的各種物品種類更加豐富。(2)程序應(yīng)向用戶提供超市中物品的退換貨功能。(3)程序應(yīng)擴(kuò)充餐廳部分的設(shè)備、更接近現(xiàn)實(shí)餐廳中的配置。相信通過今后的學(xué)習(xí)生活,我可以完善此次畢業(yè)設(shè)計(jì)中存在的不足之處。總結(jié)與體會(huì)此次畢業(yè)設(shè)計(jì)“虛擬現(xiàn)實(shí)在超市及餐廳中的控制”所涉及到的知識(shí)有3ds max建模, VRML實(shí)現(xiàn)動(dòng)畫與交互功能、 JavaScript控制動(dòng)態(tài)復(fù)雜場(chǎng)景等。這不僅是一個(gè)學(xué)習(xí)的過程,重要的是它將所學(xué)的各種專業(yè)課有機(jī)融合在一起,既鞏固了知識(shí)又鍛煉了實(shí)際操作能力,為今后就業(yè)打下良好的基礎(chǔ)。同時(shí),此次的設(shè)計(jì)使我對(duì)以下幾方面的知識(shí)有所重新認(rèn)識(shí)與體會(huì)。(1)3ds max所提供的一些光照效果、貼圖渲染效果在虛擬場(chǎng)景中是無法顯示的。(2)在制作動(dòng)畫方面,使用3ds max、Cosmo world制作出的效果更好,程序也比較小,但導(dǎo)進(jìn)VRML中要加入必要的節(jié)點(diǎn)語言實(shí)現(xiàn)其交互功能。(3)對(duì)圖片、音頻進(jìn)行一些必要的壓縮處理會(huì)使程序運(yùn)行起來更流暢。(4)所有程序在保存時(shí)勾選壓縮保存會(huì)使總程序的大小減少1/3以上。(5)用JavaScript編寫的腳本程序能實(shí)現(xiàn)VRML中自帶的插補(bǔ)器所實(shí)現(xiàn)不了的復(fù)雜場(chǎng)景交互,交互感更強(qiáng)。(6)利用JavaScript創(chuàng)造出來的場(chǎng)景更逼真,比如利用JavaScript編寫而成的天空更接近感官上的真實(shí)天空。隨著計(jì)算機(jī)技術(shù)的不斷發(fā)展,越來越多的人投入到這個(gè)領(lǐng)域中不斷創(chuàng)新,虛擬現(xiàn)實(shí)技術(shù)正在一步步地走進(jìn)人們的生活中,大到醫(yī)療教育小到日常生活的方方面面,虛擬現(xiàn)實(shí)都在其中扮演著重要的角色。我相信學(xué)好用好這方面的知識(shí)技能,將對(duì)我今后的工作生活帶來極大地幫助。參考文獻(xiàn)[1] 黃文麗,盧碧紅,楊志剛,[M].北京:中國鐵道出版社,2003. 179~183.[2] Andrea Davied John [美] 宗志方、季暉、譚江天等譯. VRML資源手冊(cè)[M].北京:電子工業(yè)出版社,1998. 113~114.[3] [M].北京:高等教育出版社,2004. 198~227.[4] 張金釗,[M].北京:清華大學(xué)出版社,2007. 10~18.[5] 陽化冰,. 虛擬現(xiàn)實(shí)構(gòu)造語言VRML[M].北京:北京航空航天大學(xué)出版社,2000. 7~25.[6] [M].北京:中國鐵道出版社,2002. 57~85.[7] 編程實(shí)例講解[M].北京:中國水利水電出版社,2002. 32~49.[8] [M].北京:中國水利水電出版社,2002. 65~77.[9] 陳定方,[M].北京:機(jī)械工業(yè)出版社,2002. 41~49.[10] [M]. 北京:北京大學(xué)出版社,2003. 121~147.[11] [M].北京:清華大學(xué)出版社,2001. 16~23,[12] 劉怡、張洪定、[M].天津:南開大學(xué)出版社,2007. 26~33.[13] 董銘,[M].北京:電子工業(yè)出版社,2000. 52~63.[14] 王汝傳,姚旭敏,王海艷,[J].系統(tǒng)仿真學(xué)報(bào), 2003(15): 432~445.[15] Qi Liu,Alexei shape modeling extension of the Virtual Reality Modeling Language[J].Computers amp。 Graphics,2006,30: 526~558.附錄一 翻譯原文Knowledge of virtual reality extended scripting languageMustEvaluate domain specified how the script is evaluated to. When this field value is TRUE, whenever received by the node eventIn events to a new value, the browser will immediately calculate script. When this field value is FALSE, the program calculated the script, there may be browser delayed until the appropriate time es, these will cause the event to the node39。s transmission and puting nodes to defer action to deal with the incident. When the calculation has been delayed, if multiple events are delivered to the node, then the list of events to be processed will be longer. Under normal circumstances, the default script mustEvaluate domain value EAI is used for embedding the VRML browser into an application or an applet, which is either independent or within a Web browser. It can be called through both the COM interface and Java classes. Thus, languages such as C++ and Java can be employed to develop applications or applets through VRML EAI. Besides this, since it is a part of the VRML standard, all browsers support it, which ensures better patibility. However, since it is used for creating external programs, the extensions thus implemented cannot be integrated into the browser.DirectOutput domain description script output has been restricted. When this field when the value is FALSE. Script can only read other nodes in the case of public domain and eventOut value, but can not send its events (such as public domain or eventIn events to send a value). When DirectOutput domain value TURE, the script on other nodes can write to the public domain, or events to other nodes send eventIn value. In addition, when DirectOutput domain value is TRUE, the script can also add or remove space in a path. Typically, DirectOutput domain default value FALSE.url is the public domain, through the set_url send eventIn events can change the URL list. When receiving a value from the input, the corresponding threshold will be changed. Of course, the new value will be output by the domain url_changed eventOut event. When the Script node39。s URL list of changes, the current script will be terminated, the new script will be transferred and initialized.Script node field, eventIn, and eventOut syntax are defined by the url field value displayed in the Script node and the interface between the script. A Script node can have multiple interfaces field domain, eventIn events and eventOut event definition. field interfaces field, eventIn events and eventOut events within the node name must be unique.Script in the initialization, the program termination and the event received, the use of field, eventIn, and eventOut interface。 procedures seeded first read the script to initialize。 when the scene when replaced by other scenes as well as Script node is removed or the url field is changed, place procedures for termination。 Script node eventIn event interface through a value shall receive an event receiver. Initialization, the program terminated and the event received depends on the specific structure and syntax of the program