Development of WebGL-based Virtual Teaching Platform for Mold Design

— As an outcome of the further development of modern simulation technology, virtual technology has been widely used under the support of computer technology and multimedia technology and provides more interactivity and perceptibility. However, in the past, the design of virtual teaching system was mainly based on theoretical analysis, resulting in low practicability. The appearance of WebGL standard simplifies the procedure of developing web-specific rendering plug-ins, contributing to more seamless 3D scenes and models. This study constructed the theory from several aspects including multimedia teaching effect under cognitive theory, WebGL architecture, design of virtual teaching curriculum based on WebGL, and built a WebGL-based virtual teaching platform for mole design through designing the overall framework and constructing the three-dimensional teaching environment. Practice has proved that the platform makes it convenient for users to create teaching scenarios and engage in interactions, and strengthens students’ understanding of theoretical knowledge and skill practice.


Introduction
Virtual technology as a new type technology based on multiple computer technologies and multimedia technology can simulate and virtualize the real world or objects so as to satisfy people's demands by adjusting self-variation according to surrounding environment changes. Virtual technology based on people's own sense organs can establish 3D images according to direct sensory feeling, so it has high facticity [1]. Advanced virtual technology can combine virtual space with realistic environment to realize system-human interaction by obtaining surrounding and human real-time data. In addition, virtual technology can perceive through vision, as well as sense of hearing and touching. The more lifelike of the simulation experience, the stronger of the interactivity and perceptibility can be provided.
With the increasing maturity of virtual technology, people have simulated the real world in several fields such as commodity display, game development, and military training [2] with preliminary progress achieved. In teaching field, especially medical, PE, and design major teaching have high requirements for practical ability [3]. But problems such as substandard teaching procedures and great practice difficulties prevail. Take Mould Design course as the example. On one hand, traditional teaching environment is greatly different with enterprise actual production environment. On the other hand, mould design is very dangerous. So it is very urgent to introduce virtual technology and virtual teaching system to mould design teaching.
Virtual teaching system achieved complete simulation to a large degree by means of making the teaching course into animation with virtual technology and adding more interactivity and facticity on this basis. Current well-designed virtual teaching system has been widely used in medical experiments, engineering drawing and relevant fields, which has great significance for improving practical teaching effect. This paper conducted irtual "Mould Design" teaching course development based on WebGL technology for the purpose of compensating hardware facility deficiency in universities, and improving students' learning interest by virtue of the interactivity and creativity of virtual technology so as to achieve better teaching effect.

State of the art
Under the background of virtual technology rapid development, domestic and overseas teachers and scholars have realized the necessity of introducing virtual technology into course teaching. With Mould Design and Manufacturing course as the example, Bao, et al. [4] proposed the feasibility of applying 3D VR technology to classroom teaching based on analyzing shortcomings of traditional mould teaching and combining with characteristics of mould main curriculum. Based on theoretical analysis, the scholar also specifically designed the application process of virtual simulation technology with mould design and manufacturing as the principal line. Sun, et al. [5]analyzed the realistic predicament of practical teaching, proposed the construction elements of virtual-real synthesis mould design manufacturing practical teaching system and its improving effect on practical teaching based on virtual simulation technology, computer network technology and multimedia technology. Although people generally agree that virtual technology will bring great change to traditional teaching mode, virtual technology application in educational field is in start stage. There still exist a lot of barriers for the combination of virtual technology and teaching practice.
In recent years, some scholars noticed the standardization of WebGL, the 3D graphics protocol, and tried to introduce it into virtual teaching system development. Burdea, et al. [6] proposed virtual mould rehabilitation technology. The casting process of the hollow turbine blade is simulated by means of the software ProCAST, and the displacement field of the blade is calculated with a finite element model, based on which the mold cavity is optimized by the anti-deformation virtual mold-repair method. As testified by a simulation of the revised mold cavity and identified by a mold cavity model, satisfactory results of mold repair are achieved by this method. This method achieved satisfied effect for mould rehabilitation with product qualification ratio increased by 20%. Technology, et al. [7] conducted modelling of the engineering drawing combination with AutoCAD as modeling tool, and realized the analytical reading of model data file, shader programming, and addition of interactive processing program with WebGL technology through analyzing the export file of its STL format, researched and developed engineering drawing model base operating in browsers, and provided thoughts for virtual model base R&D. Alexiadis, et al. [8] based on WebGL technology, a virtual lab on multimedia systems for telecommunications, medical, and remote sensing applications is presented; consisting of 20 graphical user interfaces, it can support teaching activities for various DSP concepts. The virtual lab developed was used as a teaching companion for a post-graduate course on multimedia content management, to enhancing student comprehension of the material taught; it has been made freely available for similar educational or research purposes. Kun, et al. [9] designed and implemented medical virtual experiment system needed by Chinese medical college education and teaching. The implementation of the system will play an important role of improving medical education technology, improving teaching experiment environment, optimizing teaching process, cultivating talents with innovative awareness and ability, reducing teachin cost. Sun, et al. [10] developed and completed casting virtual experiment teaching system based on WebGL. In this virtual teaching system which is available for students' direct interaction with teaching contents through browser in any devices can realize students' immersive learning any time anywhere. It provided good reference for this paper design.
To sum up, course teaching represented by medicine, design majors are in urged demand of virtual teaching system. But there are some defects such as theoretical analysis oriented and low practicability [11]. In addition, most universities use profession 3D software for scene drawing, which requires for a large amount of professional knowledge and long construction period. And the model built is different with the display effect during actual operation with low efficiency and high complexity. Virtual teaching course based on WebGL in this design is obviously different with traditional teaching mode and previous virtual teaching systems. Introduction of WebGL technology standard can effectively solve current problems in Web interactive 3D animation, and realize Web interaction 3D animation production with HTML script itself, and realize graphic rendering through uniform, standard and cross-platform OpenGL interface. In addition, this design constructed 3D teaching environment based on completing WebGL virtual teaching course for providing multiple 3D scenarios and interactive behaviors, and innovatively built a new 3D teaching environment system for users to rapidly create their own teaching scenarios and required interactive behaviors so as to establish direct and highly interactive teaching scenario.

Cognitive Theory of Multimedia Learning
Multimedia teaching is a teaching mode with text, audio, video and simulation method to present teaching contents. According to learner cognitive theory, multime-dia teaching has characteristics such as strong expressive force, high interactivity and shareability, and has significant support for students to absorb teaching contents. Multi-media technology and tools can concretize original abstract concept so as to reduce teaching difficulty. Cognitive theory is a learning theory studying how changes occur due to experience. It emphasizes human body's understanding of current scenario with consistent perceptual power with the learning motivation principle, makes cognition specific and concrete [12]. Due to the difference of brain nerve system structure with evolution, human beings and animals have different degrees of comprehension. Cognitive theory which is essential for the interactive effect between learners and the learning environment can directly influence the teaching effect. Factors influencing teaching effect are shown in fig. 1: In multi-media environment, students can enjoy rich information media resources and get into learning contents by direct conclusion and new forms. Specific to above two elements, multimedia technology in various forms can display knowledge context and frame clearly. Meanwhile, multimedia teaching can conduct purposeful arrangement of teaching contents with very obvious function of strengthening teaching effect.

WebGL
WebGL as a free open 3D graphics protocol allows to combine JavaScript with OpenGL ES 2.0, and adds a JavaScript binding to provide accelerated hardware 3D rendering for HTML5 Canvas so as to smfoothly display 3D scenario and model in browsers, and to create complicated navigation and data visualization. WebGL with characteristics of availability in multi-platform environment with no need to develop website specialized rendering plug-in is widely applied in 3D structured web page building. General framework of WebGL application is shown in fig. 2 During the using process, WebGL can link with other 3D context webpage contents for base layer rendering call through GLSL ES. As a part of HTML5 standard, each browser is implementing and supporting WebGL so that WebGL is becoming an ideal tool of developing dynamic 3D webpage. By applying WebGL technology, people can directly process graphics contents in B/S mode in the network end, and perfectly solve the previous Web interactive 3D problem.

Virtual teaching course design based on WebGL
Framework design. Virtual teaching course based on WebGL applies B/S framework for design containing two parts: browser with WebGL analytical ability and Web server. Browser client end software further generates the client end of virtual teaching course including UI interface module and Ajax framework. Web server is constituted by model layer, presentation layer and control layer. The framework design is as follows: model layer design requires to create two XML files, Shape.xml and material.xml. Shape. Xml is for creating the basic shape of object; material. Xml is for storing texture data and surface color. The material.xml contains illumination, text, visual effect and animation XML file. XML analysis. In framework design procedure, data structure of the whole scene object is obtained by the integration of model layer, illumination and control layer. So data structure of the whole scene can be obtained by analyzing site.xml file.
Rendering processing. WebGL can support Open GL. So WebGL rendering processing can be conducted by referring to Open GL rendering process. The schematic diagram of pipeline is shown in fig.3. In WebGL, a canvas member is added into HTML 5 for 3D graphic rendering. OpenGL graphic can be flexibly used according to the context for scene rendering.
Interactive processing. To achieve the interaction with users, it is possible to implant DOM Events in WEB page during virtual teaching course. DOM Events can be implemented by registering event sound monitor for interactive processing of mouse, keyboard and user's operation events.

Virtual "Mould Design" teaching course development
Based on completing theoretical construction, this paper conducted R&D of virtual teaching course based on WebGL from two aspects, overall framework design and 3D teaching environment building.
Overall framework design. Overall implementation flow of virtual teaching course based on WebGL is shown in figure 4.

Cavity model
Model data  Virtual teaching course contains text, form, graphic, audio, animation and rich multi-media resources. Text information can be used in Word for direct input or can be obtained through scanning. The inserted text information can be realized in hypertext form; most tables are in scanning form to avoid editing errors; graphic editing is also in scanning way. Or map-making software automatic generation can be used for high-precision requirement. Audio is mainly background music.
Animation generation is the key of virtual teaching course research and development, as well as the difficulty of mould design teaching. Generally, standard framework is used in moulds for production use with small appearance difference and different interior structure. The difficulty of mould design learning is the movement mode of each component. 3DS MAX is common animation production software which can vividly display the object appearance and texture with good overall effect and wide application in mould design. But previous mould animation designed by 3DS MAX had problems of compact structure, low recognition, and serious interference of eyesight. This paper used the improved 3DS MAX for mould animation generation, i.e. independent generation of each component. Based on this, conducted dynamic assembly and generated EXE file after rendering for demonstration. The interface of virtual "Mould Design" teaching course based on WebGL is shown in figure 5-7:  3D teaching environment building based on WebGL. Virtual teaching course based on WebGL is suitable for 3D teaching environment. But current 3D teaching environment with high professional requirements can complete model design after long-time construction period. In practical application, there exists model distortion problem which makes user experience in low level for a long time. So this paper conducted 3D teaching environment building to solve the problems of complicated construction and inflexible application of current 3D teaching environment. 3D teaching environment built by this paper firstly displays scene set and object set. Then user selects and sets the position. Next, object graphics and scene graphics can be displayed together through rendering and graphics integration. In this 3D teaching environment, users can choose scene and object properties for setting, or edit files necessarily, modify environment parameters as required, and also modify object interaction properties so that objects in the scene have rich properties of moving, being clicked and opened. After modification, users can save the operation and send the file to client end for demonstration. Flow of 3D teaching environment generation based on WebGL is shown in fig.8.
It can be known from fig.8 that users after logging in the system can see a lot of pre-set 3D scenes and objects. Next, they can adjust the position of scenes and objects according to their demands. Users can keep changing the properties of objects in the scene after setting 3D scenes and objects, and can further make interactive design of objects. After clicking the object to be designed, users can choose interaction content and form in the pop-up window. After designing, the system will record the user's design data, and save the scene information, objective information and interaction information together in this file. 3D teaching environment designed by this paper with low user requirement and fast design speed has great significance for improving user design efficiency and reducing user's cost of creating 3D scenes. Specific to the function modules, 3D teaching environment designed by this paper contains following modules, see fig.9. Display module is used for displaying 3D scenes set and 3D object set; position setting module is for receiving the position setting, object selection and other information of the 3D scene to generate 3D teaching environment file; property setting module is responsible for modifying relevant information of 3D teaching environment file; interaction setting module is for receiving user's 3D object selection information and interaction setting information; executable file generation module is for generating 3D teaching environment executable file. Users can complete 3D scene and interactive behavior demonstration by using the 3D teaching system designed by this paper. Scene graph of 3D teaching environment generation based on WebGL is shown in figure 10.

4.2
Teaching effect 60 students in two class grade 2016 of module design and manufacturing major of a university were selected as the research object of this paper, 30 students in each class including 45 boys and 15 girls. Two classes were respectively used as experiment group and control group to participate in the experiment. Students in experiment group studied with the support of virtual "Mould Design" teaching course based on WebGL, and carried out teaching and training in 3D teaching environment. Teachers and students cooperated to complete the setting of 3D teaching environment. Previous multimedia teaching system was used in control group for assisted instruction.
After the class period, final examination and questionnaire survey were used for teaching effect assessment. The ratio of theory and practice in the final examination was 50%, with Excellent (>90), good (80-90), fair (60-79) and poor (<60) for segmentation. The questionnaire survey mainly emphasized students' evaluation of teaching environment ad was conducted once after the class hour at site. The recovery rate was 100%. Table 1 shows the statistics of students' final examination scores.
It can be seen from table 1 that in experiment group 27 students obtained Excellent, 23 students obtained Good, with Excellent-Good ratio of up to 83.3%, obviously higher than the ratio in control group. The number of student obtaining Poor in experiment was 0, obviously different with control group. On a whole, students in experiment group performed better than control group, which indicated good practical effect of virtual "Mould Design" teaching course based on WebGL Table 2 shows students' evaluation of teaching environment from the questionnaire survey.
It can be seen from table 2 that students in experiment group had obviously higher evaluation of teaching environment than control group. Virtual "Mould Design" teaching course based on WebGL played a more important role in stimulating learning interest, strengthening operational ability, increasing class activity and deepening practice participation. As a whole, mould design major teaching efficiency was higher in 3D teaching environment. Students obviously strengthened learning activity in highly interactive teaching scene. Self-built 3D teaching scene was more consistent with the teaching practice. Internet education requires to improve trainees' real immersive feeling and their real experience. Constructing virtual teaching environment can improve trainees' real experience and their learning activity. With the maturity of 3D display technology, establishing 3D teaching environment with 3D display technology further improved the real sense of teaching environment. Regarding teaching effect, virtual teaching course based on WebGL can obviously improve students' academic scores. Meanwhile, students are more satisfied with the teaching environment of this virtual teaching course. Analyzing the reasons, firstly, using this virtual teaching course can help students to clarify their personal study plan. The topic and knowledge key points of process mould design course can be vividly and truly presented in virtue of virtual technology so as to impress students profoundly and strengthen their learning effect. Secondly, the virtual teaching course can stimulate students' thirst for knowledge. This teaching course massively applied virtual technology for supporting multimedia teaching including audio, image, animation, audio and video products to stimulate students' visual and hearing sense comprehensively. This avoided the singleness of traditional teaching mode. The novelty and diversity of different hi-tech teaching modes stimulated students' interest and sense of participation. Teachers could also instruct discipline frontier development trend related to classroom contents, scientific historiette including interesting science stories by using network information to mobilize students' classroom activity. More importantly, this virtual teaching course based on WebGL in this design achieved graphic rendering through uniform, standard and cross-platform OpenGL interface, and 3D teaching environment built by this paper could help teachers and students to rapidly create their own teaching scenes and desired interactive behaviors so as to establish vivid and highly interactive scenes. In this case, it could further strengthen students' profound love and enthusiasm for mould design major.