201207767 六、發明說明: 【發明所屬之技術領域】 [0001] 本發明涉及一種應用程式介面,尤其是關於一種應用於 嵌入式設備的三維網路用戶介面及其實現方法。201207767 VI. Description of the Invention: [Technical Field] The present invention relates to an application interface, and more particularly to a three-dimensional network user interface applied to an embedded device and an implementation method thereof.
【先前技術J[Prior Art J
[0002] X3D (Extensible 3D)是Web3D聯盟發佈的網路三維内 容標準,其被定義可交互操作,可擴展,跨平臺的網路 3D内容標準。X3D是虛擬現實建模語言(Virtual Reality Modeling Language,VRML)的升級版本, 可以廣泛應用於基於電腦設備上實現虛擬三維場景的渲 染。 [0003] 另一方面,嵌入式設備,例如手機、個人數位助理、機 頂盒等,越來越廣泛地被人們使用。目前,還沒有一種 介面可以實現在嵌入式設備上利用X3D渲染虛擬三維場景 〇 【發明内容】 [0004] 鑒於以上内容,有必要提出一種應用於嵌入式設備的三 維網路用戶介面及其實現方法,可以在嵌入式設備上利 用X3D渲染虛擬三維場景。 [0005] —種應用於嵌入式設備的三維網路用戶介面,該三維網 路用戶介面包括: [0006] 格式支援模組,用於設置該三維網路用戶介面支援的編 程語言及網頁協定; [0007] 檔案嵌入模組,用於接收用戶編寫的X3D檔案,選擇三維 099126865 表單編號A0101 第4頁/共16頁 0992047164-0 201207767 網路用戶介面支援的一種編程語言及網頁協定將該X3D檔 案嵌入到一個超文本標記語言(HTML)檔案中; [0008] 瀏覽器插件,用於解釋該HTML檔案中的X3D檔案,包括對 X3D檔案中的語句進行語法檢查,以及將X3D檔案中的語 法拆解或解釋為網頁瀏覽器可以理解的語法格式; [0009] 圖形程式介面轉換模組,用於將應用於電腦的圖形程式 介面Open GL轉換為應用於嵌入式設備的圖形程式介面 OpenGL ES ;[0002] X3D (Extensible 3D) is a network 3D content standard published by the Web3D Alliance, which is defined as an interoperable, scalable, cross-platform network 3D content standard. X3D is an upgraded version of Virtual Reality Modeling Language (VRML) that can be widely used to render virtual 3D scenes based on computer devices. [0003] On the other hand, embedded devices, such as mobile phones, personal digital assistants, set-top boxes, and the like, are increasingly being used by people. At present, there is no interface that can realize virtual 3D scenes using X3D on embedded devices. [Invention] [0004] In view of the above, it is necessary to propose a three-dimensional network user interface for embedded devices and an implementation method thereof. You can use X3D to render virtual 3D scenes on embedded devices. [0005] A three-dimensional network user interface for an embedded device, the three-dimensional network user interface includes: [0006] a format support module for setting a programming language and a web page protocol supported by the three-dimensional network user interface; [0007] File embedding module for receiving user-written X3D files, selecting three-dimensional 099126865 Form No. A0101 Page 4/16 pages 0992047164-0 201207767 A programming language supported by the web user interface and a web page agreement to the X3D file Embedded in a Hypertext Markup Language (HTML) file; [0008] A browser plugin that interprets X3D files in the HTML file, including syntax checking of statements in X3D files, and grammar in X3D files Solving or interpreting a grammatical format that can be understood by a web browser; [0009] a graphical program interface conversion module for converting a graphics program interface Open GL applied to a computer into a graphics program interface OpenGL ES for an embedded device;
[0010] OpenGL ES,用於根據瀏覽器插件的解釋結果執行相應 的函數繪製HTML檔案中的三維場景;及 [0011] 網頁瀏覽器,用於將繪製的三維場景輸出至嵌入式設備 的顯示器。 [0012] —種在嵌入式設備上實現三維網路用戶介面的方法,該 方法包括: [0013] 設置該三維網路用戶介面支援的編程語言及網頁協定;[0010] The OpenGL ES is configured to execute a corresponding function to draw a three-dimensional scene in the HTML file according to the interpretation result of the browser plug-in; and [0011] a web browser for outputting the drawn three-dimensional scene to the display of the embedded device. [0012] A method for implementing a three-dimensional network user interface on an embedded device, the method comprising: [0013] setting a programming language and a webpage protocol supported by the three-dimensional network user interface;
[0014] 接收用戶編寫的X3D檔案,選擇三維網路用戶介面支援的 一種編程語言及網頁協定將該X3D檔案嵌入到一個超文本 標記語言(HTML)檔案中; [0015] 解釋該HTML檔案中的X3D檔案,包括對X3D檔案中的語句 進行語法檢查,以及將X3D檔案中的語法拆解或解釋為網 頁瀏覽器可以理解的語法格式; [0016] 將應用於電腦的圖形程式介面Open GL轉換為應用於嵌入 式設備的圖形程式介面OpenGL ES; 099126865 表單編號A0101 第5頁/共16頁 0992047164-0 201207767 [0017] 根據解釋結果執行OpenGL ES中的相應函數繪製HTML檔 案中的三維場景;及 [0018] 將繪製的三維場景輸出至嵌入式設備的顯示器。 [0019] 相較於習知技術,本發明所提供之應用於嵌入式設備的 三維網路用戶介面及其實現方法可以在嵌入式設備上利 用X3D渲染虛擬三維場景。 【實施方式】 [0020] 參閱圖1所示,係本發明應用於嵌入式設備100的三維網 路用戶介面10較佳實施例之應用環境圖。在本實施例中 ,所述嵌入式設備10 0可以為手機,個人數位助理,機頂 盒等。該三維網路用戶介面10用於在該嵌入式設備100上 實現利用X3D(宣染虛擬三維(Three-Dimensional,3D )場景。 [0021] 所述嵌入式設備100還包括儲存器20、微處理器30及顯示 器40。 [0022] 儲存器20用於儲存三維網路用戶介面10的程式化代碼。 該儲存器20可以為智慧媒體卡(Smart Media Card) 、安全數位卡(Secure Digital Card)、快閃儲存器 卡(Flash Card)等儲存設備。 [0023] 微處理器30用於執行三維網路用戶介面10的程式化代碼 ,實現利用X3D渲染虛擬3D場景。 [0024] 顯示器40用於顯示生成的虛擬3D場景。 [0025] 參閱圖2所示,係圖1中三維網路用戶介面1 0之功能模組 099126865 表單編號A0101 第6頁/共16頁 0992047164-0 201207767 [0026] ❹ [0027] ❹ 圖。在本實施例中,該三維網路用戶介面10包括格式支 援模組11、檔案嵌入模組12、網頁瀏覽器13、圖形程式 介面轉換模組1 4及應用於嵌入式系統的開放式圖形程式 介面(Open Graphics Library for Embedded Sy s-tems,OpenGL ES) 15。其中,網頁瀏覽器13包括瀏覽 器插件130。 格式支援模組11用於設置三維網路用戶介面10支援的編 程語言及網頁協定。在本實施例中,所述三維網路用戶 介面1 0支援的編程語言及網路協定為X3D標準支援的編程 語言及網頁協定。其中,X3D標準支援的編程語言及網頁 協定包括虛擬現實建模語言(Virtual Reality Modeling Language , VRML) 、 可擴展標記語言 (Extensible Markup Language,XML ) 'JavaScript、 Java、Java3D等。 檔案嵌入模組12用於接收用戶編寫的X3D檔案,選擇三維 網路用戶介面10支援的一種編程語言及網頁協定(例如 JavaScr ipt或XML )將該X3D檔案嵌入到一個超文本標 記語言(Hypertext Mark-up Language,HTML)檔案 中。所述X3D檔案,例如尾碼為“.wrl” ,“.x3d” , x3dv”的檔案,定義了需要生成的3D虛擬場景。用戶 可以利用3D模型創建工具,例如MAYA,Blender,AC3D 等創建該X3D文件。 瀏覽器插件130解釋HTML檔案中的X3D檔案,包括對X3D 檔案中的語句進行語法檢查,以及將X3D檔案中的語法拆 解或解釋為網頁瀏覽器13可以理解的語法格式。該瀏覽 099126865 表單編號A0101 第7頁/共16頁 0992047164-0 [0028] 201207767 器插件130可以為Freewrl。Freewrl是X3D權案的播放 器。 [0029] 圖形程式介面轉換模組1 4將應用於電腦的圖形程式介面 OpenGL轉換為應用於嵌入式設備的圖形程式介面OpenGL ES 15。這裏的轉換包括對OpenGL中的函數進行刪減, 例如刪減0 p e n G L中的四邊形、多邊形等複雜圖元的函數 ,以及以一些嵌入式環境開發的函數取代OpenGL中原有 的一些函數。 [0030] OpenGL ES 15根據瀏覽器插件130的解釋結果執行相應 的函數繪製HTML檔案中的3D場景。網頁瀏覽器13將繪製 的3D場景輸出至嵌入式設備100的顯示器40,在顯示器 40上播放該3D場景。該網頁瀏覽器13可以為Webkit。 [0031] 參閱圖3所示,係本發明在嵌入式設備上實現三維網路用 戶介面的方法較佳實施例之流程圖。 [0032] 步驟S301,透過格式支援模組11設置三維網路用戶介面 10支援的編程語言及網頁協定。在本實施例中,所述三 維網路用戶介面10支援的編程語言及網路協定為X3D標準 支援的編程語言及網頁協定。其中,X3D標準支援的編程 語言及網頁協定包括VRML、XML、JavaScript、Java、 Java3D 等。 [0033] 步驟S303,透過檔案嵌入模組12接收用戶編寫的X3D檔 案,選擇三維網路用戶介面10支援的一種編程語言及網 頁協定(例如JavaScript或XML),將該X3D檔案嵌入 到一個HTML檔案中。該X3D檔案定義了需要生成的3D虛 099126865 表單編號A0101 第8頁/共16頁 0992047164-0 201207767 擬場景,其可以為尾碼為“.wrl” 、“.x3d”或“ .x3dv”的文件。用戶可以利用3D模型創建工具如MAYA ,Blender,AC3D等創建該X3D文件。 [0034] 步驟S305,利用瀏覽器插件130解釋HTML檔案中的X3D檔 案,包括對X3D檔案中的語句進行語法檢查,以及將X3D 檔案中的語法拆解或解釋為網頁瀏覽器13可以理解的語 法格式。該劇覽器插件130可以為Freewrl。Freewrl是 X3D檔案的播放器。 ^ [0035] 步驟S307,利用圖形程式介面轉換模組14將應用於電腦 的圖形程式介面OpenGL轉換為應用於嵌入式設備的圖形 程式介面OpenGL ES 15。所述轉換包括對OpenGL中的 函數進行刪減,例如刪減OpenGL中的四邊形、多邊形等 複雜圖元的函數,以及以一些嵌入式環境開發的函數取 代OpenGL中原有的一些函數。 [0036] 步驟S309,OpenGL ES 15根據瀏覽器插件130的解釋結 果執行相應的函數繪製HTML檔案中的3D場景。網頁瀏覽 〇 器1 3將繪製的3D場景輸出至嵌入式設備10 0的顯示器40 ,在顯示器40上播放該3D場景。該網頁瀏覽器13可以為 Webk i t。 [0037] 最後應說明的是,以上實施方式僅用以說明本發明的技 術方案而非限制,儘管參照較佳實施方式對本發明進行 了詳細說明,本領域的普通技術人員應當理解,可以對 本發明的技術方案進行修改或等同替換,而不脫離本發 明技術方案的精神和範圍。 099126865 表單編號A0101 第9頁/共16頁 0992047164-0 201207767 【圖式簡單說明】 [0038] 圖1係本發明應用於嵌入式設備的三維網路用戶介面較佳 實施例之應用環境圖。 [0039] 圖2係本發明應用於嵌入式設備的三維網路用戶介面較佳 實施例之功能模組圖。 [0040] 圖3係本發明在嵌入式設備上實現三維網路用戶介面的方 法較佳實施例之流程圖。 【主要元件符號說明】 [0041] 散入式設備: 100 [0042] 三維網路用戶介面:1 0 [0043] 儲存器:20 [0044] 微處理器:30 [0045] 顯示器:4 0 [0046] 格式支援模組 :11 [0047] 檔案嵌入模組 :12 [0048] 網頁瀏覽器: 13 [0049] 圖形程式介面轉換模組:14 [0050] OpenGL ES : 15 [0051] 瀏覽器插件: 130 099126865 表單編號A0101 第10頁/共16頁 0992047164-0[0014] receiving a X3D file written by a user, selecting a programming language supported by a three-dimensional network user interface, and a web page protocol to embed the X3D file into a Hypertext Markup Language (HTML) file; [0015] interpreting the HTML file X3D file, including grammar checking of the statements in the X3D file, and disassembling or interpreting the grammar in the X3D file as a grammatical format understandable by the web browser; [0016] converting the graphics program interface Open GL applied to the computer into Graphical program interface for embedded devices OpenGL ES; 099126865 Form number A0101 Page 5 of 16 0992047164-0 201207767 [0017] According to the interpretation result, the corresponding function in OpenGL ES is used to draw the 3D scene in the HTML file; and [ 0018] Outputs the drawn 3D scene to the display of the embedded device. Compared with the prior art, the three-dimensional network user interface and the implementation method thereof for the embedded device provided by the present invention can use the X3D to render the virtual three-dimensional scene on the embedded device. [Embodiment] [0020] Referring to FIG. 1, the application environment diagram of the preferred embodiment of the three-dimensional network user interface 10 of the embedded device 100 is applied. In this embodiment, the embedded device 100 may be a mobile phone, a personal digital assistant, a set top box, or the like. The three-dimensional network user interface 10 is configured to implement X3D (Three-Dimensional, 3D) scenes on the embedded device 100. [0021] The embedded device 100 further includes a storage device 20 and a micro processing device. The storage device 20 is configured to store a stylized code of the three-dimensional network user interface 10. The storage device 20 can be a smart media card (Smart Media Card) or a secure digital card (Secure Digital Card). A storage device such as a flash memory card. [0023] The microprocessor 30 is configured to execute a programmatic code of the three-dimensional network user interface 10 to implement rendering of a virtual 3D scene using X3D. [0024] The display 40 is for displaying The generated virtual 3D scene [0025] Referring to FIG. 2, the function module of the three-dimensional network user interface 10 in FIG. 1 is 099126865 Form No. A0101 Page 6/16 pages 0992047164-0 201207767 [0026] ❹ [ In the embodiment, the three-dimensional network user interface 10 includes a format support module 11, a file embedding module 12, a web browser 13, a graphical program interface conversion module 14, and an embedded system. Open The graphic browser interface (Open Graphics Library for Embedded Sy s- tems, OpenGL ES) 15. The web browser 13 includes a browser plug-in 130. The format support module 11 is configured to set a programming language supported by the three-dimensional network user interface 10 and Web page protocol. In this embodiment, the programming language and network protocol supported by the three-dimensional network user interface 10 is a programming language and webpage protocol supported by the X3D standard. Among them, the programming language and webpage protocol supported by the X3D standard include virtual Virtual Reality Modeling Language (VRML), Extensible Markup Language (XML) 'JavaScript, Java, Java3D, etc. The file embedding module 12 is used to receive user-written X3D files and select a three-dimensional network. A programming language and web page protocol supported by the user interface 10 (such as JavaScr ipt or XML) embeds the X3D file into a Hypertext Mark-up Language (HTML) file. For example, the X3D file, for example, the last code is The ".wrl", ".x3d", x3dv" files define the 3D virtual scenes that need to be generated. Users can take advantage of 3D model creation tools such as MAYA, Blender, AC3D and so create the X3D file. The browser plugin 130 interprets the X3D file in the HTML file, including grammar checking the statements in the X3D file, and disassembling or interpreting the grammar in the X3D file as a grammatical format that the web browser 13 can understand. The browse 099126865 Form number A0101 Page 7 of 16 0992047164-0 [0028] 201207767 The plugin 130 can be Freewrl. Freewrl is the player for X3D rights. [0029] The graphic program interface conversion module 14 converts the graphics program interface OpenGL applied to the computer into the graphics program interface OpenGL ES 15 for the embedded device. The transformation here includes the deletion of functions in OpenGL, such as the function of truncating complex elements such as quads and polygons in 0 p e n G L , and replacing some of the original functions in OpenGL with functions developed in some embedded environments. [0030] The OpenGL ES 15 executes a corresponding function to draw a 3D scene in the HTML file according to the interpretation result of the browser plug-in 130. The web browser 13 outputs the drawn 3D scene to the display 40 of the embedded device 100, and plays the 3D scene on the display 40. The web browser 13 can be a webkit. [0031] Referring to FIG. 3, a flow chart of a preferred embodiment of a method for implementing a three-dimensional network user interface on an embedded device. [0032] Step S301, the programming language supported by the three-dimensional network user interface 10 and the webpage protocol are set through the format support module 11. In this embodiment, the programming language and network protocol supported by the 3D network user interface 10 are programming languages and web page protocols supported by the X3D standard. Among them, the programming languages and web protocols supported by the X3D standard include VRML, XML, JavaScript, Java, Java3D, and so on. [0033] Step S303, receiving the X3D file written by the user through the file embedding module 12, selecting a programming language supported by the three-dimensional network user interface 10 and a webpage protocol (such as JavaScript or XML), and embedding the X3D file into an HTML file. in. The X3D file defines the 3D virtual 099126865 form number A0101 to be generated. Page 8 of 16 0992047164-0 201207767 The proposed scene can be a file with a trailing code of ".wrl", ".x3d" or ".x3dv". . Users can create this X3D file using 3D model creation tools such as MAYA, Blender, AC3D, etc. [0034] Step S305, using the browser plug-in 130 to interpret the X3D file in the HTML file, including performing grammar check on the statement in the X3D file, and disassembling or interpreting the grammar in the X3D file as a grammar understandable by the web browser 13 format. The browser plugin 130 can be Freewrl. Freewrl is the player for X3D files. [0035] Step S307, the graphics program interface OpenGL applied to the computer is converted into a graphics program interface OpenGL ES 15 for the embedded device by using the graphic program interface conversion module 14. The conversion includes deleting functions in OpenGL, such as deleting functions of complex primitives such as quadrilaterals and polygons in OpenGL, and replacing some of the original functions in OpenGL with functions developed in some embedded environments. [0036] Step S309, the OpenGL ES 15 executes a corresponding function to draw a 3D scene in the HTML file according to the interpretation result of the browser plug-in 130. The web browsing device 13 outputs the drawn 3D scene to the display 40 of the embedded device 100, and plays the 3D scene on the display 40. The web browser 13 can be Webk i t. [0037] It should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention and are not intended to be limiting, and the present invention will be described in detail with reference to the preferred embodiments. The technical solutions are modified or equivalently substituted without departing from the spirit and scope of the technical solutions of the present invention. 099126865 Form No. A0101 Page 9 of 16 0992047164-0 201207767 [Simple Description of the Drawings] [0038] FIG. 1 is an application environment diagram of a preferred embodiment of a three-dimensional network user interface of the present invention applied to an embedded device. 2 is a functional block diagram of a preferred embodiment of the three-dimensional network user interface of the present invention applied to an embedded device. 3 is a flow chart of a preferred embodiment of a method for implementing a three-dimensional network user interface on an embedded device in accordance with the present invention. [Main component symbol description] [0041] Dived device: 100 [0042] 3D network user interface: 1 0 [0043] Memory: 20 [0044] Microprocessor: 30 [0045] Display: 4 0 [0046 Format Support Module: 11 [0047] File Embedding Module: 12 [0048] Web Browser: 13 [0049] Graphical Programme Interface Conversion Module: 14 [0050] OpenGL ES : 15 [0051] Browser Plugin: 130 099126865 Form No. A0101 Page 10 / Total 16 Page 0992047164-0