Design of Virtual Experiment Teaching of Inorganic Chemistry in Colleges and Universities Based on Unity3D

—Focusing on the high-cost issues and many risk and uncontrollable factors in chemical experiment teaching in modern colleges and universities, a virtual reality inorganic chemistry (IC) simulation experiment strategy based on Unity3D technology is studied. Starting from the needs of IC experiment teaching, a collision detection algorithm (CDA) between the experimental environment and the virtual scene with Unity3D as the main technical framework is designed. The results show that the collision detection (CD) time of the CDA designed in the research is 99ms, the detection average value is 95.29%, and the accuracy variance is 0.021. The above values are better than the same type of algorithm. This shows that the CD accuracy and efficiency are higher, and the performance is stronger. In addition, the virtual chemistry experiment designed in the research can significantly improve the students’ using attitude from the three main aspects of perceived ease of use (PEU), immersion and interactivity, and then enhance the students’ learning effect. Therefore, the method of virtual experiment teaching of IC in colleges and universities based on Unity3D is effective and provides a new idea for modern teaching reform.


INTRODUCTION
With the growth of contemporary computer technology, virtual reality (VR), a simulation technology based on computer technology, has gradually developed and matured.Driven by external experiential equipment and internal diverse functions, VR has gradually become a limited second reality environment.In this simulated environment realized with the external environment and equipment, users can get more intuitive experience and feedback than traditional computers.Therefore, VR technology is often used in interactive simulations such as online stores.Teaching experiment simulation is the main application direction [1][2][3].It is very important to model the physical elements in the simulation environment.This is because the physical elements often need to interact with each other according to the operation of the experimenter during the experiment to completely restore the experimental process.Once there is a problem with the physical modeling, the experimental simulation will be unreal, and the feedback given to the operator will not be intuitive [4][5][6].As the recently emerging 3D game production engine, Unity3D has its own particle system, physics engine, sky box and other engine elements that focus on interactivity.It includes functions such as scene view, game view, layer panel, engineering panel and monitoring panel, etc. which can directly edit 3D virtual objects and mobilize 3D resources.Through these functions, it is easy to realize such functions as architectural visualization, 3D animation, 3D interactive environment editing, etc [7][8][9].In teaching virtual experiment design, the application of Unity3D can not only give students a better virtual experiment experience, but also help schools save resources, realize self-development, and have stronger realizability.
Therefore, the research relies on Unity3D and other tools to use the interactive development environment to apply virtual reality technology to design the virtual experiment teaching of IC in colleges and universities.From the theoretical perspective of embodied cognition, the research integrates with virtual simulation technology, mobilizes learners' body movements and sensory perception systems in a highly realistic virtual learning environment, and helps learners to construct an instruction system.It not only enriches the practical research of embodied cognition in teaching applications in China, but also provides new ideas for the design of virtual simulation experiments.The virtual experiment teaching of IC in colleges and universities based on Unity3D has provided valuable theoretical and practical basis for the application of 3D technology in experimental teaching, and has played a certain role in promoting modern teaching reform.

II. RELATED WORK
The range of applications for Unity3D has grown significantly over the past few years, and the related research has also been increasing.Szlęg's team custom-developed a software that could simulate the operating environment of underwater autonomous robots using Unity3D.The software solved expensive hardware and high damage rate during the testing of underwater autonomous robots.Through this software, factors such as caustics and buoyancy of the underwater environment could be simulated to realize virtualized operation tests.The research results show that the software is robust in practical applications [10].Zhu combined Unity3D with AI algorithms and applied them to game research and development.The researchers combined the behavior tree algorithm with the learning algorithm to establish a game NPC intelligent action model.By applying Unity3D technology to games, an intelligent game model was formed.The research results showed that the model could efficiently implement the intelligent behavior of NPC, and the system run more efficiently [11].The Artal-Villa team applied Unity3D technology to traffic simulation, and proposed a framework www.ijacsa.thesai.org that could simulate the needs of pedestrians in traffic and restore the interactive relationship between vehicles and pedestrians.The research combined Unity3D with urban simulation open-source traffic simulator through transmission control protocol, and performed 3D simulation according to 2D scene.The findings showed that the traffic visualization ability of the system was strong [12].Toriz applied Unity3D technology to the teaching system of the flipped classroom, and designed a laboratory classroom for landscape learning.The study analyzed the academic performance of the student group applying Unity3D technology through quantitative and qualitative dual analysis methods.The findings displayed that the average grades of these students significantly improved [13].Wang's team used Unity3D technology to realize the research and development of the autonomous driving simulation system of unmanned ships, and designed the autonomous control simulation frameworks in the ocean and river driving scenarios in the system.Research used machine learning algorithms to enhance adaptive capabilities for autonomous navigation and control of unmanned ships.The research results showed that after algorithm optimization, the unmanned ship could successfully avoid obstacles in the simulation [14].
The research on virtual simulation experiments is also gradually enriched under the environment of rapid development of technologies such as Unity3D.For example, the Bogusevschi team used 3D virtual technology to realize the simulation of campus experiments, thereby solving the problem that campus experiments were difficult to carry out under the condition of limited budget available on campus.The results showed that the study had a strong practicality [15].Makransky et al. applied VR technology to the design of immersive simulation laboratory.The research used a pre-and post-test method to analyze whether the VR laboratory simulation program could improve students' self-learning effectiveness and scientific career vision.The results showed that students who used VR laboratory simulation programs had higher self-learning efficacy and scientific career vision [16].Zhang combined VR technology with relay vibration protection algorithms, established a current protection simulation model in a VR simulation environment, and studied the protection scheme under fault conditions.The results showed that the simulation scheme designed in the research could effectively simulate and demonstrate the micro electric protection model and current protection scheme [17].The Schnack team applied VR technology to a simulation of a virtual store and compared it to a traditional computer desktop store.The research used hardware devices such as head-mounted displays, hand-held and body-sensing tracking devices to realize immersive store shopping simulations.The participants could interact on-site by moving their bodies.The research results showed that virtual store simulation technology was beneficial to promote customers' desire to buy [18].O'Connor M's team proposed a simulation teaching strategy that combined 3D simulation technology and clinical radiology teaching experiments.The study used headsets and hand controllers in a VR kit to provide students with real-time experimental feedback, and simulated anatomy and radiology experiments through virtual ray simulation technology.The results showed that the teaching strategy of the research design gave students constructive feedback while reducing the risk of the experiment [19].From the research related to Unity3D and virtual experimental teaching, the application area of VR and Unity3D in teaching experiments has greatly improved the teaching effect.However, most of the relevant researches are concentrated in the teaching subjects such as physics and medicine, which emphasize experimental operation.Therefore, the study applies Unity3D technology to chemistry teaching to establish a theoretical foundation for incorporating new technology into the teaching of chemistry experiments.

III. IC VIRTUAL EXPERIMENT TEACHING DESIGN BASED ON UNITY3D
A.

Application Analysis of Virtual Experiment Teaching and Construction of Virtual Environment
When designing the virtual experiment teaching of IC, the research starts with students' interactive learning perception and experience cognitive habits in the VR learning environment.The learning of students is divided into three stages: VR, perceptual interaction and embodied cognition stage.The whole process is shown in Fig. 1 The Unity3D platform is mainly used as the main technical carrier in the teaching design of IC virtual experiments.Unity3D is a game engine that includes functions such as virtual scenes, virtual 3D objects and physical calculations.This technology can realize the development of highly interactive applications such as architectural visualization, 3D games and animations, and support publishing on mobile platforms.This research focuses on using the physics engine to simulate Newtonian mechanics, and realizes the control, movement, and change of virtual objects in the virtual scene through scripts.This function can provide students with more intuitive and real experimental feedback.To realize the functional effect of the virtual experiment of IC, the study makes full use of VR technology to help students experience and establishes a computer simulation operating system in the virtual world.Through this system, the simulated natural environment required by users is constructed, so that students can feel the visual, auditory and tactile senses in the real scene in the virtual experiment.The research and design system is divided into 3D interactive characteristics, which are conception, immersion and interactivity.They are shown in Fig. 2. VR is widely employed in education, mainly including virtual laboratory, teaching, and skill training.The application of VR technology in these aspects can improve teaching quality, students' learning efficiency, expand students' thinking, and enhance students' practical ability.According to the different needs of users for the VR environment and the different implementation methods, there are four subsets of the VR system: immersive, augmented, distributed and desktop VR systems.The specific composition is displayed in Fig. 3.

Virtual reality system
Virtual reality system Augmented virtual reality system Distributed virtual reality system Desktop virtual reality system Fig. 3. Types of virtual reality systems.
The immersive VR system isolates the user's senses from the real world through devices like data gloves and helmets, and makes them fully immersed in the virtual environment.This type of system has a significant sense of immersion, but due to its high requirements for equipment and large investment, its development is also subject to certain restrictions.The augmented VR system refers to calculating the virtual information stored in the computer through the penetrating head-mounted display while the user observes the real environment.The virtual image obtained from the virtual information is superimposed on the real object to deepen the user's feeling of the real object.The distributed VR system relies on the immersive VR system, and enables people in different physical locations to share resources on the basis of the network to achieve a high collaborative work.Desktop VR systems use the computer screen as a channel for VR and user interaction.Users observe the VR environment through the screen, and interact with objects in the VR through simple devices.Through the device, the user can perform operations such as rotation and scaling on the controlled virtual object.Based on the cost of campus application, as well as the convenience of teaching when using the system for students, the research mainly uses desktop VR for virtual experiment design.
Virtual experiment is a VR learning resource that uses virtual equipment to conduct experimental exploration in a virtual environment constructed by a computer.The experimental environment of the virtual test is not limited by the site, which reduces the possible hazards in the real test and saves manpower and capital costs.The simulation experiment designed in the study is shown in Fig. 4.

B. Virtual Anti-Collision Strategy Design
Aiming at the virtual experiment teaching of IC in colleges and universities, the research begins with the geometric modeling of chemical experiment instruments in VR.The objects in the virtual experiment are basically composed of geometric objects.Geometric modeling needs to process the topological and geometric information.Topological information is the relationship between each component that constitutes a geometric object.Geometry-related information is the position and size of objects in geometric space.The 3D graphics generate new graphics after operations such as position movement and size adjustment.Such geometric transformation of 3D graphics is based on the coordinate origin and axes, and is realized through homogeneous coordinate transformation.When the 3D graphics are transformed, the point ( ) in the geometric space.The coordinate transformation method is shown in formula (1).The matrix of translation of p is shown in formula (2).
According to formula (2), the translation coordinate of p When performing scale transformation on 3D graphics, if the center of the object is ( )

, , p x y z
, then the point is transformed based on the coordinate axis.The scales of the transformation in the three mutually perpendicular directions of the coordinate system are u , v , and w .When the three transformation ratios are equal, the 3D graphics are transformed in equal proportions.When the ( ) The scale transformation coordinate formula of the point p is as formula (5).
When a 3D object is rotated in the geometric space, the matrix of the point ' p is different for coordinate axes.When the point p rotates around the X axis, the transformation of its coordinates on the X axis is shown in formula (6).
The coordinate transformation of p on the Y axis is shown in formula (7).
' cos sin y y z The coordinate change of p on the Z axis is shown in formula (8).
' sin cos z y z In formula (7) and formula (8), α is rotation angle of p around the X axis.The transformation matrix can be obtained as formula (9).
Then the coordinate transformation formula of p around the X axis is shown in formula (10).
The transformation matrix of p rotating around the Y axis is as formula (11).
In formula (11), β is rotation angle of p around the Y axis.Then the coordinate transformation formula of p rotating around the Y axis is shown in formula (12).
The transformation matrix of p rotating around the Z axis is as formula (13).
5 cos sin 0 0 sin cos 0 0 In formula (13), γ is rotation angle of p around the Z axis.Then the coordinate transformation formula of the p point rotating around the Z axis is shown in formula (14).
Based on the basic transformation principle of 3D graphics in geometric space, the experimental scene of chemical experiments, the required equipment and their transformed positions in the geometric space of virtual experiments are geometrically modeled on Unity3D platform.After the geometric modeling of the experimental scene and objects is completed, CD technology is used to detect and process whether objects in the scene collide or not.The movement of objects in a virtual scene must also obey the objective law of the movement in reality, that is, two objects cannot occupy the same physical space.The CD technology will detect and obtain the information of the objects contact and cross-section.According to different virtual scenes, CDA are mainly divided into time-based and space-based.According to the different requirements of time changes, there are three types of time-based CDA, as shown in Fig. 5.
The static collision algorithm is suitable for use when objects in the virtual scene are stationary and do not collide.The discrete CDA detects whether objects in the virtual scene collide at different discrete moments 0 1 , , , n t t t  .The continuous CDA is to continuously detect whether there is a collision between objects in the virtual scene within a time interval [ ] 0 1 , t t . CDA based on space is broken up into two types according to image and object space.The algorithm solves the problem according to the 2D projection image information of the 3D object in the scene and the depth information of the image.The algorithm based on the object space solves the problem interactively according to the intersection of the 3D object with other 3D objects in the virtual space.The hierarchical bounding box algorithm (HBBA) is the most commonly used.It is suitable for object CD in more complex virtual 3D scenes.HBBA uses a bounding box slightly larger and simpler in shape than the object to wrap it around, making it a substitute for the geometric characteristics of the object.Common bounding boxes are spherical, AABB and OBB bounding boxes, as shown in Fig. 6.
In the virtual scene interaction, to enhance the speed of CD, the research proposes an improved CDA based on quantum technology ant colony (AC).The algorithm combines the AC algorithm with quantum computing technology, and improves the convergence speed of the AC algorithm through quantum computing technology.The representation of quantum AC algorithm is displayed in formula (15).

Static collision detection algorithm
range is a random value in [0,1].m indicates the population size of the AC algorithm.In the AC algorithm, the ants calculate the path transition probability through the information appeal and heuristic information on the moving path, and then use the moving probability to calculate the movement of the ant to the next position.The path transition probability is shown in formula (16).
In formula ( 16 In formula (17), i is the serial number representing the probability amplitude of the qubit.i θ represents the rotation angle of the probability amplitude.The study introduces mutation operators to enhance the diversity of races.The mutation operations are mainly realized by quantum NOT gates, as shown in formula (18).
In formula (18), ϕ represents the state.The next position of the ant in the algorithm is determined by the strength and heuristic of the pheromone.The update rule of pheromone is shown in formula (19).
In formula ( 19), r x represents the position that the ant is right now.s x represents the new position formed after the ant changes its position.Once all the ants have completed the position update, the pheromone intensity can be updated according to the formula (20).
The algorithm outputs the best individual with the collision threshold of the group by continuously updating until it reaches the iteration termination condition.When objects interact in a Unity3D scene, the situation is more complicated.For complex scenes, a simple CDA may result in penetrating objects or CD errors.If a grid collider is used, the computation of detection will be increased.Therefore, the improvement idea of the research is to combine the two algorithms.First, a spherical bounding box is established around the object to exclude objects that cannot be interacted with in the scene for a short time.Then a mesh collider is established for the object, so that the two CD calculations are performed on objects whose bounding boxes of two spheres have overlapped.The specific algorithm steps are as follows: establish a spherical bounding box for each object in the scene, and calculate the spherical bounding box according to the triangle information in the model.According to the i triangle the vertex vector of a , b , c and the patches n in a triangle, the calculation method of sphere enter o as shown in formula ( 21).
( ) The maximum distance d from the sphere center to all vertices is used as the radius of the spherical bounding box.Then a mesh collider is built for the 3D objects in the virtual scene, and the intersection calculation is performed for the spherical bounding box.If the intersection occurs, the next step of monitoring is not required.Finally, the object intersected by the spherical bounding box is monitored and calculated by the mesh collider.In interaction, the improved CDA is used to add colliders to the relevant instruments in the chemical experiment, and label the objects in the script to distinguish different objects.

A. Performance Analysis of Collision Algorithm
When analyzing the teaching effects of IC virtual experiments, the research first analyzes the collision algorithm designed for the research, and selects the SOLID CDA and the RAPID CDA as a comparative analysis.First, in the case of model collision and intersection, the detection intersection numbers of different algorithms are compared.Table I depicts the outcomes.
From Table I, the algorithm designed in the study always maintains the state with the largest number of detections in the range from 100 to 1000 intersecting facets.The detection ability of the algorithm designed in the research can be improved when detecting the number of intersecting triangles faces in the model.The algorithm designed in the study has the strongest detection capabilities.The model performance comparison is shown in Fig. 7. From Fig. 7, in CD time, the algorithm designed by the research only takes 99ms to complete the CD.The SOLID algorithm takes 105ms.The RAPID algorithm takes 132ms.The algorithm designed by the research has a significant advantage in CD efficiency.At the same time, the comparison of detection accuracy that the accuracy fold line of the algorithm designed in the study is at the highest position, in the range of 90% to 100%.The detection average is 95.29%, which is higher than the 84.67% of the SOLID algorithm and the 87.91% of the RAPID algorithm.The accuracy variance is 0.020, which is better than 0.058 of the SOLID and 0.061 of the RAPID.In the random collision performance test, the model designed by the research has advantages in both detection efficiency and accuracy.
From Fig. 8, as the sampling features increases, the detection time also increases under the premise of achieving the same detection rate.Therefore, the feature samples should be adjusted in practical applications according to the requirements, and then simultaneously satisfy the effect of detection real-time and accuracy.

B. Analysis of Teaching Effect
In the effect analysis, the study adopts the method of teaching class experiment, and the experiment is conducted by grouping students.Questionnaires are distributed to investigate the teaching effect.

Number of people in each group
In learning motivation, the PEU and immersion of virtual experiments have the most significant impact on learning motivation, and the significance coefficients of the two variables are both 0.000.Followed by PEU, the significance coefficient is 0.001.The last is interaction, and the significance coefficient is 0.003.In use attitude, the PEU, immersion and interactivity of the virtual experiment have the most significant impact on it, and the significance coefficients of the three variables are all 0.000.Followed by PU, the significance coefficient is 0.002.Therefore, the Unity3D-based IC virtual experiment strategy in colleges and universities can significantly improve students' attitudes and use attitudes in chemical experiment teaching from the three main aspects of PEU, immersion and interactivity, thereby improving students' learning effects.

V. CONCLUSION
To solve the practical problems such as high consumption cost and many risk factors in chemical experiments in colleges and universities, starting with the characteristics of IC experiment teaching, a collision detection algorithm between virtual experiment environment and virtual scene based on Unity3D technology was designed.When designing the virtual experiment teaching of IC, it start with the students' interactive learning perception and experience cognition habits under the virtual reality learning environment, and divide the students' learning into three main levels: virtual reality, perception interaction and embodied cognition.At the same time, research was conducted on geometric modeling of chemical experimental instruments in virtual reality, and a virtual anti-collision strategy was designed, ultimately forming a virtual experimental teaching mode.The study analyzed experimental teaching through multiple regression analysis.The results show that in collision detection model performance, the algorithm designed in the study completed collision detection in just 99 ms, with the accuracy line at the highest position, within the range of 90% to 100%, with an average detection value of 95.29%;The accuracy variance is 0.020, and the numerical values are better than algorithms of the same type; And as the number of sampled features increases, the detection time of the algorithm increases while achieving the same detection rate.The collision detection algorithm designed in the research has superior performance.In teaching effectiveness, the survey data of the study has a Clonbach Alpha coefficient of 0.782, greater than 0.75, indicating good reliability.At the same time, the KMO sampling suitability scale is 0.652, greater than 0.6, with a significance of 0.000, indicating good reliability.The virtual experimental teaching designed for research can have a significant impact on learning motivation from PEU and immersion, with a significance coefficient of 0.000 for both variables.At the same time, it can have a significant impact on usage attitude from PEU, immersion, and interactivity, with a significance coefficient of 0.000 for all three variables.From this, the research designed model can effectively improve students' learning effectiveness in chemical experimental teaching.However, in practical applications, the number of feature samples should be adjusted in real-time according to the needs to simultaneously meet the real-time and accurate detection requirements.At present, 3D display mainly relies on the development of stereoscopic display and sensing technology.The current system's three-dimensional sense cannot meet the needs of the system, and further research is needed in 3D display.

VI. DISCUSSION
The collision detection model designed in the study only completed collision detection in 99ms, with an average detection rate of 95.29%.Compared with previous studies, it significantly improved the collision detection speed and average detection rate in 3D displays.The study used regression analysis to analyze the impact of virtual chemistry experimental teaching on students' learning motivation and usage attitude.In learning motivation, the PEU and immersion of virtual experiments have the most significant impact on learning motivation, with significance coefficients of 0.000.In terms of usage attitude, the PEU, immersion, and interactivity of virtual experiments have the most significant impact on usage attitude, with significance coefficients of 0.000.From this, in virtual chemistry experimental teaching, the three aspects of PEU, immersion, and interactivity can significantly improve students' attitudes towards use, thereby enhancing their learning outcomes.From the theoretical perspective of embodied cognition, the research integrates with virtual simulation technology, mobilizes learners' body movements and sensory perception systems in a highly realistic virtual learning environment, and helps learners to construct an instruction system.It not only enriches the practical research of embodied cognition in teaching applications in China, but also provides new ideas for the design of virtual simulation experiments.
formula (1), x C is translation amount of p on the X axis.y C indicates the translation amount of p on the Y axis.z C is translation amount of p on the Z axis.
), x represents the position set of feature points of the ant colony in the search space.s x represents the target position formed by the ant under the dual guidance of pheromone intensity and visibility.intensity of the target position of the ant.( ) s x η represents intensity of information generated by heuristics at the target location.α represents the weight of the information strength.β represents the weight of the heuristic information strength.The research mainly uses the quantum revolving door to update the position of the ants.The formula (17) demonstrates how the quantum revolving door works.

TABLE I .
COMPARISON OF MODEL INTERSECTION DETECTION Table II depicts the experimental settings.