A virtual experiment platform and method for simulating interaction of polarized light and vortex light interference

CN122888871APending Publication Date: 2026-10-09NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610922181.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-25
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0003]对于现有的光学虚拟仿真实验平台,内容较为丰富,但同时也存在一些不足,比如:(1)缺乏关于研究涡旋光、量子纠缠等前沿的现代光学实验内容;(2)在虚拟仿真实验平台中很少展现连续性的光学物理现象的变化;(3)光学实验一般会涉及到较多的仪器调节等操作,现有的虚拟实验平台削弱了实验操作性,与实验平台的可交互性不足

Benefits of technology

[0029](1)高自由度与模块化:本发明基于Blender建模实验环境与实验器材,并基于Unity3D平台,使用C#语言脚本编写,使得实验器材可实现其自身的对应功能,如可出射具有相应物理效果的激光器、具有对应材质和反射率、透射率的棱镜,并且可以自由拖拽与旋转,实现光路的搭建和相应的功能,改进了现有的虚拟实验平台的低兼容性的问题,可以通过模型的导入和脚本控制实现多个实验平台和软件之间的迁移。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888871A_ABST
    Figure CN122888871A_ABST
Patent Text Reader

Abstract

The application discloses a virtual experiment platform and method capable of simulating interaction of polarized light and vortex light interference, belongs to the technical field of virtual simulation experiments, and applies Blender software to model object environments such as laboratory backgrounds and experimental apparatuses, applies a C# programming language to write logic scripts for controlling experimental apparatus models to realize a drag rotation function and simulating basic physical phenomena such as laser reflection and transmission, uses an optical simulation calculation engine to simulate complex vortex optical interference patterns, realizes real-time exchange of parameter data through communication connection between software platforms, and realizes real-time interaction function when instrument model parameters are changed in the experiment platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of virtual simulation experiment technology, specifically relating to a virtual experimental platform and method for interactively simulating the interference of polarized light and vortex light. Background Technology

[0002] In today's era of emerging technologies such as computer science, the development and design of virtual simulation experimental platforms have numerous significances and functions. Virtual experimental systems overcome the limitations of real-world conditions, simulating extreme conditions and allowing students to intuitively observe physical phenomena that are difficult to achieve in traditional experiments. They provide a safe way to explore dangerous experiments such as nuclear reactions and high-voltage electricity experiments. Furthermore, they can promote educational equity, helping resource-constrained schools overcome the shortcomings of insufficient experimental equipment and breaking down time and space limitations. In particular, for complex, abstract optical experiments that are difficult to operate and observe in reality, dynamic simulation, 3D modeling, and real-time data visualization can concretize abstract concepts such as electromagnetic fields, quantum mechanics, and interference diffraction, thereby stimulating students' interest in physics.

[0003] The existing optical virtual simulation experimental platforms are rich in content, but they also have some shortcomings, such as: (1) lack of cutting-edge modern optical experimental content on vortex light, quantum entanglement, etc.; (2) rarely show the changes of continuous optical physical phenomena in the virtual simulation experimental platform; (3) optical experiments generally involve a lot of instrument adjustment and other operations, and the existing virtual experimental platforms weaken the operability of the experiments and lack interactivity with the experimental platform. Summary of the Invention

[0004] This invention provides an interactive virtual experimental platform and method for simulating the interference of polarized light and vortex light. It can solve the operational difficulties of acquiring and adjusting vortex light in offline experiments, supplement the physical virtual simulation experiments related to vortex light, increase students' understanding of vortex light, and improve the interactivity of the experimental platform.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] An interactive virtual experimental platform for simulating the interference of polarized light and vortex light includes:

[0007] First, the hardware is an interactive embedded gesture recognition system (gesture recognition hardware module), which is responsible for collecting gesture signals and sending the signals to the terminal serial port through the embedded software program. The hardware is connected to the rendering engine of the main controller through the serial port, and the engine can get the corresponding response through the input of gesture signals.

[0008] Second, a software script (optical simulation calculation module) based on a high-fidelity complex optical computing engine is used to perform image simulations of complex optical phenomena. Based on the received optical parameters, the software script performs simulation calculations of the interference between vortex light and polarized light, generates corresponding interference pattern data, and imports it into the interactive engine in real time via an API (Application Programming Interface), enabling real-time changes in experimental phenomena caused by user interaction with the engine.

[0009] Third, the interactive rendering engine Unity3D is the user-interactive interface of the experimental platform. It is used to complete tasks such as building experimental scenarios, hardware communication and interaction, and API connection of the simulation computing engine. It is equivalent to a logic control center. Users can perform interactive actions such as clicking, dragging, or using gestures to complete the virtual experiment process on this platform.

[0010] Furthermore, the gesture recognition hardware module includes an STM32 microcontroller and a PAJ7620U2 gesture recognition sensor connected to it; the STM32 microcontroller has an embedded program programmed on it, which is configured to: initialize the gesture recognition sensor and match the continuously read gesture sensor data with the pre-stored gesture templates; once a predefined clockwise or counterclockwise gesture template is matched, the corresponding text control command is sent to the serial port.

[0011] Furthermore, the movement of the instrument model is the rotation of the polarizer model, the rotation angle of which is associated with the gesture signal, and the rotation drives the polarization angle parameter in the optical simulation calculation module to change.

[0012] Furthermore, the Unity3D rendering engine module includes ray tracing logic, which uses a structure to encapsulate and manage the parameters of a single ray segment, including the starting point, direction, remaining propagation length, and reflection / transmission state. This logic is configured to: when a simulated ray collides with a beam splitter, based on the physical properties of the beam splitter, synchronously generate new ray segments representing transmitted and reflected rays, and add them to the calculation queue for subsequent tracing and rendering.

[0013] Furthermore, the Unity3D rendering engine module also includes a circular slider interaction component. This component is obtained from the bar slider control in the Unity engine through coordinate transformation, mapping the displacement value of the slider in the Cartesian coordinate system to the rotation angle value in the polar coordinate system. The rotation angle value of the circular slider is dynamically bound to the polarization angle parameter in the optical simulation calculation module, so that when the user drags the circular slider, its angle change can drive the optical simulation calculation module to re-execute the simulation calculation in real time through the application programming interface (API), and make the updated interference pattern appear in the user interface in real time, thereby simulating the interactive effect of rotating a physical polarizer to change the interference pattern.

[0014] Furthermore, the Unity3D rendering engine module also includes a panel switching control module, which manages multiple independent panels under a single user interface canvas, including at least a first simulation panel, a second simulation panel, and a third simulation panel corresponding to different interference types.

[0015] The panel switching control module dynamically acquires the interactive components and display components in each panel through script instructions, including input box components for parameter input, image components for displaying simulation patterns, and button components for closing the panel;

[0016] The first simulation panel has a circular slider as an interactive component, whose rotation operation is mapped to a continuous change in the polarization angle parameter; the second and third panels have input boxes as interactive components, whose input operations are mapped to changes in the topological charge parameter.

[0017] Furthermore, the implementation of the panel management module includes: using panel controls under the canvas to uniformly host various functional interfaces;

[0018] Define an image group data structure to store the simulation image and associated data stream generated by the optical simulation calculation engine in each panel; recursively traverse and obtain the sub-components in each panel through the GetComponentsInChildren command, including image components, button components and interactive input box components; by binding the input box components to the formal parameters of the optical simulation calculation module, interactive control of user input parameters to simulation pattern updates is realized.

[0019] Furthermore, the Unity3D rendering engine module also includes a main thread scheduler, which receives asynchronous serial port data signals acquired by the serial port listener and schedules the asynchronous signals to the main thread of the Unity3D rendering engine module for synchronous processing. Its working mechanism is as follows: the instruction data from the serial port is temporarily stored in an internal queue, and the queue is read and cleared in the main thread during each frame update cycle of the engine, thereby driving the corresponding virtual instrument model to generate real-time action responses.

[0020] An interactive virtual experiment method for simulating the interference of polarized light and vortex light includes the following steps:

[0021] S1: Input a clockwise or counterclockwise gesture to the gesture recognition module;

[0022] S2: The microcontroller's assembly language program controls the initialization function of the gesture recognition module, and sends the corresponding information to the host computer's serial port after receiving the gesture information;

[0023] In addition to the initialization function, a function for reading gestures and sending different information to the serial port after gesture judgment were added to the main function, so that information can be received and processed in Unity later.

[0024] S3: Obtain serial port information through a serial port listener written in Unity3D using a script;

[0025] S4: The serial port signal is loaded into the main thread processing of each frame update in Unity3D by the main thread scheduler written in script, so that the corresponding gesture triggers the polarizer model to rotate accordingly.

[0026] S5: Through the above binding and communication connection, the rotation of the polarizer model causes the polarization angle to change, thus changing the optical pattern. This achieves the simulation effect of rotating the polarizer to change the interference pattern, improving the interactivity of the virtual experiment.

[0027] Furthermore, in step S6, the numerical calculation model includes a complex amplitude distribution model for simulating the Laguerre-Gaussian beam and a mathematical model for polarization interference.

[0028] This invention provides an interactive virtual experimental platform and method for simulating the interference of polarized light and vortex light, which has the following advantages compared with the prior art:

[0029] (1) High degree of freedom and modularity: This invention is based on the Blender modeling experimental environment and experimental equipment, and is based on the Unity3D platform. It is written in C# language script, which enables the experimental equipment to realize its corresponding functions, such as lasers that can emit corresponding physical effects, prisms with corresponding materials and reflectivity and transmittance, and can be dragged and rotated freely to realize the construction of optical paths and corresponding functions. It improves the low compatibility problem of existing virtual experimental platforms. It can realize the migration between multiple experimental platforms and software through model import and script control.

[0030] (2) Integration between tool platforms: This invention uses multiple hardware and software tools as the development platform for the simulation system. The script path of the optical simulation calculation engine is packaged into the Unity3D configuration environment using script communication and software packaging. Materials and models from Blender, such as refractive index parameters, are imported into Unity3D. Finally, STM32 is connected to the virtual simulation system via serial communication, achieving integration of various platforms. The simulation system can then be driven simply by running the exported Unity3D file. Addressing the issue that existing virtual experimental platforms rarely involve cutting-edge complex vortex light experiments, this invention utilizes the powerful mathematical capabilities of the optical simulation calculation engine and the realism of the Unity3D physics engine to accurately simulate complex optical phenomena compared to actual offline experiments. This allows for flexible modification of optical parameters and simulation phenomena, facilitating user interaction and understanding of optical phenomena.

[0031] (3) New Interaction Methods: Addressing the issue of weak real-world interactivity in virtual experimental platforms, this paper adopts a novel human-computer interaction method based on gesture recognition. This expands the methods of experimental operation, making operation convenient and simple. Instruments can be switched on or off or rotated through simple gestures, creating new ideas for simulated experimental operations. In future improvements, newer gesture recognition modules or even image processing modules can be introduced to simulate complex functions such as waveplate rotation and instrument dragging in real time. With sufficient funding, this can also be expanded to include high-tech features such as VR glasses interaction and eye tracking. It can also be used to facilitate experiments for special groups of people with physical disabilities. Attached Figure Description

[0032] Figure 1 This is a flowchart of the virtual experiment method in an embodiment of the present invention;

[0033] Figure 2(a) is an overall scene diagram of the optical platform in an embodiment of the present invention; Figure 2(b) is a physical model diagram of the optical platform in an embodiment of the present invention; Figure 2(c) is a Unity editor view of the optical platform in an embodiment of the present invention;

[0034] Figure 3 This is a schematic diagram showing the completed optical path adjustment for the interference between linearly polarized light and LG light in an embodiment of the present invention;

[0035] Figure 4 This is the interference pattern when L=2 in this embodiment of the invention;

[0036] Figure 5 This is a schematic diagram showing the LG light self-interference optical path adjustment completed in an embodiment of the present invention;

[0037] Figure 6 This is the interference pattern when L=3 in this embodiment of the invention;

[0038] Figure 7 This is the interference pattern when L=4 in an embodiment of the present invention;

[0039] Figure 8 This is a schematic diagram illustrating the connection between the gesture recognition module and Unity in an embodiment of the present invention;

[0040] Figure 9 (a) is the physical object of the gesture recognition module in the embodiment of the present invention, and (b) is the serial port monitor settings interface in Unity in the embodiment of the present invention;

[0041] Figure 10 This is a schematic diagram of a serial port assistant in an embodiment of the present invention;

[0042] Figure 11 The interference pattern shown in this embodiment of the invention is an annular slider pointing to a position around 280°. Detailed Implementation

[0043] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments:

[0044] Example 1

[0045] This embodiment discloses an interactive virtual experimental platform for simulating the interference of polarized light and vortex light. For example... Figures 1 to 11 As shown, the interactive virtual experimental platform for simulating polarized light and vortex light interference consists of two parts. The software part is composed of the Unity3D engine, the packaged optical simulation calculation engine script software, and the Blender modeling software through communication connections. The hardware part, the gesture recognition module and the microcontroller system, are connected to the software system through serial communication, thereby completing the interactive physical optics virtual experimental simulation system.

[0046] 1. Hardware components

[0047] The hardware part mainly implements the communication connection between the optical simulation calculation engine and Unity3D, and the serial communication between the STM32 microcontroller system and Unity3D, so as to complete the interaction of real-time changes of optical simulation patterns triggered by gesture input.

[0048] Regarding the communication connection between the simulation engine and Unity3D, in a virtual simulation experimental system, the communication process between the image simulation and the Unity platform can be simply described as follows: changes in data parameters within the Unity engine are communicated to the simulation script, causing corresponding parameter changes in the script. This results in changes to the simulated image, which is then converted into a data stream and passed to the Unity engine via the Application Programming Interface (API) for further image rendering, thus completing the virtual simulation interaction. For example, if a polarizer model rotates in the Unity system, the polarization angle of the corresponding polarized light changes during the experiment. Through data communication, the polarization angle parameter value bound to the simulation script changes, and through the API interface, the polarized light interference pattern in the Unity system also changes accordingly. Similarly, different SPPs (Special Polarizing Particles) change the topological charge of the LG light, and the interference pattern involving the LG light changes through the same communication method.

[0049] In this process, the simulation script used is relatively small, requiring only the conversion and communication of image data streams. Therefore, the script based on the optical simulation calculation engine can be directly called from Unity using an API communication tool based on the .NET architecture, allowing for direct interaction without network communication. This method has advantages such as low latency and high efficiency in small-scale simulation tasks.

[0050] 2. Software component

[0051] In addition to the actual gesture interaction using a microcontroller, the software system, as the main part of the virtual experimental platform, also needs a large number of click, drag, and other interactive operations to simulate physical phenomena, specifically including:

[0052] (1) Basic dragging function of instruments and other objects

[0053] In virtual simulation experiments, manipulating the position of objects is one of the fundamental functions. In simulation systems, actions such as inserting and removing polarizers and spiral phase plates, as well as adjusting and calibrating optical paths, require changes in the position of the instruments.

[0054] In the simulation virtual experiment system, an optical experiment platform is modeled after the physical object, and corresponding virtual optical experiments are performed on this platform. The movement and changes in the position of objects on the experimental platform must achieve three main functions:

[0055] Ensure that the object can only move on the experimental platform;

[0056] Ensure that the object has a certain degree of adhesion to the surface of the experimental platform and will not flip over due to inertia or collision with other objects;

[0057] When an object is removed from the experimental platform, it will stop moving and remain at the nearest legal position on the platform.

[0058] (2) Clicking and rotating of some instrument objects

[0059] In virtual experimental systems, optical experiments often involve the calibration and adjustment of complex optical paths. In this process, in addition to dragging and moving the instrument to adjust its position, rotating the instrument can adjust the refraction angle of objects such as prisms and mirrors, which is also very important for the adjustment of the entire optical path.

[0060] (3) Physical simulation of laser

[0061] In the entire virtual simulation experimental system, the laser beam path is visualized, which facilitates the addition of instruments and the adjustment of the beam path. The script control of the laser beam mainly completes the simulation of the corresponding physical effects, such as specular reflection, beam splitting by a beam splitter, beam combining, etc. This process involves the iteration of multiple laser beam segments. The parameter information of individual beam segments is stored through a structure and repeatedly called in the subsequent recursive process for queue processing.

[0062] {

[0063] origin = surfacePoint,

[0064] direction = current.direction,

[0065] isTransmission = true,

[0066] bounceCount = current.bounceCount + 1,

[0067] remainingLength = transmissionBounceLength

[0068] });

[0069] Vector3 reflectDir = Vector3.Reflect(current.direction,hit.normal);

[0070] rayQueue.Enqueue(new RaySegment

[0071] {

[0072] origin = hit.point + reflectDir * surfaceOffset,

[0073] direction = reflectDir,

[0074] isTransmission = false,

[0075] bounceCount = current.bounceCount + 1,

[0076] remainingLength = reflectionBounceLength

[0077] });

[0078] The code above simulates a physical phenomenon, specifically demonstrating how light undergoes recursive calculations for reflection and transmission when it encounters a beam splitter. When a light ray collides with the beam splitter, both transmitted and reflected rays are simultaneously generated (rayQueue.Enqueue). A ray structure, RaySegment, is defined to encapsulate and manage the core properties of the ray, including its origin, direction, and remaining length in three-dimensional space. During transmission, the initial ray originates from the incident surface collision point (surfacepoint) and maintains the same direction as the incident ray. The projection check is set to true (isTransmission=true), and the reflection and projection counts are incremented by one, followed by an increase in the ray's propagation length. Conversely, in reflection, the origin of the reflected ray is set to the same incident collision point, with an additional offset of reflectDir *surfaceOffset to the reflection vector. The outgoing direction is then set to the direction of the reflection vector, thus generating two rays simultaneously.

[0079] (4) Implementation of the circular slider

[0080] In the interactive part of the optical simulation pattern, for the interaction of the interference pattern of two linearly polarized lights converged by a lens, this embodiment designs a slider shaped like a polarizer to simulate the rotation of a real polarizer. Since the slider in the Unity platform is only bar-shaped, we need to convert the values ​​corresponding to the rectangular coordinates of the bar slider into the corresponding values ​​in the polar coordinate system, and bind the angle value of the ring slider to the corresponding parameters. When the slider rotates, the corresponding parameters change. As we know from the communication connection between the optical simulation calculation engine and Unity3D mentioned earlier, the simulation pattern will change at this time, thus completing the interaction, that is, simulating the process of rotating the polarizer and changing the angle of the polarizer in the offline experiment, so as to change the interference pattern.

[0081] (5) Simulation drawing panel access and function switching

[0082] The panel switches to the main function script of the virtual experiment system. The presentation and reception of images, and the switching and application of various functions are all completed in this script. This includes the experimental explanation interface, various interference simulation image interfaces, etc., all connected by a single script.

[0083] The main function is to trigger the generation of simulation pattern interfaces of different interference types when the "Simulation Pattern" button in the start interface is clicked. In detail, it uses a single canvas UI interface to uniformly manage multiple components including slider, text, and image, and each component performs a series of functions such as interacting with the scripts of the optical simulation calculation engine and receiving simulation images.

[0084] In this process, since the optical interference simulation pattern involves three types of light interference, i.e., three panels, and each interference pattern interface contains components such as an image, a close button, and a text explanation box, it is necessary to have a unified way to change and call each component. First, a public class ImageGroup data structure is defined, which is used in each panel to store the simulation image and data stream obtained through the simulation calculation engine. In the script, the command GetComponentsInChildren<>(true) is used to retrieve the components of each panel. For example, if the value inside <> is a Button, the close button is retrieved; if it is an Image, the ImageGroup data structure component is retrieved.

[0085] For example, the following statement finds the child object "Text2" through the current object transform, attempts to obtain its Text component, and finally assigns the Text component reference to the text2 variable.

[0086] text2 = transform.Find("Text2").GetComponent <text>();

[0087] The modified statement below uses recursion to directly retrieve all child components of the object attached to the script, where (true) means that disabled or hidden components can also be found.

[0088] text2 = GetComponentInChildren <text>(true);

[0089] The final functionality is that the three interference types are triggered by clicking three buttons. The first interface is for interacting with the self-interference pattern of converging plane linearly polarized light, using the rotation of a circular slider to simulate the effect of a polarizer rotation, resulting in continuous changes in the simulated pattern. The second interface is for interacting with the interference pattern of converging plane linearly polarized light and LG light, where the topological charge l can be changed by inputting a value to alter the simulated pattern in a similar way. The third interface is for the self-interference of LG light, and the interaction method is the same as the second interface.

[0090] For the latter two interfaces, the input component TMP_InputField is obtained using the following statement, and it is bound to the formal parameters related to the simulation script. Then, the simulation image in the experimental interface is changed by communicating with Unity3D through the optical simulation calculation engine.

[0091] TMP_InputField inputField = panel.transform.Find(inputFieldName)?.GetComponent<TMP_InputField> ();

[0092] TMP_Text inputPrompt = panel.transform.Find(inputPromptName)?.GetComponent<TMP_Text> ();

[0093] The above system is used as follows:

[0094] 1. Interference between linearly polarized light and Laguerre-Gaussian beams

[0095] In the second type of interference, a convex lens is placed in the transmission light path to convert plane-polarized light into a spherical wave, which then interferes with the Laguerre-Gaussian beam. For example... Figure 3 The image shows the adjusted position of the convex lens. Simultaneously, drag the polarizer and spiral phase plate to their corresponding positions in the optical path and rotate them to the appropriate angle. For example... Figure 4 The image shows the interference pattern when the input L=2.

[0096] 2. Self-interference of vortex light

[0097] In this interference optical path, vortex beams do not require convex lenses for focusing; instead, two spiral phase plates are used to obtain two Laguerre-Gaussian beams for self-interference, such as... Figure 5 As shown, after dragging and dropping, the spiral phase plate is directly placed into the optical path, and the convex lens in the optical path is removed. Then, after clicking the "Vortex Self-Interference" button, an interactive interface pops up. The interference pattern can also be changed by inputting a value from 0 to 5 to alter the topological charge L of one of the spiral phase plates. For example... Figure 6 and 7 The figures show the interference patterns obtained after inputting L=3 and L=4, respectively.

[0098] 3. Gesture recognition interaction operation

[0099] The clockwise and counterclockwise gestures of the PAJ7620U2 gesture recognition module are used to rotate the aforementioned circular slider.

[0100] like Figure 8 This is a diagram illustrating how a microcontroller connects to Unity for operation. Figure 9 The photoelectric detection probe of the gesture recognition module performs clockwise and counterclockwise gestures. Figure 10 The serial port can receive two messages, "cw" and "ccw". These are messages sent by the microcontroller system board to the serial port when the recognition module receives the gesture information, representing clockwise and counterclockwise gestures.

[0101] exist Figure 9 (b) shows the settings interface for monitor parameters for obtaining serial port information in the Unity engine. The Rotation Angle refers to the total number of angles the circular slider in the Unity system rotates after a gesture recognition. As shown in the figure, this angle is set to 280°.

[0102] like Figure 10 As shown, the serial port receives a clockwise signal and transmits it to the Unity serial port monitor script. The circular slider automatically rotates 280°, at which point the simulation interface changes from the 0° simulation pattern shown in Figure 2(c) to... Figure 11 The pointer points to the simulated image interface corresponding to 280°, and the gesture recognition function is implemented.

[0103] The interaction flow of this experimental platform is as follows:

[0104] User gesture → Gesture recognition module captures → STM32 processes and sends signal via serial port → Unity3D serial port listener receives → Unity3D main thread scheduler processes → Drives virtual polarizer model to rotate → Polarization angle parameter changes → Parameter is passed to optical simulation engine via API → Engine recalculates and generates new interference pattern → New pattern data is sent back to Unity3D → Interface updates and displays in real time.

[0105] In this embodiment, the Unity3D virtual experiment rendering engine module is only responsible for 3D rendering, user interaction, and device driving, while the optical simulation calculation module is only responsible for performing core numerical calculations. A data channel is established between the two modules through the application programming interface (API), with parameters flowing from Unity to the calculation module, and the calculated interference pattern flowing back to Unity in real time for display. This invention combines cutting-edge vortex interferometry research with virtual simulation and introduces virtual experiment operations through hardware gesture interaction, successfully integrating multiple independent platforms such as Blender (modeling), Unity3D (rendering and interaction), optical simulation calculation engine (core calculation), and STM32 (hardware control) seamlessly into a complete system.

[0106] Example 2

[0107] This embodiment discloses an interactive virtual experiment method for simulating the interference of polarized light and vortex light, including the following steps:

[0108] S1: Input clockwise or counterclockwise gestures into the gesture recognition module.

[0109] S2: The microcontroller's assembly language program controls the initialization function of the gesture recognition module, and sends the corresponding information to the host computer's serial port after receiving the gesture information.

[0110] In addition to the initialization function, a function to read gestures and send different information to the serial port after gesture judgment are added to the main function, so that information can be received and processed in Unity later, as shown below:

[0111] status = GS_Read_nByte(PAJ_GET_INT_FLAG1,2,&data[0]);

[0112] if(!status)

[0113] {

[0114] gesture_data =(u16)data[1]<<8 | data[0];

[0115] if(gesture_data)

[0116] {

[0117] switch(gesture_data)

[0118] {

[0119] case GES_UP:

[0120] printf("Up\r\n"); break;

[0121] case GES_DOWM:

[0122] printf("Dowm\r\n"); break;

[0123] case GES_LEFT:

[0124] printf("L\r\n"); break;

[0125] case GES_RIGHT:

[0126] printf("R\r\n"); break;

[0127] case GES_FORWARD:

[0128] printf("Forward\r\n"); break;

[0129] case GES_BACKWARD:

[0130] printf("Back\r\n"); break;

[0131] case GES_CLOCKWISE:

[0132] printf("CW\r\n"); break;

[0133] case GES_COUNT_CLOCKWISE:

[0134] printf("CCW\r\n"); break;

[0135] case GES_WAVE:

[0136] printf("Wave\r\n"); break;

[0137] default: break;

[0138] }

[0139] }

[0140] The aforementioned program and gesture recognition initialization function are pre-written and pre-programmed. Their main purpose is to determine the information the microcontroller sends to the host computer via serial port after receiving gesture information, facilitating subsequent signal processing. The code transforms complex, continuous gestures into discrete, computer-recognizable commands, providing clear input signals for subsequent software processing and completing the conversion and transmission from physical gestures to digital instructions. Preset gestures include clockwise and counter-clockwise gestures, used to control the polarizer model to rotate in different directions. It continuously reads data from the gesture recognition sensor (PAJ7620U2). When a predefined specific gesture (such as clockwise GES_CLOCKWISE) is recognized, it does not perform complex calculations but instead sends a simple, predefined string instruction (such as "CW\r\n") to the host computer via serial port, completing the conversion and transmission from physical gestures to digital instructions.

[0141] S3: Obtain serial port information using a script-based serial port listener in Unity3D. The serial port listener is written in C# and utilizes Unity3D's serial port utility package to create a script file that retrieves information from the serial port.

[0142] S4: The serial port signal is loaded into the main thread processing of each frame update in Unity3D by the main thread scheduler written in script, so that the corresponding gesture triggers the polarizer model to rotate accordingly.

[0143] The main thread scheduler plays a crucial role. Since the serial port information obtained by the serial port monitor is asynchronous compared to the system's information, the main thread scheduler and C# script control can load asynchronous serial port signals into the main function and main thread for processing. This allows related interactions to occur in real time when a gesture signal is input.

[0144] The numerical calculation model includes a complex amplitude distribution model for simulating a Laguerre-Gaussian beam and a mathematical model for polarization interference.

[0145] S5: Through the above binding and communication connection, the rotation of the polarizer model causes the polarization angle to change, thus changing the optical pattern. This achieves the simulation effect of rotating the polarizer to change the interference pattern, improving the interactivity of the virtual experiment.

[0146] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.< / text> < / text>

Claims

1. A virtual experimental platform for interactively simulating the interference of polarized light and vortex light, characterized in that, include: The gesture recognition hardware module is used to collect the user's gesture signals and send the gesture signals to the host computer via a serial port; The optical simulation and calculation module has a built-in interference calculation model for vortex light and polarized light, which receives optical parameters and performs interference pattern simulation calculations. The Unity3D rendering engine module, serving as the core interaction and control hub of the experimental platform, communicates with the gesture recognition hardware module and the optical simulation calculation module, and implements the following: Construct and display a three-dimensional virtual experimental environment and instrument model; The control signals from the gesture recognition hardware module are received in real time via a serial port listener. In response to the control signal or the user's direct interactive operation within the engine, the virtual instrument model is driven to produce corresponding action changes, and the changed optical parameters are determined. The changed optical parameters are sent to the optical simulation calculation module via the API interface, and the real-time simulation pattern data returned by the module is received. The received simulation pattern data is rendered and updated in real time in the user interface, thus completing a closed-loop interaction from physical gestures to parameter changes and then to pattern updates.

2. The virtual experimental platform according to claim 1, characterized in that, The gesture recognition hardware module includes an STM32 microcontroller and a PAJ7620U2 gesture recognition sensor connected to it. The STM32 microcontroller has an embedded program programmed on it. The embedded program is configured to initialize the gesture recognition sensor and match the continuously read gesture sensor data with the pre-stored gesture templates. Once a predefined clockwise or counterclockwise gesture template is matched, the corresponding text control command is sent to the serial port.

3. The virtual experimental platform according to claim 1, characterized in that, The movement of the instrument model is the rotation of the polarizer model, and its rotation angle is associated with the gesture signal. The rotation drives the polarization angle parameter in the optical simulation calculation module to change.

4. The virtual experimental platform according to claim 1, characterized in that, The Unity3D rendering engine module includes ray tracing logic, which uses a structure to encapsulate and manage the parameters of a single ray segment. These parameters include the starting point, direction, remaining propagation length, and reflection / transmission state. This logic is configured to: when a simulated ray collides with a beam splitter, based on the physical properties of the beam splitter, synchronously generate new ray segments representing transmitted and reflected rays, and add them to the calculation queue for subsequent tracing and rendering.

5. The virtual experimental platform according to claim 1, characterized in that, The Unity3D rendering engine module also includes a circular slider interaction component. This component is obtained from the bar slider control in the Unity engine through coordinate transformation, so as to map the displacement value of the slider in the Cartesian coordinate system to the rotation angle value in the polar coordinate system. The rotation angle value of the circular slider is dynamically bound to the polarization angle parameter in the optical simulation calculation module, so that when the user drags the circular slider, its angle change can drive the optical simulation calculation module to re-execute the simulation calculation in real time through the application programming interface (API), and make the updated interference pattern appear in the user interface in real time.

6. The virtual experimental platform according to claim 1, characterized in that, The Unity3D rendering engine module also includes a panel switching control module, which manages multiple independent panels under a single user interface canvas, including at least a first simulation panel, a second simulation panel, and a third simulation panel corresponding to different interference types. The panel switching control module dynamically acquires the interactive components and display components in each panel through script instructions, including input box components for parameter input, image components for displaying simulation patterns, and button components for closing the panel; The first simulation panel has a circular slider as an interactive component, whose rotation operation is mapped to a continuous change in the polarization angle parameter; the second and third panels have input boxes as interactive components, whose input operations are mapped to changes in the topological charge parameter.

7. The virtual experimental platform according to claim 6, characterized in that, The implementation of the panel management module includes: using panel controls under the canvas to uniformly host various functional interfaces; Define an image group data structure to store the simulation image and associated data stream generated by the optical simulation calculation engine in each panel; recursively traverse and obtain the sub-components in each panel through the GetComponentsInChildren command, including image components, button components and interactive input box components; by binding the input box components to the formal parameters of the optical simulation calculation module, interactive control of user input parameters to simulation pattern updates is realized.

8. The virtual experimental platform according to claim 1, characterized in that, The Unity3D rendering engine module also includes a main thread scheduler, which receives asynchronous serial port data signals acquired by the serial port listener and schedules the asynchronous signals to the main thread of the Unity3D rendering engine module for synchronous processing. Its working mechanism is as follows: it temporarily stores instruction data from the serial port through an internal queue, and reads and clears the queue in the main thread during each frame update cycle of the engine, thereby driving the corresponding virtual instrument model to generate real-time action responses.

9. A virtual experimental method for interactively simulating the interference of polarized light and vortex light, characterized in that, Includes the following steps: S1: The user's preset gestures are collected through the gesture recognition hardware module; S2: The microcontroller's assembly language program controls the initialization function of the gesture recognition module, and sends the corresponding information to the host computer's serial port after receiving the gesture signal; S3: Obtain serial port information through the serial port listener in Unity3D; S4: The asynchronous serial port signal is loaded into the main thread for processing through the main thread scheduler in Unity3D, driving the polarizer model in the virtual experimental scene to produce the corresponding rotation action. S5: Through the binding and communication connection of S1-S4, the rotation of the polarizer model causes the polarization angle to change, thus changing the optical pattern. This achieves the simulation effect of rotating the polarizer to change the interference pattern in the virtual experiment, improving the interactivity of the virtual experiment.

10. The interactive virtual experiment method for simulating the interference of polarized light and vortex light according to claim 2, characterized in that, In step S6, the numerical calculation model includes a complex amplitude distribution model for simulating a Laguerre-Gaussian beam and a mathematical model for polarized light interference.