【正文】
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事件域傳遞域值給時間傳感器TT的startTime域;第二條路由作用是時間傳感器TT的fraction_changed事件域傳遞域值給標量插補器dou3的set_fraction事件域;第三條作用是標量插補器dou3的value_changed事件域傳遞域值給Material節(jié)點的transparency域;第四條路由的作用是接觸傳感器toucher的touchTime事件域傳遞域值給腳本S的事件域ss,完成收獲物品和先后因之間切換的交互功能并最終顯示消費總金額。結論隨著虛擬現實技術的不斷發(fā)展,虛擬現實技術的應用領域越來越廣泛,終有一天要走入尋常百姓家。雖然就目前來說這一目標還有些遙遠,但隨著技術的不斷進步,人們的日常生活越來越方便快捷,虛擬日常生活總有一天會展示他強大的生命力,在社會生活中扮演重要的角色。虛擬現實技術在日常生活中的應用不應該只停留在演示階段,在完善功能技術的同時提高外部硬件設備的支持,使用戶能夠真正感受到虛擬現實帶來的“真實生活”。合理充分的運用虛擬現實技術使目標客戶可以在虛擬現實場景中自由行走、任意觀看,隨意的使用場景中的任何帶有交互功能的物體,徹底顛覆傳統(tǒng)三維動畫被動觀察無法互動的弊端,給目標客戶帶來前所未有的的真實感與沉浸感,使他們獲得身臨其境的真實感受?!疤摂M現實在超市及餐廳中的控制”正是實現了此項功能,該系統(tǒng)具有多種帶有交互功能的物體場景,操作簡單,用戶只需輕輕點擊或旋轉便可隨意操控各種廚房用電器,還可在虛擬的超市中購物,感受虛擬購物帶來的樂趣。該系統(tǒng)設具有多個視點,方便用戶全面而具體的了解整個場景設置,方便用戶完成各種交互功能。程序中所提供的各種廚房電器和超市用品都是現實生活中常見的,用戶在操作上不會有任何不了解的地方,更好地讓用戶了解虛擬日常生活帶來的方便和樂趣。由于硬件、軟件條件和時間所限制,該系統(tǒng)還存在不足之處。例如:(1)程序應具備強大的后臺數據庫,使超市場景中的各種物品種類更加豐富。(2)程序應向用戶提供超市中物品的退換貨功能。(3)程序應擴充餐廳部分的設備、更接近現實餐廳中的配置。相信通過今后的學習生活,我可以完善此次畢業(yè)設計中存在的不足之處。總結與體會此次畢業(yè)設計“虛擬現實在超市及餐廳中的控制”所涉及到的知識有3ds max建模, VRML實現動畫與交互功能、 JavaScript控制動態(tài)復雜場景等。這不僅是一個學習的過程,重要的是它將所學的各種專業(yè)課有機融合在一起,既鞏固了知識又鍛煉了實際操作能力,為今后就業(yè)打下良好的基礎。同時,此次的設計使我對以下幾方面的知識有所重新認識與體會。(1)3ds max所提供的一些光照效果、貼圖渲染效果在虛擬場景中是無法顯示的。(2)在制作動畫方面,使用3ds max、Cosmo world制作出的效果更好,程序也比較小,但導進VRML中要加入必要的節(jié)點語言實現其交互功能。(3)對圖片、音頻進行一些必要的壓縮處理會使程序運行起來更流暢。(4)所有程序在保存時勾選壓縮保存會使總程序的大小減少1/3以上。(5)用JavaScript編寫的腳本程序能實現VRML中自帶的插補器所實現不了的復雜場景交互,交互感更強。(6)利用JavaScript創(chuàng)造出來的場景更逼真,比如利用JavaScript編寫而成的天空更接近感官上的真實天空。隨著計算機技術的不斷發(fā)展,越來越多的人投入到這個領域中不斷創(chuàng)新,虛擬現實技術正在一步步地走進人們的生活中,大到醫(yī)療教育小到日常生活的方方面面,虛擬現實都在其中扮演著重要的角色。我相信學好用好這方面的知識技能,將對我今后的工作生活帶來極大地幫助。參考文獻[1] 黃文麗,盧碧紅,楊志剛,[M].北京:中國鐵道出版社,2003. 179~183.[2] Andrea Davied John [美] 宗志方、季暉、譚江天等譯. VRML資源手冊[M].北京:電子工業(yè)出版社,1998. 113~114.[3] [M].北京:高等教育出版社,2004. 198~227.[4] 張金釗,[M].北京:清華大學出版社,2007. 10~18.[5] 陽化冰,. 虛擬現實構造語言VRML[M].北京:北京航空航天大學出版社,2000. 7~25.[6] [M].北京:中國鐵道出版社,2002. 57~85.[7] 編程實例講解[M].北京:中國水利水電出版社,2002. 32~49.[8] [M].北京:中國水利水電出版社,2002. 65~77.[9] 陳定方,[M].北京:機械工業(yè)出版社,2002. 41~49.[10] [M]. 北京:北京大學出版社,2003. 121~147.[11] [M].北京:清華大學出版社,2001. 16~23,[12] 劉怡、張洪定、[M].天津:南開大學出版社,2007. 26~33.[13] 董銘,[M].北京:電子工業(yè)出版社,2000. 52~63.[14] 王汝傳,姚旭敏,王海艷,[J].系統(tǒng)仿真學報, 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