A method for rendering a three-dimensional scene in virtual reality
By verifying the area of light and shadow and adjusting the correlation adjustment circle of individual models in virtual reality 3D scenes, the problem of identifying and adjusting abnormal individual models was solved, thereby improving the rendering effect and realism of 3D scenes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN YANYUAN HUADIAN NEW ENERGY CO LTD
- Filing Date
- 2024-09-27
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies are unable to quickly and effectively identify and adjust abnormal individual models in virtual reality, resulting in poor rendering of 3D scenes.
By calibrating and verifying individual models in a 3D scene, the shadow area is determined by the light generated by the light source. The image color value is obtained by combining remote sensing equipment to identify abnormal individual models. The base surface is adjusted by associating adjustment circles and center points to ensure the consistency of the shadow area.
It enables rapid identification and adjustment of abnormal single-unit models, improves the rendering effect and display accuracy of 3D scenes, and enhances the realism of 3D scenes.
Smart Images

Figure CN119338964B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D scene rendering technology, specifically a method for rendering 3D scenes in virtual reality. Background Technology
[0002] Virtual reality (VR) 3D scenes are three-dimensional spaces constructed using computer technology to simulate real or fictional environments. These scenes consist of various 3D models, including objects, terrain, and buildings. These models have three dimensions: length, width, and height, giving viewers a realistic sense of space.
[0003] Patent application CN106204704A discloses a rendering method and apparatus for three-dimensional scenes in virtual reality, relating to the field of virtual reality technology. The method includes: determining a three-dimensional scene model of the object to be rendered in a three-dimensional scene, and converting the three-dimensional scene model into a two-dimensional scene model; loading the converted two-dimensional scene model onto the imaging space of the three-dimensional scene to complete the rendering of the scene in virtual reality. Compared with existing technologies, this invention uses a two-dimensional scene model during rendering, which requires less data processing compared to the use of a three-dimensional scene model in existing technologies, thus avoiding significant CPU / GPU time consumption and improving rendering efficiency.
[0004] The rendering process for 3D scenes in virtual reality generally includes adjustment rendering and entity rendering. Adjustment rendering makes the 3D scene more realistic by changing the spacing and inconsistencies between individual models. Entity rendering completes the rendering process of the entire 3D scene by adding color to the surface of individual models. However, in the original entity rendering, the parameters between individual models are only evaluated to determine whether they are consistent or up to standard through parameter verification. The parameter verification only verifies the associated parameters in the construction process. If there are specific anomalies in the corresponding associated parameters from the beginning, they cannot be accurately identified. Therefore, it is impossible to quickly and effectively identify individual models with abnormalities, and it is also impossible to adjust the abnormal individual models in a timely manner, resulting in poor actual rendering effect of the 3D scene. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a rendering method for three-dimensional scenes in virtual reality, which solves the problems of being unable to quickly and effectively identify individual models with abnormalities, and being unable to adjust abnormal individual models in a timely manner during synchronization.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for rendering a three-dimensional scene in virtual reality, comprising the following steps:
[0007] Step 1: Based on the initially constructed 3D scene, calibrate the individual models in the 3D scene, and verify the correlation of the calibrated individual models. Assess whether there are any height errors in this 3D scene, make adjustments, and determine the base plane to be adjusted. The specific sub-steps are as follows:
[0008] S11. Randomly extract a set of calibrated individual models from the 3D scene. The individual models have been calibrated in advance during construction. Based on the specific location of the light source, the associated light generated by the light source is confirmed by the corresponding light source set in the 3D scene.
[0009] S12. Label the associated rays whose endpoints are located on this single-unit model as internal rays. Based on the labeled sets of internal rays, label the outermost internal ray as a critical ray. This critical ray is located on the edge contour of the single-unit model. Label the rays that are not internal rays but are adjacent to the critical ray as rays to be processed. Lock the actual landing point of this ray on the base surface. Based on the several sets of actual landing points generated by the several rays to be processed, label the area of the region included between the several sets of actual landing points as the shadow area YM. i , where i represents different individual models;
[0010] S13. The shadow area YM based on the determined corresponding single-unit model. i The system acquires the overall image of the corresponding single model at the current moment using remote sensing equipment or drones. Based on the predefined color value ranges of relevant pixels, it identifies and labels the shadow area within the overall image as a shadow image. The color values of different pixels within the shadow image all belong to the predefined color value range, and this range is a preset interval. The area BM of this shadow image is then confirmed. i Identify YM i Is it with BM? i If they are consistent, no action is taken; otherwise, this individual model is marked as an anomalous individual.
[0011] S14. Cause the abnormal unit to move up and down, so that the generated YM i With BM i Satisfy: |YM i -BM i When |≤Y1, stop, where Y1 is a preset value, and then the base surface that moves with the abnormal unit is used as the base surface to be adjusted;
[0012] Step 2: Based on the base surface to be adjusted generated during the 3D scene adjustment process, first determine the center point of the corresponding base surface, then generate an associated adjustment circle belonging to this base surface. Combining this associated adjustment circle with the actual parameters, adjust the specific base surfaces associated with the adjustment circle to make the generated base surface to be adjusted into a standard base surface. The specific method is as follows:
[0013] S21. Decompose the determined base surface to be adjusted into several points to be determined, place the base surface to be adjusted in a set of two-dimensional coordinate systems, and identify the coordinates of the points associated with different points to be determined in the base surface to be adjusted based on the two-dimensional coordinate systems. Perform average processing on the coordinates of the points to be determined, determine a set of average coordinates, determine the corresponding average points in the two-dimensional coordinate system based on the determined average coordinates, and mark the determined average points in the base surface to be adjusted as their center points.
[0014] S22. Based on the center point marked in the base plane to be adjusted, construct an associated center line passing through the center point from the edge contour of the base plane to be adjusted. Both ends of the associated center line are located on the edge contour. Select the longest line segment from the constructed associated center lines as the selected associated center line.
[0015] S23. Based on the selected associated center line and center point, construct a set of associated adjustment circles, and according to the inner radius R of the associated adjustment circle, divide this radius R into several equidistant micro segments, and based on the confirmed micro segments, divide this associated adjustment circle into several adjustment circles. Then, based on the actual parameters when constructing the 3D scene, obtain the base surface parameters belonging to the corresponding adjustment circles, and perform associated adjustment on several adjustment circles based on the obtained base surface parameters, so that the base surface to be adjusted is adjusted to the standard base surface.
[0016] Preferably, in step S23, the endpoint of each micro-segment is regarded as a radius point, and a circle is drawn based on the distance between the radius point and the center point to generate several corresponding adjustment circles, and the spacing between each adjacent adjustment circle is equal.
[0017] Preferred options also include:
[0018] Step 3: Display the fault areas that appear in the 3D scene for external personnel to view; the fault areas are the areas where there are no individual models, standard base surfaces, or the original base surfaces in the 3D scene.
[0019] This invention provides a method for rendering three-dimensional scenes in virtual reality. Compared with existing technologies, it has the following advantages:
[0020] This invention adjusts the model of the constructed 3D scene, confirms the correlation of the shadow areas generated by the corresponding individual models in the 3D scene, locks the associated shadows generated by the individual models in the actual scene, evaluates whether the corresponding shadow areas are relatively consistent based on the correlation of the shadow areas of the two, and makes correlation adjustments and modifications to the relevant individual models based on the specific evaluation results, so that the displayed individual models are more realistic, with smaller errors, and achieve a better 3D scene display effect.
[0021] Based on the associated base planes that have changed during the adjustment of the corresponding individual model, the associated base planes are readjusted. Based on the associated regions corresponding to the associated base planes, the association of the center point and internal line segments is confirmed, thereby locking the corresponding base plane to be adjusted. Subsequently, based on the determined base plane to be adjusted, the actual base planes in the 3D scene are adjusted to ensure the accuracy of the corresponding 3D scene display and to ensure the specific adjustment and rendering effect of the 3D scene. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0023] Figure 2 This is a schematic diagram illustrating the construction of the correlation adjustment ring of the present invention;
[0024] Figure 3 This is a schematic diagram illustrating the construction of the adjusted circle in this invention. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] First Embodiment
[0027] Please see Figure 1 This application provides a method for rendering a three-dimensional scene in virtual reality, including the following steps:
[0028] Step 1: Based on the preliminarily constructed 3D scene (this 3D scene can be generated based on relevant scanned or captured images and set specific parameters to create a 3D scene of the corresponding area; the 3D scene can be generated by specific modeling software or constructed manually; since the associative construction of 3D scenes is quite common in existing technologies, it will not be elaborated on here), calibrate the individual models in the 3D scene, and perform associative verification on the calibrated individual models to assess whether there are height errors in this 3D scene, make adjustments, and determine the base surface to be adjusted. The specific sub-steps for associative verification are as follows:
[0029] S11. Randomly extract a set of calibrated individual models from the 3D scene. These individual models were pre-calibrated during construction to facilitate subsequent extraction. Using the corresponding light source set in the 3D scene, based on the specific location of this light source, confirm the associated light rays produced by this light source (the light source is actually determined based on the actual location of the sun in the scene, and changes in 3D space according to the specific angle of solar activity. The position of the sun in the actual scene can be confirmed using the GPS global positioning system, which can provide the latitude and longitude coordinates of any location on Earth; by knowing your location and time, you can calculate the position of the sun, and simultaneously use the sun position calculation formula to calculate the sun's spatial angle and coordinates; these formulas are usually based on astronomical principles and mathematical models, and require input parameters such as time and location).
[0030] S12. Label the associated rays whose endpoints are located on this single-unit model as internal rays. Based on the labeled sets of internal rays, label the outermost internal ray as the critical ray. This critical ray is located on the edge contour of the single-unit model. Label the rays that are not internal rays but are adjacent to the critical ray as rays to be processed (here, adjacent means the closest vertical distance). Lock the actual landing point of this ray on the base surface. Based on the several sets of actual landing points generated by several rays to be processed, label the area of the region included between the several sets of actual landing points as the shadow area YM. i , where i represents different individual models;
[0031] S13. The shadow area YM based on the determined corresponding single-unit model. i The system acquires the overall image of the corresponding single model at the current moment using remote sensing equipment or drones. Based on the predefined color value ranges of relevant pixels, it identifies and labels the shadow area within the overall image as a shadow image. The color values of different pixels within the shadow image all belong to the predefined color value range, which is a preset range determined in advance by relevant operators based on experience. The area BM of this shadow image is then confirmed. i Identify YM i Is it with BM? iIf they are consistent, no processing is performed. If they are inconsistent, this single-unit model is marked as an abnormal single unit (the reason for the inconsistent area is that the shadow area generated by the corresponding single-unit model is different from the actual area generated. Therefore, when such a single-unit model is constructed, there may be a corresponding height difference, which leads to this abnormal situation. Thus, the corresponding single-unit model belongs to the corresponding abnormal single unit).
[0032] S14. For the identified abnormal unit, the abnormal unit is moved vertically. During this movement, the base surface connected to the abnormal unit also moves (the base surface is the bottom plane of the corresponding abnormal unit). When the abnormal unit moves vertically, the generated YM... i With BM i Satisfy: |YM i -BM i When |≤Y1, the adjustment ends, where Y1 is a preset value. The specific value is determined in advance by the operator based on experience. After the movement and adjustment are completed, the relevant base surface that followed the movement will be marked as the base surface to be adjusted.
[0033] When the corresponding abnormal unit moves, the associated base surface shows an amplitude trend change. That is, when the corresponding unit moves upward, the corresponding base surface moves along with it on the original base surface. When moving, the bottom surface of the unit remains unchanged, and the base surface around the bottom surface is stretched as the entire bottom surface rises. The stretched part of the base surface is the corresponding base surface to be adjusted. For the marked base surface to be adjusted, subsequent associated adjustments are required to bring such base surface to a normal base surface shape.
[0034] Step 2: Based on the base surface to be adjusted generated during the 3D scene adjustment process, first determine the center point of the corresponding base surface, then generate the associated adjustment circle belonging to this base surface. Combining this associated adjustment circle with the actual parameters, perform associated adjustment on the specific base surface associated with the associated adjustment circle to adjust the generated base surface to the standard base surface. The specific sub-steps for actual adjustment are as follows:
[0035] S21, Combination Figure 2 as well as Figure 3 The determined base surface to be adjusted is decomposed into several points to be determined (a surface is composed of lines, and a line is composed of points, so a surface can be directly decomposed into points). The base surface to be adjusted is placed in a set of two-dimensional coordinate systems, and the coordinates of the points associated with different points to be determined in the base surface to be adjusted are identified based on the two-dimensional coordinate systems. The coordinates of the points to be determined are averaged to determine a set of average coordinates. Based on the determined average coordinates, the corresponding average points are determined in the two-dimensional coordinate system, and the determined average points are marked on the base surface to be adjusted as their center points.
[0036] S22. Based on the center point marked in the base plane to be adjusted, construct an associated center line passing through the center point from the edge contour of the base plane to be adjusted. Both ends of the associated center line are located on the edge contour. Select the longest line segment from the constructed associated center lines as the selected associated center line.
[0037] S23. Based on the selected associated center line and center point, construct a set of associated adjustment circles. According to the inner radius R of the associated adjustment circle, divide this radius R into several equidistant micro-segments. Based on the confirmed micro-segments, divide this associated adjustment circle into several adjustment circles (that is, the endpoint of each micro-segment is regarded as the radius point. Based on the distance between the radius point and the center point, draw a circle to generate several corresponding adjustment circles. The spacing between each adjacent adjustment circle is equal). Based on the actual parameters when constructing the 3D scene, obtain the base surface parameters belonging to the corresponding adjustment circle. Based on the obtained base surface parameters, perform associated adjustment on several adjustment circles to adjust the base surface to be adjusted to the standard base surface, thus completing the optimization work of several base surfaces to be adjusted.
[0038] Specifically, when a single model is moved, its corresponding base surface will also be affected, resulting in a change in the base surface. In order to readjust the corresponding base surface to its original standard state, it is necessary to determine the specific parameters of the corresponding base surface and make detailed adjustments one by one to complete the specific 3D scene rendering adjustment process and make the displayed 3D scene more standardized.
[0039] Example: Suppose we have an irregular base surface to be adjusted, shaped like an irregular polygon. We can think of this base surface as a set of points.
[0040] Decompose the datum plane to be adjusted into points to be determined:
[0041] For example, we can consider each vertex of the polygon and some equally divided points on its edges as points to be determined. Suppose there are 10 such points to be determined.
[0042] Place it in a two-dimensional coordinate system and determine the coordinates of the point:
[0043] Suppose we place this base plane in a two-dimensional coordinate system, and the coordinates of these 10 undetermined points are obtained by measurement or calculation as (x1, y1), (x2, y2), ..., (x10, y10).
[0044] Mean value processing determines the mean coordinates and center point:
[0045] Calculate the mean of these 10 coordinates: the mean of the x-coordinate is (x1+x2+...+x10) / 10, and the mean of the y-coordinate is (y1+y2+...+y10) / 10. The point corresponding to this mean coordinate is the center point of the base surface to be adjusted.
[0046] Constructing the associated center line:
[0047] Using points on the edge contour of this irregular polygon as endpoints, construct line segments that pass through the center point. There can be many such line segments, for example, starting from different edge points, passing through the center point, and connecting to the opposite edge point.
[0048] Select the longest line segment as the center line of association:
[0049] Calculate the lengths of these line segments and select the longest one. Suppose we find the longest line segment with endpoints A and B and center point O.
[0050] Constructing a correlation adjustment circle:
[0051] Based on the center point O and the selected associated center line AB, construct an associated adjustment circle. Let's assume we set the inner radius of this circle to R.
[0052] Divide into micro-segments and adjust the circles:
[0053] Divide the radius R into several equidistant micro-segments, for example, into 5 micro-segments. Then, using the endpoint of each micro-segment as the radius point, draw a circle with the center point O as the center. This will give you 5 adjustment circles, with equal spacing between each adjacent adjustment circle.
[0054] Based on base plane parameters, perform correlation adjustments:
[0055] When constructing a 3D scene, we have some practical parameters, such as the height and color values of each point. For each adjustment circle, we can adjust it based on these base parameters. For example, for the height parameter, we can smooth the height of the points within the adjustment circle or adjust it to a specific value based on the circle's location to achieve a better visual effect or meet specific design requirements.
[0056] Second Embodiment
[0057] Step 3: For the fault areas appearing in the 3D scene, display the fault area and the associated abnormal images and parameters around it for external personnel to view. The fault area is a related area without individual models and base surfaces (belonging to a related area without any parameters). External personnel will automatically adjust such related areas to complete the actual adjustment and rendering work of the specific 3D scene. The associated abnormal images around it include this fault area. That is, by determining the center point of the fault area, and based on the overall outline of the fault area, display the abnormal images of the related areas within 30cm around the overall outline.
[0058] Some of the data in the above formulas are numerical calculations with dimensions removed, and the contents not described in detail in this specification are all prior art known to those skilled in the art.
[0059] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.
Claims
1. A method for rendering a three-dimensional scene in virtual reality, characterized in that, Includes the following steps: Step 1: Based on the initially constructed 3D scene, calibrate the individual models in the 3D scene, and verify the correlation of the calibrated individual models. Assess whether there are height errors in this 3D scene and make adjustments to determine the base plane to be adjusted. The specific sub-steps are as follows: S11. Randomly extract a set of calibrated individual models from the 3D scene, and determine the associated light rays produced by the corresponding light source based on the specific location of the corresponding light source set in the 3D scene. S12. Label the associated rays whose endpoints are located on the single-unit model as internal rays. Based on the labeled sets of internal rays, label the outermost internal ray as the critical ray. This critical ray is located on the edge contour of the single-unit model. Label the rays that are not internal rays but are adjacent to the critical ray as rays to be processed. Lock the actual landing point of this ray on the base surface. Based on the several sets of actual landing points generated by the several rays to be processed, label the area of the region included between the several sets of actual landing points as the shadow area YM. i , where i represents different individual models; S13. The shadow area YM based on the determined corresponding single-unit model. i The system acquires the overall image of the corresponding single model at the current moment using remote sensing equipment or drones. Based on the predefined color value ranges of relevant pixels, it identifies and labels the shadow area within the overall image as a shadow image. The color values of different pixels within the shadow image all belong to the predefined color value range, and this range is a preset interval. The area BM of this shadow image is then confirmed. i Identify YM i Is it with BM? i If they are consistent, no action is taken; if they are inconsistent, this individual model is marked as an anomalous individual. Step 2: Based on the base surface to be adjusted generated during the 3D scene adjustment process, first determine the center point of the corresponding base surface, then generate an associated adjustment circle belonging to this base surface. Combining this associated adjustment circle with the actual parameters, adjust the specific base surfaces associated with the associated adjustment circle to make the generated base surface to be adjusted into a standard base surface. The specific method is as follows: S21. Decompose the determined base surface to be adjusted into several points to be determined, place the base surface to be adjusted in a set of two-dimensional coordinate systems, and identify the coordinates of the points associated with different points to be determined in the base surface to be adjusted based on the two-dimensional coordinate systems. Perform average processing on the coordinates of the points to be determined, determine a set of average coordinates, determine the corresponding average points in the two-dimensional coordinate system based on the determined average coordinates, and mark the determined average points in the base surface to be adjusted as their center points. S22. Based on the center point marked in the base plane to be adjusted, construct an associated center line passing through the center point from the edge contour of the base plane to be adjusted. Both ends of the associated center line are located on the edge contour. Select the longest line segment from the constructed associated center lines as the selected associated center line. S23. Based on the selected associated center line and center point, construct a set of associated adjustment circles, and according to the inner radius R of the associated adjustment circle, divide this radius R into several equidistant micro segments, and based on the confirmed micro segments, divide this associated adjustment circle into several adjustment circles. Then, based on the actual parameters when constructing the 3D scene, obtain the base surface parameters belonging to the corresponding adjustment circles, and perform associated adjustment on several adjustment circles based on the obtained base surface parameters, so that the base surface to be adjusted is adjusted to the standard base surface.
2. The rendering method for a three-dimensional scene in virtual reality according to claim 1, characterized in that, In step one, the specific method for determining the base surface to be adjusted is as follows: S14. Cause the abnormal unit to move up and down, so that the generated YM i With BM i Satisfy: |YM i -BM i |≤Y1 up, YM i BM represents the shadow area of the anomalous single entity. i The actual measured shadow image is used, where Y1 is a preset value. Then, the base surface that moves with the abnormal single entity is used as the base surface to be adjusted.
3. The rendering method for a three-dimensional scene in virtual reality according to claim 1, characterized in that, In step S23, the endpoint of each micro-segment is regarded as a radius point. A circle is drawn based on the distance between the radius point and the center point to generate several corresponding adjustment circles. The spacing between each adjacent adjustment circle is equal.
4. The rendering method for a three-dimensional scene in virtual reality according to claim 1, characterized in that, Also includes: Step 3: Display the fault areas that appear in the 3D scene for external personnel to view.
5. The rendering method for a three-dimensional scene in virtual reality according to claim 4, characterized in that, The fault region is the associated region where there is no single model, standard datum, or original datum in the 3D scene.