A method for calculating the surface area of ​​multi-system 3D models based on OpenGL

Through the multi-system three-dimensional model surface area calculation method based on OpenGL, the exposed surface area of ​​each subsystem is automatically calculated using depth testing and texture mapping technology, which solves the problems of complex and non-common existing methods and achieves efficient and accurate surface area calculation.

CN114757989BActive Publication Date: 2025-05-09CHINESE PEOPLES LIBERATION ARMY UNIT 32027
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210306431.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2025-05-09
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

The existing multi-system three-dimensional model surface area calculation method is complex and not universal, and it is impossible to automatically and accurately determine the positional relationship of occlusion between each subsystem, resulting in low computing efficiency and low accuracy.

Method used

Using OpenGL-based method, the exposed surface area of ​​each subsystem is automatically calculated by constructing a multi-system three-dimensional model, generating observation matrix and projection matrix, conducting depth tests, generating texture maps and superimposing them through multiple cycles.

Benefits of technology

It realizes the rapid and accurate calculation of the exposed surface area of ​​each subsystem of the three-dimensional model, with high accuracy and good promotion, and avoids the defects of manual division and subjective judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114757989B_ABST
    Figure CN114757989B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL, including: constructing a multi-system three-dimensional model, constructing an observation matrix and a projection matrix at a certain observation angle, conducting a depth test on a target subsystem, discarding pixels blocked by other subsystems, forming a subsystem surface distribution texture map at the angle, repeating the above steps to form a randomly evenly distributed texture at multiple observation angles, superimposing to form a full-angle exposed surface distribution texture of the target subsystem, and completing the surface area calculation based on the texture, and finally traversing all subsystems to obtain the exposed surface area of ​​each subsystem. The advantages of the present invention are: simple implementation, solving the practical problem that the calculation of the surface area of ​​each system of a three-dimensional model is complex and lacks universality, and compared with the specific analysis of a single model, the method can quickly calculate the exposed surface area of ​​each subsystem of the three-dimensional model, with extremely high accuracy and broad application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer graphics and relates to a method for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL. Background Art

[0002] In many scenarios such as when a spacecraft is in orbit, when an aircraft is flying in the atmosphere, when a rocket or missile is launched and flying, when a ground rail train or vehicle is driving, etc., it is necessary to consider the various environmental influences on the target, such as external heat flux, space debris, wind resistance, etc., which seriously restrict the performance, safe operation and life of the target. In order to evaluate the impact on the target, its exposed surface area must be known. However, the actual situation is that the above-mentioned targets are usually complex and irregular in shape, and each subsystem usually needs to be analyzed one by one due to different material composition, performance parameters, and positions. There is a problem of mutual occlusion between the subsystems, which makes it difficult to calculate the exposed surface area of ​​each subsystem, and it is impossible to accurately evaluate each subsystem of the target separately. The existing method usually uses commercial 3D modeling software to conduct a specific analysis of a specific model. The exposed surface area is usually calculated manually, that is, each subsystem of the model is subdivided into grids or patches of different sizes, and the human eye is used to subjectively judge which parts of the subsystem are blocked. Then, the mouse is used to manually remove the blocked grid parts of each subsystem, and then the surface area is calculated based on the size and number of grids. The above method is subjective to a certain extent. Not only is the accuracy rate not guaranteed, but it is also inefficient and not universal. Therefore, it is necessary to construct a universal and automated calculation method for the surface area calculation model of multi-system 3D models. Summary of the invention

[0003] The purpose of the present invention is to provide a method for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL, so as to solve the problem that the existing multi-system three-dimensional model surface area calculation process is complicated and not universal.

[0004] In view of this, the present invention provides a method for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL, which is characterized by comprising:

[0005] Step 1: Import or build a multi-system 3D model based on OpenGL, perform displacement, rotation, scaling operations and build a model matrix;

[0006] Step 2: With the target system as the center, a sphere of observation positions is formed in a random and uniformly distributed manner to construct an observation matrix of a random observation position;

[0007] Step 3: Traverse all subsystems of the 3D model, find the maximum and minimum values ​​of the coordinates in the three directions, use them as the clipping space boundary, and generate the orthographic projection matrix;

[0008] Step 4: The model matrix, the observation matrix and the projection matrix are input to perform a depth test. The exposed part of the target subsystem will pass the test, and the part blocked by other subsystems will fail the test.

[0009] Step 5: Generate 2D texture from the surface exposure information obtained in the observation direction;

[0010] Step 6: Traverse each subsystem of the 3D model and repeat steps 4 to 5 to generate a texture map of the exposed surface of each subsystem;

[0011] Step 7: Repeat steps 2 to 6 to complete multiple cycles, superimpose the drawn texture content, and generate the complete surface distribution of each subsystem;

[0012] Step 8: Add up the areas of the triangular patches on the subsystem surfaces, remove the blocked parts according to the texture generated in step 7, and obtain the exposed surface area of ​​each subsystem.

[0013] Furthermore, step one also includes:

[0014] Constructing multi-system 3D models including vertex coordinates, UV coordinates, normal vector coordinates, and face information;

[0015] Assemble all the points into a triangle primitive shape using GL_TRIANGLES, and then create a fragment shader for rendering the triangle.

[0016] Furthermore, step 2 also includes: using theta=pi*t(rd) function to generate a radian value with a domain of (0,2π), so that the generated random value covers the full angle.

[0017] Furthermore, step three also includes: using the glm::min / glm::max comparison method to traverse all vertex coordinates of the target subsystem.

[0018] Furthermore, step four also includes: multiplying the model matrix, observation matrix, and projection matrix in the order of projection matrix*observation matrix*model matrix, and passing them into the shader.

[0019] Furthermore, step five also includes: using a monochrome texture with a length and width set to 2048.

[0020] Furthermore, step seven also includes: setting the number of cycles to 1000 times.

[0021] Furthermore, step eight also includes: extracting the coordinate values ​​of the vertices of the triangle of the target subsystem and using the partial derivative dFdxFine / dFdyFine to obtain the cross product to obtain the normal vector of the triangle patch.

[0022] The present invention achieves the following significant beneficial effects:

[0023] The implementation is simple, including: constructing a multi-system three-dimensional model, constructing an observation matrix and a projection matrix at a certain observation angle, conducting a depth test on the target subsystem, discarding pixels blocked by other subsystems, forming a subsystem surface distribution texture map at this angle, repeating the above steps to form a randomly evenly distributed texture at multiple observation angles, superimposing to form a full-angle exposed surface distribution texture of the target subsystem, and completing the surface area calculation based on the texture, and finally traversing all subsystems to obtain the exposed surface area of ​​each subsystem. Compared with the specific analysis of a single model, this method can quickly calculate the exposed surface area of ​​each subsystem of the three-dimensional model with extremely high accuracy. The present invention can construct and import a three-dimensional model of any shape, and for a multi-system three-dimensional model, manual division is not required, and it can automatically and accurately determine the positional relationship of the occlusion between the subsystems, calculate the surface area of ​​the exposed position of each subsystem of the model, and the calculation result has high accuracy and good generalizability. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A flow chart of a method for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL according to the present invention;

[0025] Figure 2 A schematic diagram of a multi-system three-dimensional model according to an embodiment of the present invention;

[0026] Figure 3 An example of a multi-system three-dimensional model of the present invention is displayed in OpenGL;

[0027] Figure 4 The texture map of the front surface distribution of each subsystem of the three-dimensional model of the present invention is a circular surface distribution texture map;

[0028] Figure 5 This is a surface distribution texture map of each subsystem of the three-dimensional model of the present invention after circulation. DETAILED DESCRIPTION

[0029] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description and claims. It should be noted that the drawings are all in very simplified form and are not in precise proportions, and are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention.

[0030] It should be noted that, in order to clearly explain the content of the present invention, the present invention specifically cites multiple embodiments to further illustrate different implementations of the present invention, wherein the multiple embodiments are enumerated rather than exhaustive. In addition, for the sake of brevity of explanation, the contents mentioned in the previous embodiments are often omitted in the subsequent embodiments. Therefore, the contents not mentioned in the subsequent embodiments can refer to the previous embodiments accordingly.

[0031] Although the invention can be extended in various forms of modification and substitution, some specific implementation examples are listed in the specification and described in detail. It should be understood that the starting point of the inventor is not to limit the invention to the specific embodiments described. On the contrary, the starting point of the inventor is to protect all improvements, equivalent substitutions and modifications made within the spirit or scope defined by this claim. The same component number may be used in all drawings to represent the same or similar parts.

[0032] See also Figure 1 The present invention provides a method for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL, comprising:

[0033] Step 1: Build a 3D model. There are many ways to build a 3D model. Geometric bodies with complex surface configurations can be built using commercial software such as 3DSMAX, Blender, etc., and the built models can be imported into OpenGL. Some simple geometric bodies such as cuboids, cylinders, spheres, etc. can be built directly in OpenGL. These geometric bodies can be built into multi-system 3D models through operations such as coordinate transformation, rotation, and scaling. Note that the built model should include necessary information such as vertex coordinates, uv coordinates, normal vector coordinates, patch information, etc.

[0034] Step 2: Create an observation matrix. In OpenGL, the observation matrix is ​​used to convert the world space into the observation space, where the relationship between the observation position and the target position needs to be processed. The observation position and the target position are relative. In the present invention, the position coordinates of the target subsystem are set as the origin, and the exposure or obstruction position relationship of the target subsystem is observed from different observation positions. It is impossible to obtain all the exposed surface area information of the target subsystem from a single observation direction, so the observation must be completed from as many angles as possible and cover as comprehensive as possible. In the present invention, the spherical distribution function is used to solve this problem: all observation positions will form a sphere with the target position as the center, and the observation positions on the sphere are randomly and evenly distributed.

[0035] Step 3: Create an orthographic projection matrix. The projection matrix determines the size of the viewing window (also called the frustum). Vertices outside this space will be clipped. The frustum defined by this matrix needs to include the entire 3D model. Therefore, it is necessary to traverse all subsystems of the 3D model and find the maximum and minimum values ​​of the coordinates in the three directions as the width, height, and length boundaries of the clipping space.

[0036] Step 4: Complete the depth test. After the observation matrix and projection matrix are created, it is necessary to determine whether the target subsystem is blocked by other subsystems in the observation direction, so the depth information of each subsystem needs to be compared. In the created observation direction, when some parts of the target subsystem are blocked by other subsystems, it means that the depth value of other subsystems is smaller than the depth value of the blocked part of the target subsystem, then the depth test will fail, and the blocked pixels of the target subsystem will be discarded.

[0037] Step 5: Generate texture. To facilitate surface area calculation, in the present invention, a texture map is generated for the target exposed surface of each subsystem, that is, the expansion of the UV coordinates of the target subsystem after removing the part that fails the depth test. The generated texture is a 2D map, and the depth test result is extracted as the texture value of each vertex, so it can also be considered as a visualization of the depth test. The texture value of the blocked part, that is, the part that fails the depth test in step 4, is 0, so this part will not be displayed in the map, thus producing a distribution map of the exposed surface area of ​​the target subsystem.

[0038] Step 6: Traverse each subsystem of the 3D model and repeat steps 4 to 5 to generate a texture map for the exposed surface of each subsystem.

[0039] Step 7: Complete observation from more directions. It is impossible to obtain complete surface area information by observing the generated texture from only one direction, so it is necessary to complete the observation from as many directions as possible. Since the observation directions generated in step 2 are randomly and evenly distributed, it is only necessary to repeat steps 2 to 5, that is, to complete multiple cycles, and each cycle will generate a new random observation direction. The number of cycles can be set. The higher the number of settings, the more comprehensive the angles that the observation direction can cover, which is equivalent to forming an evenly covered observation sphere with the target as the center, and the higher the accuracy of the calculation results. Each cycle will draw a texture, which is directly superimposed with the content drawn last time, which can be understood as a continuous supplement to the newly observed content. After the cycle is completed, a complete surface distribution map of the target subsystem will be generated.

[0040] Step 8: Area calculation. In OpenGL, the smallest storage unit of a fragment is a triangle patch. Calculate the area of ​​each triangle patch in the UV map of the target subsystem, remove the triangle patches that are blocked, and directly add up the areas to get the total exposed surface area of ​​each subsystem.

[0041] As a specific embodiment, the method flow for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL provided by the present invention, taking the C++ programming language as an example, comprises the following steps:

[0042] Step 1: Build a 3D model. Use commercial software such as 3DSMAX to build a 3D geometric model, save it in obj format and import it into OpenGL. Note that the model should include vertex coordinates (v), uv coordinates (vt), normal vector coordinates (vn), and patch information (f). After the data is read, first create a vertex shader to complete further processing of the model. This operation includes scaling, rotation, displacement, etc. The implementation method is:

[0043] M = glm::scale(M,Scale);

[0044] M=glm::mat4_cast(glm::quat(radians(Rotate)))*M;

[0045] M=glm::translate(M,Translation);

[0046] Finally, a model matrix M is obtained, and the model data is multiplied by the vertex data, and assigned to the gl_Position variable. gl_Position is a predefined variable in OpenGL, and the value represents the output of the vertex shader behind the scenes. In OpenGL, drawing primitives includes GL_POINTS, GL_LINES, GL_TRIANGLES, GL_QUADS, etc., which respectively represent drawing points, lines, triangles, quadrilaterals, etc. In the present invention, the surface area is calculated using triangular patches, so the glDrawArrays (GL_TRIANGLES, 0, PositionSize ()) function is used, starting from the first data of the vertex data (that is, the starting index is 0), and every three vertices are drawn into a triangle. All vertex arrays need to be drawn, so PositionSize () is used to obtain the number of vertices imported by the three-dimensional model, so the assembly of the primitive shape is completed. Then, a fragment shader for rendering triangles is created. In order to make the three-dimensional model show better visualization effects, in the present invention, a diffuse reflection component is added, and the normal vector of the triangle patch is dot-multiplied with the light source position vector to calculate the influence of the light source on the fragment diffuse reflection, that is, result = max(0, dot(fs_in.normal, -fs_in.fragPos))*lightColor*objectColor; where fs_in.normal is the normal vector of the incoming triangle patch, -fs_in.fragPos is the light source position, which defaults to (0,0,0), lightColor and objectColor are the illumination color and object color respectively, and the size of each RGB component can be customized to obtain the required color, and the result is passed to fragColor, which is a variable predefined by OpenGL to represent the final output color. After compilation, the vertex and fragment shaders are linked as a shader program object and activated, that is, the construction of the three-dimensional model is completed and displayed in the interface.

[0047] Step 2: Create an observation matrix. In OpenGL, use the lookAt function to convert the world coordinates into the observation matrix, set the world coordinates of the target model to glm::vec3(0,0,0), and the observation position is a random uniformly distributed spherical function around the target model. Define a variable rd of the std::random_device random number type in C++, and then generate a container uniform_real_distribution <float>urd(0,2), which stores random numbers uniformly distributed between (0,2). Returning the urd(rd) value will get a random value. Use theta=pi*urd(rd)(rd) function to generate a random radian value with a range of (0,2π), which ensures that the generated random value can cover the full angle. Similarly, another radian value named phi can be generated. Then the observation position vector forward=normalize(glm::vec3{cos(theta)*sin(phi),sin(theta)*sin(phi),cos(phi)}), and finally get the observation matrix V=glm::lookAt(glm::vec3(0),forward,glm::vec3(0,1,0)), which generates a random observation position.

[0048] Step 3: Create an orthographic projection matrix. In OpenGL, use the glm::ortho function to create an orthographic projection matrix to transform the observation coordinates into clipping coordinates. This function is a built-in function in OpenGL and defines a clipping space. To ensure that the constructed 3D model is completely within the clipping space, it is necessary to find the maximum and minimum coordinates of the 3D model in the X, Y, and Z directions. Extract all vertex coordinate data of the 3D model and use the function maxX=glm::max(maxX,model.x), where model.x is the component of the vertex coordinate in the X direction, and maxX is defined as the maximum value of the 3D model in the X direction. Traverse all vertex coordinates and execute the above function to complete the comparison and update of the maxX value. Similarly, the maximum and minimum values ​​minZ, maxZ, minX, maxX, minY, and maxY in the three directions can be obtained. To ensure that the clipping space completely contains the three-dimensional model, the above values ​​are expanded by 0.1f, and the projection matrix P = glm::ortho(minX-0.1f, maxX+0.1f, minY-0.1f, maxY+0.1f, minZ-0.1f, maxZ+0.1f) is finally obtained.

[0049] Step 4: Complete the depth test. Here, we need to analyze the occluded part of each subsystem of the model separately, so we use the for(auto&m:models) loop function to traverse each subsystem, where models is the container for storing each subsystem. The model matrix M created in the previous steps, the observation matrix V in a random direction, and the projection matrix P are multiplied in the order of P*V*M and passed into the shader. In OpenGL, the perspective division and clipping in the observation direction will be completed. In OpenGL, each face of the model stores the depth buffer value (GL_DEPTH_BUFFER_BIT). Since the depth test (GL_DEPTH_TEST) is disabled by default, you need to use the glEnable(GL_DEPTH_TEST) function to enable the depth test. The depth test is automatically calculated by OpenGL. In the viewing direction, when some fragments of the target subsystem are not blocked, the depth test passes and the depth value of the fragment is updated to the depth buffer. When other subsystems block some parts of the target subsystem, it means that the depth value of other subsystems is smaller than the depth value of the blocked part of the target subsystem, then the depth test will fail and the blocked pixels of the target subsystem will be automatically discarded. After the depth test is completed, use glClear(GL_DEPTH_BUFFER_BIT) to clear the depth value written this time before the next rendering.

[0050] Step 5: Generate texture. Create a texture for the model surface that has completed the depth test in the above steps. Use glTexSubImage2D(GL_TEXTURE_2D,0,0,0,2048,2048,GL_RED,GL_FALSE,0) in OpenGL to generate a 2D texture of the observed model surface. The length and width are set to 2048 to ensure the accuracy of the texture. Since it is only used to calculate the surface area, a single color can be used (GL_RED, i.e. red, is used in the present invention). The blocked part, that is, the patch texture value that failed the depth test in step 4 is 0, so this part will not be displayed in the map. In this way, a distribution map of the exposed surface area of ​​the target subsystem is produced.

[0051] Step 6: Traverse each subsystem of the 3D model and repeat steps 4 to 5 to generate a texture map for the exposed surface of each subsystem.

[0052] Step seven: complete observation from more directions. In the present invention, in order to make the calculation result as accurate as possible, a loop is set to 1000 times to ensure that the observation direction can cover as comprehensive an angle as possible. A texture will be drawn in each loop, and then the color blending function glBlendFunc (GL_ONE, GL_ONE) will be used to superimpose it with the content drawn last time, where GL_ONE means that the texture drawn this time and the texture drawn last time all use all color values ​​(that is, the use factor is 1.0) to participate in the superposition. If a fragment discarded in a certain observation direction is not discarded in another observation direction, it means that the fragment is still the exposed surface of the target, then it will be supplemented in the process of texture superposition; if a fragment is discarded in all observation directions, then the fragment is judged to be blocked by other subsystems, and its texture value is still 0 after superposition. After the loop is completed, a complete surface distribution map of the target subsystem is generated.

[0053] Step 8: Area calculation. In the present invention, the model surface is divided into triangular patches, and the vertex coordinate values ​​of the patches are used, which are represented by triangle.Position in the present invention. The two direction vectors of the triangle are obtained using the formulas dx=dFdxFine(triangle.worldPos) and dy=dFdyFine(triangle.worldPos). The normal vector of the triangle is obtained using cross(dx,dy). The area of ​​the triangle is half the modulus of the normal vector, that is, area=0.5*length(cross(dx,dy)). At the same time, a coefficient coef=step(0.01,texture.r) is obtained using the step function. The first parameter of the function is a boundary value, and the second parameter is the texture value of the triangular patch. The texture value of the part of the target subsystem that is blocked is 0, and the return value of the coefficient coef is 0 (0<0.01). When the target subsystem is not blocked, the return value of the coefficient coef is 1. Multiply the area of ​​the triangle area by the coefficient coef, then the area of ​​the blocked triangle becomes 0, and the value of the unblocked area is retained. Finally, all triangles are traversed and calculated and the sum is completed to obtain the exposed surface area value of each subsystem.

[0054] test

[0055] Figure 2 An example of a satellite three-dimensional model is shown. In the following, a method for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL of the present invention is experimentally verified in combination with the example.

[0056] Step 1: Build a 3D model. Figure 2 The three-dimensional model shown is constructed by 3DSMAX software, which is saved in obj format and imported into OpenGL. The model contains vertex coordinates (v), uv coordinates (vt), normal vector coordinates (vn) and face information (f). In this embodiment, in order to ensure the accuracy of the actual comparative surface area calculation result, no scaling, rotation and displacement operations are performed on the three-dimensional model. Therefore, the scaling amount of each subsystem of the three-dimensional model is set to (1,1,1), the rotation amount is set to (1,1,1), and the displacement amount is set to (0,0,0). After the settings are completed, the OpenGL background will automatically complete the assignment and triangle primitive assembly. In order to make the explanation of this embodiment clearer, the final model matrix is ​​given here as:

[0057]

[0058] At the same time, set the illumination color to (0.2, 0.2, 0.2) and the object color to (1, 1, 1). Then the 3D model will be displayed as a dark gray in OpenGL. Figure 3 As shown in the public data, the satellite is composed of multiple subsystems such as the platform body, camera payload, communication payload, data transmission antenna, solar array, thermal control, etc. In this embodiment, four of the subsystems are analyzed in detail, namely, subsystem 1 represents the satellite platform, subsystem 2 represents the camera payload, subsystem 3 represents the data transmission antenna, and subsystem 4 represents the communication payload.

[0059] Step 2: Create an observation matrix. In this embodiment, the center position coordinates of the three-dimensional model subsystem 1 are set to (0,0,0), the observation position is a spherical function of random uniform distribution around the target model, and the random number is automatically generated by C++. Note that each generated value is different. To make the explanation of this implementation clearer, a random generated value of 1.107 is shown here, then the observation position vector forward = (-0.405, -0.141, 0.904), and finally the observation matrix V = glm::lookAt((0,0,0), (-0.405, -0.141, 0.904), (0,1,0)) is obtained.

[0060] Step 3: Create an orthographic projection matrix. This matrix is ​​automatically generated by OpenGL. Based on the observation matrix generated in step 2, the 3D model projection matrix P = glm::ortho(-4.470,4.488,-8.614,8.685,-2.956,2.837).

[0061] Step 4: Complete the in-depth test. Analyze each subsystem separately before testing. To make the explanation of this embodiment clearer, Figure 4 First, the surface expansion diagram of each subsystem when it is not affected by other subsystems is given. Next, the model matrix M created in steps 1 to 3, the observation matrix V in a random direction, and the projection matrix P are multiplied in the order of P*V*M, and passed into the shader to complete the perspective division and clipping in the observation direction. The glEnable(GL_DEPTH_TEST) function is used to enable the depth test, which is automatically calculated by OpenGL.

[0062] Step 5: Generate texture. Create texture for the model surface that has completed the depth test in the above steps. The texture value of some patches that fail the depth test in this viewing direction is 0 and will not be displayed in the map. Note that the generated texture is the surface expansion in a certain viewing direction, and it takes multiple cycles to generate an accurate texture map.

[0063] Step 6: Traverse each subsystem of the 3D model and repeat steps 4 to 5 to generate a texture map for the exposed surface of each subsystem.

[0064] Step 7: Complete observation from more directions. Set the number of loops to 1000 and superimpose the texture values ​​to obtain the final texture map of each subsystem, see Figure 5 As shown. Figure 3 and Figure 5 A comparison shows that for subsystem 1, i.e. the platform body, a data transmission antenna and a camera payload are arranged in the +Z direction, so two parts are blocked; it is connected to the transition section in the -Z direction, so this part is also blocked; a large heat dissipation surface is arranged in the -Y direction, so this part is blocked. For subsystem 2, i.e. the camera payload, a camera lens is arranged in the +Z direction, so this part is blocked; at the same time, the camera is partially embedded in the platform body, so the -Z direction and part of the side are all blocked. For subsystem 3, i.e. the data transmission antenna, the antenna is a circular double parabola shape, and the middle part is blocked by the feed source. For subsystem 4, i.e. the communication payload, the payload is an elliptical single parabola shape, independent of the satellite body, and is not affected by other subsystems.

[0065] Step 8: Area calculation. After the texture map is generated, the triangle surface area calculation method is used to automatically complete the calculation in the background and give the exposed surface area of ​​each subsystem. Table 1 shows the comparison of the public data values ​​and calculation results of the surface areas of the four subsystems studied in this embodiment. It should be noted that the data values ​​have certain errors due to the small number of significant digits.

[0066] Table 1 Comparison of surface area data and calculation results of each subsystem of the three-dimensional model

[0067] <![CDATA[Data value (m 2 )]]> <![CDATA[Calculation result (m 2 )]]> error Subsystem 1 18.2 18.231 0.17% Subsystem 2 0.6 0.602 0.33% Subsystem 3 1.0 1.001 0.10% Subsystem 4 5.5 5.500 0.00%

[0068] It can be seen from Table 1 that the error of each subsystem is controlled within 0.33%, which shows that the method provided by the present invention has high accuracy and reliability in calculating the surface area of ​​multiple systems.

[0069] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0070] The implementation is simple, including: constructing a multi-system three-dimensional model, constructing an observation matrix and a projection matrix at a certain observation angle, conducting a depth test on the target subsystem, discarding pixels blocked by other subsystems, forming a subsystem surface distribution texture map at this angle, repeating the above steps to form a randomly evenly distributed texture at multiple observation angles, superimposing to form a full-angle exposed surface distribution texture of the target subsystem, and completing the surface area calculation based on the texture, and finally traversing all subsystems to obtain the exposed surface area of ​​each subsystem. Compared with the specific analysis of a single model, this method can quickly calculate the exposed surface area of ​​each subsystem of the three-dimensional model with extremely high accuracy. The present invention can construct and import a three-dimensional model of any shape, and for a multi-system three-dimensional model, manual division is not required, and it can automatically and accurately determine the positional relationship of the occlusion between the subsystems, calculate the surface area of ​​the exposed position of each subsystem of the model, and the calculation result has high accuracy and good generalizability.

[0071] According to the technical solution and concept of the present invention, there may be any other suitable changes. For those skilled in the art, all these replacements, adjustments and improvements should fall within the protection scope of the appended claims of the present invention.< / float>

Claims

1. A method for calculating the surface area of ​​a multi-system three-dimensional model based on OpenGL, characterized in that: include: Step 1: Import or build a multi-system 3D model based on OpenGL, perform displacement, rotation, scaling operations and build a model matrix; Step 2: With the target system as the center, a sphere of observation positions is formed in a random and uniformly distributed manner to construct an observation matrix of a random observation position; Step 3: Traverse all subsystems of the 3D model, find the maximum and minimum values ​​of the coordinates in the three directions, use them as the clipping space boundary, and generate the orthographic projection matrix; Step 4: The model matrix, the observation matrix and the projection matrix are input to perform a depth test. The exposed part of the target subsystem will pass the test, and the part blocked by other subsystems will fail the test. Step 5: Generate 2D texture from the surface exposure information obtained in the observation direction; Step 6: Traverse each subsystem of the 3D model and repeat steps 4 to 5 to generate a texture map of the exposed surface of each subsystem; Step 7: Repeat steps 2 to 6 to complete multiple cycles, superimpose the drawn texture content, and generate the complete surface distribution of each subsystem; Step 8: Add up the areas of the triangular patches on the subsystem surfaces, remove the blocked parts according to the texture generated in step 7, and obtain the exposed surface area of ​​each subsystem.

2. The OpenGL-based multi-system three-dimensional model surface area calculation method according to claim 1, characterized in that: Step 1 also includes: Constructing multi-system 3D models including vertex coordinates, UV coordinates, normal vector coordinates, and face information; Assemble all the points into a triangle primitive shape using GL_TRIANGLES, and then create a fragment shader for rendering the triangle.

3. The OpenGL-based multi-system three-dimensional model surface area calculation method according to claim 1, characterized in that: Step 2 also includes: using theta=pi*t(rd) function to generate a radian value with a domain of (0,2π) so that the generated random value covers the full angle.

4. The OpenGL-based multi-system three-dimensional model surface area calculation method according to claim 1, characterized in that: Step three also includes: using the glm::min / glm::max comparison method to traverse all vertex coordinates of the target subsystem.

5. The OpenGL-based multi-system three-dimensional model surface area calculation method according to claim 1, characterized in that: Step 4 also includes: multiplying the model matrix, observation matrix, and projection matrix in the order of projection matrix*observation matrix*model matrix, and passing them into the shader.

6. The OpenGL-based multi-system three-dimensional model surface area calculation method according to claim 1, characterized in that: Step 5 also includes: Use a monochrome texture with a width and height set to 2048.

7. The OpenGL-based multi-system three-dimensional model surface area calculation method according to claim 1, characterized in that: Step seven also includes: setting the number of cycles to 1000 times.

8. The OpenGL-based multi-system three-dimensional model surface area calculation method according to claim 1, characterized in that: Step eight also includes: extracting the coordinate values ​​of the vertices of the triangle of the target subsystem and using the partial derivative dFdxFine / dFdyFine to obtain the cross product to obtain the normal vector of the triangle patch.

Citation Information

Patent Citations

  • Method and device for face three-dimensional model texture blending

    CN107945267A

  • 3D object modeling method based on depth sensor

    CN109087388A