Virtual reality simulation method of full-space distribution photometer based on Unity
By developing a virtual reality simulation method for full-space distributed photometer on the Unity platform and using virtual reality devices to display spatial light and color information, the problem of unused virtual reality technology in the existing technology is solved, and the user's immersion and teaching effect are improved.
Patent Information
- Application Number
- CN202111486312.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-07
AI Technical Summary
The existing full-space distributed photometer simulation methods lack the application of virtual reality technology, resulting in low immersion during use.
Using the virtual reality simulation method of full-spatial distributed photometer based on the Unity platform, by installing the Unity platform and three-dimensional modeling software, connecting the virtual reality equipment, creating scenes and importing the full-spatial distributed photometer model, lamp model, holographic display model and data display Board model, compile spatial light color data tables and run scripts, generate a full-spatial distributed photometer virtual reality simulation application, and use virtual reality devices to display spatial light color information.
It improves the teaching effect of the full-spatial distributed photometer and the immersion of the user, allowing users to reflect the spatial light and color information more immersively, and improves the immersion and teaching effect of the simulation process.
Smart Images

Figure CN114155356B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of simulation technology, and in particular to a virtual reality simulation method of a full-space distribution photometer based on Unity. Background Art
[0002] In the field of lighting test equipment simulation, there is currently no applied virtual reality simulation method. Unity is a real-time 3D interactive content creation and operation platform. All creators, including game development, art, architecture, automotive design, and film and television, use Unity to turn their ideas into reality. The Unity platform provides a complete set of software solutions that can be used to create, operate, and realize any real-time interactive 2D and 3D content, supporting platforms including mobile phones, tablets, PCs, game consoles, augmented reality, and virtual reality devices. Virtual Reality System (VR) is a high-tech in the field of graphics and images that has emerged in recent years. It is also called spiritual environment technology or artificial environment. Virtual reality uses computer simulation to generate a three-dimensional virtual world, providing users with simulations of vision, hearing, touch, and other senses, allowing users to observe things in three dimensions in a timely and unrestricted manner as if they were in the scene. Based on the Unity platform, full-space distribution photometer simulation software with virtual reality functions can be developed. Summary of the invention
[0003] According to the above, the current simulation method of the full-space distribution photometer lacks a simulation method based on virtual reality technology, and is not designed in combination with virtual reality technology, resulting in a technical problem that users have a low sense of immersion during use, and a full-space distribution photometer virtual reality simulation method based on Unity is provided. The present invention mainly uses a full-space distribution photometer virtual reality simulation method based on Unity, which includes the following steps:
[0004] Step S1: The workstation is installed with Unity platform and 3D modeling software, and connected to the virtual reality device;
[0005] Step S2: creating a scene on the Unity platform;
[0006] Step S3: importing a full-space distribution photometer model, a lamp model, a holographic display model, a data display board model and a darkroom model into the scene to construct a laboratory environment;
[0007] Step S4: compile a script for importing a spatial light color data table and a script for running the full spatial distribution photometer;
[0008] Step S5: Generate a full-space distribution photometer virtual reality simulation application through the Unity platform.
[0009] Furthermore, a full spatial distribution photometer model and a laboratory environment are constructed through the Unity platform.
[0010] Furthermore, the method of importing the spatial light color data table into the scene in the form of a three-dimensional model is obtained by the following steps:
[0011] Step S41: constructing a spatial spectrum model table, including: a three-dimensional spectrum model table consisting of a horizontal axis rotation angle, a vertical axis rotation angle and a spectrum model;
[0012] The spectral data corresponding to the horizontal axis rotation angle and the vertical axis rotation angle specified in the spatial light color data table are plotted as a spectrum graph in a Cartesian coordinate system, wherein the abscissa of the spectrum graph is the visible spectrum segment and the ordinate is the relative spectral power;
[0013] Step S42: grouping the spatial light color data; dividing the spatial light color data table into a plurality of data groups according to the vertical axis rotation angle, each group of data containing the horizontal axis rotation angle and the corresponding light intensity and brightness;
[0014] Step S43: drawing a polar coordinate diagram with the data group as a unit; taking the horizontal axis rotation angle as the polar angle, taking the light intensity and brightness corresponding to the data group as the polar diameter, and drawing a light intensity polar coordinate diagram and a brightness polar coordinate diagram respectively;
[0015] Step S44: combining polar coordinate diagrams into spatial distribution; rotating each polar coordinate diagram around the vertical axis according to the corresponding vertical axis rotation angle in space to form a light intensity spatial distribution model and a brightness spatial distribution model;
[0016] Step S45: Record into the polar coordinate diagram model table: the light intensity spatial distribution model and the brightness spatial distribution model.
[0017] Furthermore, the operation process simulation flow of the full-spatial distribution photometer further includes the following steps:
[0018] Step S51: The user sets the operating parameters and initializes the parameters of each component of the goniophotometer;
[0019] Step S52: Look up the table to update the data; query the corresponding spectrum model in the spatial spectrum model table according to the horizontal axis rotation angle and the vertical axis rotation angle, and update the horizontal axis and vertical axis rotation angle, light intensity, brightness and spectrum model on the virtual data display board model in the form of a three-dimensional text model; query the corresponding model in the light intensity spatial distribution model and the brightness spatial distribution model according to the vertical axis rotation angle, and update the model on the virtual holographic display model;
[0020] Step S53: the rotation angle of the horizontal axis increases, and the increase amount is a preset horizontal axis rotation step length;
[0021] If the rotation angle of the horizontal axis exceeds 360°, the rotation angle of the horizontal axis is set to 0°, and the rotation angle of the vertical axis is increased by the preset vertical axis rotation step, otherwise go to the table lookup and data update step;
[0022] If the rotation angle of the vertical axis exceeds 180°, turn off the light source on the lamp model and end the process; otherwise, go to the table lookup and data update step.
[0023] Furthermore, the Unity platform displays the operating information of the full-spatial distribution photometer on the virtual reality device through the holographic display and data display board in the scene.
[0024] Compared with the prior art, the present invention has the following advantages:
[0025] 1. The present invention can be used as a teaching aid to improve the teaching effect of practical teaching of full-space distribution photometer.
[0026] 2. The present invention can be applied in the field of virtual reality display of displaying spatial light color parameters. It can reflect the spatial light color information of lamps in a more immersive way, so that users can get a higher sense of immersion. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0028] Figure 1 It is a flow chart of the simulation method of the present invention.
[0029] Figure 2 A virtual laboratory flow chart is constructed for the present invention.
[0030] Figure 3 It is a generalized table structure diagram of the spatial spectrum model table of the present invention.
[0031] Figure 4 It is a generalized table structure diagram of the polar coordinate diagram model table of the present invention.
[0032] Figure 5 This is a script flow chart for running the full spatial distribution photometer of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] like Figure 1 As shown, the present invention provides a virtual reality full-space distribution photometer simulation software and method based on Unity, and the specific implementation of the method is as follows:
[0036] HP Z1G6-Z4 workstation and Huawei virtual reality glasses are used as hardware development tools, Unity platform software and 3D modeling software Blender are used as software development tools, and various models and scripts are completed in the development process. The completed result is a virtual reality full-space distribution photometer simulation application. The detailed steps are as follows:
[0037] S1: Prepare development tools: Install the Unity platform and 3D modeling software Blender on the HP Z1G6-Z4 workstation, and connect the workstation to the Huawei virtual reality glasses.
[0038] S2: Build a virtual laboratory environment: Create a scene on the Unity platform and name it the measurement scene. Import the model of the full-space distribution photometer and its accessories into the measurement scene.
[0039] S3: Prepare the virtual laboratory operation script: First, convert the spatial light color data table into a model that can be displayed in the working scene, and display the operation logic of the full spatial distribution photometer through each model in the working scene.
[0040] S4: Generate application on Unity platform.
[0041] As a preferred implementation, in this application, the construction of a virtual laboratory environment comprises the following steps:
[0042] S21: Import the darkroom model: Use the 3D modeling software Blender to create a darkroom model, save it as an FBX format file, import the file into the measurement scene as a game object type, and name it darkroom.
[0043] S22: Import the full-space distribution photometer model; Use the 3D modeling software Blender to build the full-space distribution photometer model, save it as an FBX format file, import the file into the measurement scene as a game object type, and name it the full-space distribution photometer. The game object full-space distribution photometer is divided into four sub-game objects, namely the control cabinet, turntable base, horizontal axis and vertical axis.
[0044] S23: Import the lamp model; use the 3D modeling software Blender to create a road lamp model, save it as an FBX format file, import the file into the measurement scene as a game object type, name the road lamp, add a light source component to the game object road lamp, and set the intensity of the light source component to 1.
[0045] S24: Import the holographic display model; use the 3D modeling software Blender to create the holographic display model, save it as an FBX format file, import the file into the measurement scene as a game object type, and name the holographic display.
[0046] S25: Import the data display board model; use the 3D modeling software Blender to create the data display board model, save it as an FBX format file, import the file into the measurement scene as a game object type, and name the data display board. The data display board is installed with the horizontal axis angle, vertical axis angle illumination, light intensity and brightness data displayed in the form of a 3D text model. The data display board is installed with a spectrum diagram displayed in a Cartesian coordinate system, with the horizontal axis being the visible light band, ranging from 380-780nm, and the vertical axis being the relative spectral power.
[0047] S26: adjusting the position of each model in the working scene; placing the full-space distribution photometer model and the lamp model at designated positions inside the darkroom in the scene, and placing the holographic display and the data display board at designated positions outside the darkroom.
[0048] As a preferred implementation, in this application, the preparation of the virtual laboratory operation script includes the following steps:
[0049] S31: Prepare a script for importing the spatial light color data table: Prepare the script in C# language and execute it at the startup stage of the application. Generate a three-dimensional spectrum model table and a polar coordinate graph model table based on the spatial light color data table and import them into the working scene. The spatial light color data table contains the horizontal axis (γ axis) rotation angle, the vertical axis (C axis) rotation angle, light intensity, brightness, and spectrum data. The three-dimensional spectrum model table consists of the horizontal axis rotation angle, the vertical axis rotation angle, and the spectrum model. The polar coordinate graph model table consists of the vertical axis rotation angle, the light intensity polar coordinate graph model, and the brightness polar coordinate graph model.
[0050] S32: Compile the running script of the full-space distribution photometer: Compile the script in C# language and execute it in the running stage of the application. Control the light source on the lamp to emit light, set the posture of the horizontal axis and vertical axis on the turntable base of the full-space distribution photometer at a fixed time, and notify the holographic display and data display board to update the content.
[0051] S33: compile a running script of the virtual holographic display: compile a script in C# language and execute it during the running phase of the application. After receiving a notification from the running script of the full spatial distribution photometer to update the display data, update the spatial light intensity distribution model and the spatial brightness distribution model displayed on the virtual holographic display.
[0052] S34: compile a running script of a virtual data display board: compile a script in C# language and execute it in the running stage of the application. After receiving a notification from the running script of the full spatial distribution photometer to update the displayed data, update the horizontal axis rotation angle, vertical axis rotation angle, light intensity, brightness and spectrum information displayed on the virtual data display board.
[0053] In this embodiment, as a preferred embodiment, the script for importing the spatial light color data table includes the following steps:
[0054] S31: Constructing a spatial spectrum model table: The three-dimensional spectrum model table consists of a horizontal axis rotation angle, a vertical axis rotation angle, and a spectrum model. The spectrum data corresponding to the horizontal axis rotation angle and the vertical axis rotation angle specified in the spatial light color data table are plotted as a spectrum diagram in a Cartesian coordinate system, wherein the horizontal axis of the spectrum diagram is the visible spectrum segment, and the vertical axis is the relative spectrum power.
[0055] S32: Data grouping: The spatial light color data table is divided into several data groups according to the vertical axis rotation angle, and each data group contains the horizontal axis rotation angle and the corresponding light intensity and brightness.
[0056] S33: Plotting a polar coordinate graph using the data group as a unit: using the horizontal axis rotation angle as the polar angle and the corresponding light intensity and brightness as the polar diameter, respectively plotting a light intensity polar coordinate graph and a brightness polar coordinate graph.
[0057] S34: Combining polar coordinate diagrams into spatial distribution: rotating each polar coordinate diagram around the vertical axis according to the corresponding vertical axis rotation angle in space, and combining them into a light intensity spatial distribution model and a brightness spatial distribution model.
[0058] S35: Record in the polar coordinate graph model table: record the light intensity spatial distribution model and the brightness spatial distribution model
[0059] As a preferred embodiment, in this embodiment, the full space distribution photometer running script comprises the following steps:
[0060] S41: The user sets the operating parameters, including the horizontal axis rotation step length and the vertical axis rotation step length.
[0061] S42: Turn on the light source on the lamp model, and set the rotation angles of the horizontal axis and the vertical axis to 0°.
[0062] S41: According to the horizontal axis rotation angle and the vertical axis rotation angle, the corresponding spectrum model is queried in the spatial spectrum model table, and the horizontal axis rotation angle and the vertical axis rotation angle, the light intensity, the brightness and the spectrum model are updated on the virtual data display board model in the form of a three-dimensional text model. According to the vertical axis rotation angle, the corresponding model is queried in the light intensity spatial distribution model and the brightness spatial distribution model, and the model is updated on the virtual holographic display model.
[0063] The rotation angle of the horizontal axis increases by the preset horizontal axis rotation step. If the rotation angle of the horizontal axis exceeds 360°, the rotation angle of the horizontal axis is set to 0°, and the rotation angle of the vertical axis increases by the preset vertical axis rotation step. Otherwise, go to S43. If the rotation angle of the vertical axis exceeds 180°, turn off the light source on the lamp model and end the process, otherwise go to S43:.
[0064] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0065] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A virtual reality simulation method for a full-space distribution photometer based on Unity, characterized in that: The following steps are involved: S1: The workstation is installed with Unity platform and 3D modeling software and connected to the virtual reality device; S2: creating a scene on the Unity platform; importing a full-space distribution photometer model, a lamp model, a holographic display model, a data display board model, and a darkroom model into the scene to construct a laboratory environment; S3: compile a script for importing a spatial light color data table and a script for running the full spatial distribution photometer; the method for importing the spatial light color data table into a scene in a three-dimensional model is obtained by the following steps: S31: constructing a spatial spectrum model table, including: a three-dimensional spectrum model table consisting of a horizontal axis rotation angle, a vertical axis rotation angle and a spectrum model; The spectral data corresponding to the horizontal axis rotation angle and the vertical axis rotation angle specified in the spatial light color data table are plotted as a spectrum graph in a Cartesian coordinate system, wherein the abscissa of the spectrum graph is the visible spectrum segment and the ordinate is the relative spectral power; S32: Grouping the spatial light color data; dividing the spatial light color data table into a plurality of data groups according to the vertical axis rotation angle, each group of data containing the horizontal axis rotation angle and the corresponding light intensity and brightness; S33: drawing a polar coordinate diagram with the data group as a unit; taking the horizontal axis rotation angle as the polar angle, taking the light intensity and brightness corresponding to the data group as the polar diameter, and drawing a light intensity polar coordinate diagram and a brightness polar coordinate diagram respectively; S34: combining polar coordinate diagrams into spatial distribution; rotating each polar coordinate diagram around the vertical axis according to a corresponding vertical axis rotation angle in space to form a light intensity spatial distribution model and a brightness spatial distribution model; S35: Recording into the polar coordinate graph model table: the light intensity spatial distribution model and the brightness spatial distribution model; S4: Generate a virtual reality simulation application for the full-space distribution photometer through the Unity platform; the operation process simulation flow of the full-space distribution photometer also includes the following steps: S41: The user sets the operating parameters and initializes the parameters of each component of the goniophotometer; S42: Look up the table to update the data; query the corresponding spectrum model in the spatial spectrum model table according to the horizontal axis rotation angle and the vertical axis rotation angle, and update the horizontal axis and vertical axis rotation angle, light intensity, brightness and spectrum model on the virtual data display board model in the form of a three-dimensional text model; query the corresponding model in the light intensity spatial distribution model and the brightness spatial distribution model according to the vertical axis rotation angle, and update the model on the virtual holographic display model; S43: the rotation angle of the horizontal axis increases, and the increase amount is a preset horizontal axis rotation step length; S44: if the rotation angle of the horizontal axis exceeds 360°, the rotation angle of the horizontal axis is set to 0°, and the rotation angle of the vertical axis is increased by a preset vertical axis rotation step, otherwise, the process goes to the table lookup and data update step; S45: If the rotation angle of the vertical axis exceeds 180°, turn off the light source on the lamp model and end the process; otherwise, go to the table lookup and data update step.
2. The virtual reality simulation method of the full-space distribution photometer based on Unity according to claim 1, characterized in that: The full spatial distribution photometer model and laboratory environment are constructed through the Unity platform.
3. The virtual reality simulation method of the full-space distribution photometer based on Unity according to claim 1, characterized in that: The Unity platform displays the operating information of the full-spatial distribution photometer on the virtual reality device through the holographic display and data display board in the scene.
