1. Technical Field
The embodiments of the present disclosure relate to webpage technology, and particularly to a system and method of displaying a three-dimensional image in a webpage.
2. Description of Related Art
Electronic commerce is a booming business on the Internet. Additionally, it is necessary to show pictures of the products on a webpage of an electronic commerce website, so that the consumer can see the products. However, most pictures are bitmaps, such as graphics interchange format (GIF) or joint photographic experts group (JPEG) pictures, which are two-dimensional images. Therefore, there is room for improvement in the art for displaying 3D images in the webpage.
The disclosure is illustrated by way of examples and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, JAVA, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The generation module 210 generates the webpage and a 3D image file. The webpage may be, but is not limited to, an active server pages (ASP) webpage, a JAVA server pages (JSP) webpage, a hypertext preprocessor (PHP) webpage, or a hypertext markup language (HTML) webpage. The 3D image file may be, but is not limited to, a TXT file or a scalable vector graphics (SVG) file. In one embodiment, the generation module 210 invokes a file editor (e.g., MICROSOFT VISUAL STUDIO) to generate the webpage and the 3D image file.
The insertion module 220 inserts the 3D image file into the webpage. To enhance a scalability of the webpage, the webpage provides one or more tags for extension. The insertion module 220 searches for a tag in the webpage and inserts the 3D image file into the webpage at a position of the tag in the webpage. For example, the ASP webpage provides three tags, such as, iframe, embed and object. The insertion module 220 searches for the iframe in the ASP webpage and inserts the 3D image file at the position of the iframe in the webpage.
The configuration module 230 configures the 3D image file and inserts a 3D image into the 3D image file. The 3D image file is configured with a background layer, a canvas layer, one or more displaying layers and one or more shadow layers. The background layer obtains event responses from the keyboard 3 and the mouse 4 and operates the 3D image, such as, drags the 3D image, zooms in the 3D image, zooms out the 3D image, or rotates the 3D image. The canvas layer is embedded into the background layer, and displays the 3D image. The canvas layer displays the 3D image using a DOM (a tag of SVG). One or more displaying layers are embedded into the canvas layer and each displaying layer includes one 3D image. In other words, the configuration module 230 inserts the 3D image into the displaying layer. One or more shadow layers are embedded into the displaying layer, and each displaying layer may include one or more shadow layers. Each shadow layer helps to create a shadow around the 3D image when the 3D image is displayed on the display device 1. Additionally, it is an option to include one or more shadow layers in the webpage. In other words, the one or more shadow layers are not necessary in the webpage.
The 3D image is inserted into the displaying layer of the 3D image file using a link. For example, if the 3D image is the link, the configuration module 230 inserts the link into a position of a link attribute (e.g., xlink:href) of the displaying layer. The configuration module 230 can draw the 3D image in the displaying layer of the 3D image file. In one embodiment, the configuration module 230 establishes a coordinate system in the displaying layer and draws the 3D image in the DOM of the 3D image file. The configuration module 230 also sets attribute of the 3D image, for example, a color of the 3D image or a name of the 3D image.
The generation module 210 generates a control file and associates the control file with the 3D image file. The control file can drag the 3D image, zoom in the 3D image, zoom out the 3D image, or rotate the 3D image. The control file may be, but is not limited to, a JAVASCRIPT (JS) file. The control file is associated with the 3D image file using an event. In one embodiment, the background layer of the 3D image file is added by the event, and the control file is added by a function of the event, then the control file is associated with the 3D image file. The function of the event in the control file is invoked when the 3D image file runs. For example, if the background layer is added by the event “onload=Initialize(evt),” and the control file is added by the function of the event “Initialize(evt),” the control file is associated with 3D image file. “Initialize(evt)” in the control file is invoked when the 3D image file runs to “onload=Initialize(evt). Additionally, the background layer is added by one or more events, and the control file is added by the function of each event. For example, if a user desires to drag the 3D image using the mouse 4, the background layer is added by the event “onload=MouseDown(evt),” and the control file is added by the function of the event “MouseDown(evt).”
The display module 240 displays the 3D image in the webpage and operates the 3D image by invoking the control file when the webpage is accessed. In one embodiment, when the user accesses the webpage using the browser, the display module 240 checks that the webpage includes the 3D image file, and the 3D image can be operated using the control file when the 3D file runs.
In step S10, the generation module 210 generates a webpage and a 3D image file. As mentioned above, the generation module 210 invokes a file editor (e.g., MICROSOFT VISUAL STUDIO) to generate the webpage and the 3D image file.
In step S20, the insertion module 220 inserts the 3D image file into the webpage. In one embodiment, if the webpage is an ASP webpage, the insertion module 220 searches for the iframe in the ASP webpage and inserts the 3D image file at the position of the iframe in the webpage.
In step S30, the configuration module 230 configures the 3D image file and inserts a 3D image into the 3D image file. As mentioned above, the 3D image file is configured with a background layer, a canvas layer, one or more displaying layers and one or more shadow layers. The configuration module 230 inserts the 3D image into the displaying layer of the 3D image file using a link. For example, if the 3D image is the link, the configuration module 230 inserts the link into a position of a link attribute (e.g., xlink:href) of the displaying layer. The configuration module 230 can draw the 3D image in the displaying layer of the 3D image file instead of the link. In one embodiment, the configuration module 230 establishes a coordinate system in the displaying layer and draws the 3D image in the DOM of the 3D image file. The configuration module 230 also sets attribute of the 3D image, for example, a color of the 3D image or a name of the 3D image. The attribute of the 3D image can be searched by a search engine.
In step S40, the generation module 210 generates a control file and associates the control file with the 3D image file. The control file can drag the 3D image, zoom in the 3D image, zoom out the 3D image, or rotate the 3D image. The control file may be, but is not limited to, a JAVASCRIPT (JS) file. The control file is associated with the 3D image file using one or more events. In one embodiment, the background layer of the 3D image file is added by the event, and the control file is added by a function of the event, then the control file is associated with the 3D image file. The function of the event in the control file is invoked when the 3D image file runs. For example, if the background layer is added by the event “onload=Initialize(evt),” and the control file is added by the function of the event “Initialize(evt)” in the JS file, the control file is associated with 3D image file. “Initialize(evt)” in the control file is invoked when the 3D image file runs to “onload=Initialize(evt). Additionally, the background layer is added by one or more events, and the control file is added by the function of each event. For example, if a user desires to drag the 3D image using the mouse 4, the background layer is added by the event “onload=MouseDown(evt),” and the control file is added by the function of the event “MouseDown(evt).”
In step S50, the display module 240 displays the 3D image in the webpage and operates the 3D image by invoking the control file when the webpage is accessed. In one embodiment, when the user accesses the webpage using the browser, the display module 240 checks that the webpage includes the 3D image file, and the 3D image can be operated using the control file when the 3D image is displayed on the display device 1. For example, when the user uses the mouse 4 to drag the 3D image, the control file executes the function of event for dragging, and sends the event response to the background layer of the 3D image file, then the 3D image is dragged to a desired position.
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
2013100332360 | Jan 2013 | CN | national |