A method for flattening and extracting surface patterns of 3D models based on rendering sampling

By building a sampling grid and rendering and sampling, the problem of flattening and extraction of surface patterns of three-dimensional models is solved, and two-dimensional picture files are output. It is suitable for a variety of three-dimensional models, with good versatility and cross-platform applicability.

CN114494001BActive Publication Date: 2025-07-18BEIJING UNIV OF POSTS & TELECOMM +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210105754.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2025-07-18
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

There is a lack of effective methods in the prior art to extract the surface pattern of the three-dimensional model and flatten it into a two-dimensional picture, which is not very adaptable.

Method used

By constructing a sampling grid, rendering and sampling the surface of the three-dimensional model, calculating the rendered color value, and using a two-dimensional array to organize and image encoding output to a two-dimensional image file.

Benefits of technology

The flattening extraction of the surface pattern of the three-dimensional model is realized, and the output results retain the pattern shape and proportion of the pattern. It is suitable for a variety of three-dimensional models and has cross-platform compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494001B_ABST
    Figure CN114494001B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for flattening and extracting surface patterns of a 3D model based on rendering sampling. The method comprises the following steps: S1. For the surface area of the 3D model that needs to be flattened and extracted for patterns, a sampling grid is constructed under the operation of a specific method; S2. Rendering sampling is performed on the constructed sampling grid, and the rendering color value of the rendering sampling is calculated; S3. A two-dimensional array is used to organize and temporarily store the rendering color values; S4. Image encoding is performed on the organized and temporarily stored rendering color values, and a two-dimensional picture file is output and saved. The method for flattening and extracting surface patterns of a 3D model in the present invention completes the entire process of flattening and extracting surface patterns of a 3D model, and obtains the two-dimensional picture output result of the surface area for pattern flattening and extraction. The method is compatible with 3D models from various sources, has good versatility, does not rely on private algorithms of any specific platform, and is suitable for cross-platform use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer graphics, and more specifically, to a method for flattening and extracting surface patterns of a three-dimensional model based on rendering sampling. Background Art

[0002] A three-dimensional model is a polygonal representation of an object, usually displayed using a computer or other video device. The object displayed can be a real-world entity or a fictional object. Anything that exists in the physical nature can be represented by a three-dimensional model.

[0003] In actual applications, three-dimensional models are often used to display multiple perspectives to users. Users can perform translation, rotation, and scaling operations on the three-dimensional model to observe specific details of interest. The above display method focuses more on the shape of the three-dimensional model. However, in addition to the shape, there are also a large number of patterns on the surface of the three-dimensional model. Depending on the generation method of the three-dimensional model, some patterns are the result of scanning and reconstructing real objects, some are completely manually made, or a combination of the two.

[0004] Regardless of the generation method of the three-dimensional model, a considerable part of the surface patterns are directly drawn on its surface when creating the three-dimensional model or the actual object corresponding to the three-dimensional model, and there is no separate and complete two-dimensional picture copy of the surface pattern. These surface patterns also have specific values, which is particularly evident in three-dimensional models obtained by scanning and reconstructing physical cultural relics. These patterns often only appear on the surface of cultural relics but contain important cultural symbols such as patterns and colors. Extracting them and making them exist independently in the two-dimensional space from the three-dimensional model of the cultural relic can serve as new materials to feed back related cultural relic research work or cultural and creative industries and provide new data sources for them.

[0005] Currently, although background technologies such as rendering, sampling, and generation in the fields of digital image processing, computer graphics, and computer vision are relatively complete, there is a lack of methods for flattening and extracting surface patterns of three-dimensional models, and the adaptability is not strong.

[0006] No effective solution has been proposed for the problems in the related technologies. Summary of the Invention

[0007] In view of the problems in the related technologies, the present invention proposes a method for flattening and extracting surface patterns of a three-dimensional model based on rendering sampling to overcome the above-mentioned technical problems existing in the existing related technologies.

[0008] To this end, the specific technical solution adopted by the present invention is as follows:

[0009] A method for flattening and extracting surface patterns of a 3D model based on rendering sampling, the method comprising the following steps:

[0010] S1. For the surface area of the 3D model that needs to be flattened and extracted for patterns, construct a sampling grid under the operation of a specific method;

[0011] S2. Perform rendering sampling on the constructed sampling grid and calculate the rendering color value of the rendering sampling;

[0012] S3. Organize and temporarily store the rendering color values using a two-dimensional array;

[0013] S4. Perform image encoding on the organized and temporarily stored rendering color values, output a two-dimensional picture file and save it.

[0014] Further, the surface area is approximately regarded as a curved surface formed by a spline line after a series of translations and rotations.

[0015] Further, the specific method for constructing the sampling grid includes the following steps: Determine the number of spline lines and the number of samplings according to the length of the spline line compared with the path of the formed curved surface, and construct the sampling grid.

[0016] Further, the 3D model is a 3D model of a solid of revolution.

[0017] Further, the spline line and the path of the spline line used for constructing the sampling grid are manually set according to the actual 3D model and the surface area that needs to be flattened and extracted for patterns.

[0018] Further, performing rendering sampling on the constructed sampling grid and calculating the rendering color value of the rendering sampling further includes the following steps:

[0019] S21. Calculate the normal vector towards the 3D model at each grid point in the sampling grid according to the spline line;

[0020] S22. At each grid point, use the normal vector to locate the sampling point of the 3D model;

[0021] S23. Obtain the material information and UV coordinate information of the sampling point.

[0022] S24. Use the material information and UV coordinate information to obtain the rendering color value of this point.

[0023] Further, using the material information and UV coordinate information to obtain the rendering color value of this point further includes the following steps:

[0024] S241. Obtain the diffuse texture map of this material according to the material information;

[0025] S242. Calculate the pixel point corresponding to the UV coordinate on the diffuse texture according to the UV coordinate information and the resolution of the diffuse texture, and obtain the rendering color value of this point.

[0026] Further, the resolution formula of the two-dimensional picture is as follows:

[0027] w*h = 2πr:l;

[0028] Wherein, r is the average value of the distances from each sampling point on the spline to its rotation axis, and l is the length of the spline.

[0029] Further, the obtaining of the material information and UV coordinate information at the sampling point further includes the following steps:

[0030] S231. Use ray detection technology to locate the sampling point of the three-dimensional model and obtain the material information and UV coordinate information at this point.

[0031] Further, the ray detection technology includes initiating ray detection with each sampling grid point as the ray starting point and the normal vector towards the three-dimensional model at this grid point as the ray direction;

[0032] If the three-dimensional model is hit, the hit point is the sampling point, and the material information and UV coordinate information at this point are provided;

[0033] If the three-dimensional model is not hit, use a pre-set fixed color value to replace the result of the rendering sampling.

[0034] The beneficial effects of the present invention are as follows: The present invention constructs a sampling grid for the surface area in the three-dimensional model that needs to be flattened and extracted for patterns, and performs rendering sampling according to the constructed sampling grid. The color values obtained from the rendering sampling at each sampling grid point are organized and output as a two-dimensional picture file in image encoding for storage, thereby realizing the entire process of flattening and extracting the patterns on the surface of the three-dimensional model, and obtaining the two-dimensional picture output result of the surface area for pattern flattening and extraction. The output result of this method basically retains the shape and proportion of the patterns on this surface area, and the method is compatible with three-dimensional models from various sources, has good versatility, does not rely on private algorithms of any specific platform, and is suitable for cross-platform use. Description of the Drawings

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.

[0036] Figure 1It is a flowchart of a method for flattening and extracting surface patterns of a 3D model based on rendering sampling according to an embodiment of the present invention;

[0037] Figure 2 It is a schematic structural diagram of a 3D model adopted in a method for flattening and extracting surface patterns of a 3D model based on rendering sampling according to an embodiment of the present invention;

[0038] Figure 3 It is a schematic diagram of ray detection at a certain sampling point in a method for flattening and extracting surface patterns of a 3D model based on rendering sampling according to an embodiment of the present invention. Detailed implementation manners

[0039] To further illustrate each embodiment, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, mainly used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operating principle of the embodiments. With reference to these contents, those of ordinary skill in the art should be able to understand other possible implementation manners and the advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are usually used to represent similar components.

[0040] According to an embodiment of the present invention, a method for flattening and extracting surface patterns of a 3D model based on rendering sampling is provided.

[0041] Now, the present invention will be further described in conjunction with the accompanying drawings and specific implementation manners. As Figure 1 shown, the method for flattening and extracting surface patterns of a 3D model based on rendering sampling according to an embodiment of the present invention includes the following steps:

[0042] S1. For the surface area of the 3D model that needs to be flattened and extracted for patterns, under the operation of a specific method, a sampling grid is constructed;

[0043] S2. Rendering sampling is performed on the constructed sampling grid, and the rendering color value of the rendering sampling is calculated;

[0044] S3. The rendering color values are organized and temporarily stored using a two-dimensional array;

[0045] S4. Image encoding is performed on the organized and temporarily stored rendering color values, and a two-dimensional picture file is output and saved.

[0046] In specific applications, the organization and temporary storage are explained as follows: Organization: During sampling, a convenient approach in the program is to sample point by point along each spline (after sampling all the points on a spline in the sampling grid, then proceeding to the next one). The order of the color values obtained in this way is column-major (obtained column by column), while generally, image encoding and output to a file require row-major (stored row by row). Therefore, "organization" mainly involves converting the column-major storage to row-major storage; Temporary storage: Since the method processes points "progressively", when not all sampling points have been completely processed, the rendered color values obtained at the sampling grid points (i.e., those obtained in step S2) are stored in a two-dimensional array.

[0047] In one embodiment, the surface area is approximately regarded as a surface that can be formed by a series of translations and rotations of a spline.

[0048] In specific applications, the surface area where pattern flattening extraction is required can be approximately replaced by a surface formed by rotating a spline around a certain fixed axis by a certain angle. In a more general and complex case, if the surface area where pattern flattening extraction is required cannot be completely covered by the approximation process of the above surface, it should be divided into multiple approximation processes of the above surface, and each replacement surface constructs a sampling grid separately and performs rendering sampling and output.

[0049] In one embodiment, the specific method of constructing the sampling grid includes the following steps: Determine the number of splines and the number of samplings according to the length of the spline compared with the path of the formed surface, and construct the sampling grid.

[0050] In specific applications, as Figure 2 shown, the surface area where pattern flattening extraction is required is approximately regarded as a surface that can be formed by a series of translations and rotations of a spline in a certain fixed manner; the three-dimensional model used in the invention is a certain bowl-shaped cultural relic, and this three-dimensional model can be regarded as a solid of revolution. The surface area where pattern flattening extraction is required can be approximately regarded as a surface formed by rotating a spline around a certain fixed axis by a certain angle.

[0051] In one embodiment, the three-dimensional model is a three-dimensional model of a solid of revolution.

[0052] In one embodiment, the spline and the path of the spline used for constructing the sampling grid are manually set according to the actual three-dimensional model and the surface area where pattern flattening extraction is required.

[0053] In one embodiment, the steps of rendering and sampling the constructed sampling grid and calculating the rendered color values of the rendering sampling further include the following steps:

[0054] S21. Calculate the normal vector towards the 3D model at each grid point according to the spline in the sampling grid;

[0055] S22. At each grid point, use the normal vector to locate the sampling points of the 3D model;

[0056] S23. Obtain the material information and UV coordinate information of the sampling points;

[0057] S24. Use the material information and UV coordinate information to obtain the rendering color value of this point.

[0058] In specific applications, as Figure 3 shown, in the figure, A represents a certain spline in the sampling grid, B represents the sampling grid points, C represents ray detection, D represents the sampling points. Each grid point in the above sampling grid is on the spline for sampling. Calculate the normal vector towards the 3D model at each grid point according to the spline. At each grid point, use ray detection technology to determine the sampling points on the 3D model and obtain the necessary information at this point. Use each sampling grid point as the ray starting point and the normal vector towards the 3D model at this point as the ray direction to initiate ray detection.

[0059] In one embodiment, the step of using the material information and UV coordinate information to obtain the rendering color value of this point further includes the following steps:

[0060] S241. Obtain the diffuse texture map of this material according to the material information;

[0061] S242. Calculate the pixel point corresponding to this UV coordinate on the diffuse texture map according to the UV coordinate information and the resolution of the diffuse texture map, and obtain the rendering color value of this point.

[0062] In specific applications, the principle is as follows: The UV coordinate is the coordinate value normalized to 0 - 1 in the horizontal and vertical directions of the texture map. It is a two-dimensional vector. Multiplying its two components by the width and height of the texture map respectively can obtain the index values of the corresponding pixel point in the horizontal and vertical directions. In one embodiment, the resolution formula of the two-dimensional picture is as follows:

[0063] w*h = 2πr:l;

[0064] where r is the average value of the distances from each sampling point on the spline to its rotation axis, and l is the length of the spline.

[0065] In one embodiment, the step of obtaining the material information and UV coordinate information of the sampling points further includes the following steps:

[0066] S231. Use ray detection technology to locate the sampling points on the 3D model and obtain the material information and UV coordinate information at this point.

[0067] In one embodiment, the ray detection technique includes initiating ray detection with each sampling grid point as the ray starting point and the normal vector of the grid point towards the three-dimensional model as the ray direction;

[0068] If the three-dimensional model is hit, the hit point is the sampling point, and the material information and UV coordinate information at this point are provided;

[0069] If the three-dimensional model is not hit, a preset fixed color value is used to replace the result of rendering sampling.

[0070] In specific applications, Unreal Engine is selected as the development engine to implement the rendering, sampling of the three-dimensional model, and the encoding and storage of two-dimensional pictures. In addition to Unreal Engine, Unity can also be selected as the development engine or self-developed and implemented using underlying graphics libraries such as OpenGL, DirectX, and Vulkan.

[0071] To better understand the above technical solution of the present invention, the principle of the method for flattening and extracting the surface pattern of the three-dimensional model in the present invention is described as follows:

[0072] First, the surface area of the three-dimensional model that needs to be flattened and extracted for the pattern is approximately regarded as a curved surface that can be formed by a series of translations and rotations of a spline in a certain determined manner. According to the ratio of the length of the above spline to the length of the path formed by a series of translations and rotations of the spline in the above determined manner, the number of splines for sampling on this path and the number of sampling times for each sampling spline are determined, so as to form a sampling grid;

[0073] Then, calculate the normal vector of each grid point in the above sampling grid towards the three-dimensional model, combine the position of each grid point to determine the sampling points on the three-dimensional model, obtain the material information and UV coordinate information at the sampling points, and further calculate the rendering color value at this point;

[0074] Finally, use the rendering color values obtained at each sampling point for image encoding and output as a two-dimensional picture file (usually encoded in PNG format) for storage.

[0075] In summary, by means of the above technical solutions of the present invention, the present invention constructs a sampling grid for the surface area of the three-dimensional model that needs to be flattened and extracted for patterns, performs rendering sampling according to the constructed sampling grid, organizes the color values obtained from the rendering sampling at each sampling grid point, and outputs them as a two-dimensional picture file according to image encoding for storage. Thus, the entire process of flattening and extracting the patterns on the surface of the three-dimensional model is realized, and the two-dimensional picture output result of the surface area for pattern flattening and extraction is obtained. The output result of this method basically retains the shape and proportion of the patterns on this surface area, and various sources of three-dimensional models are compatible in the method, with good versatility, not relying on any private algorithms of specific platforms, and being suitable for cross-platform use.

[0076] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for flattening and extracting surface patterns of a 3D model based on rendering sampling, characterized in that The method includes the following steps: S1. For the surface area in the 3D model that needs to be flattened and extracted for patterns, a sampling grid is constructed under the operation of a specific method; the surface area is a curved surface formed by a spline line after a series of translations and rotations; the specific method for constructing the sampling grid includes the following steps: Determine the number of spline lines and the number of samplings according to the length of the spline line compared with the path of the formed curved surface, and construct the sampling grid; S2. Render and sample the constructed sampling grid, and calculate the rendering color value of the render sampling; including the following steps: S21. Calculate the normal vector towards the 3D model at each grid point in the sampling grid according to the spline line; S22. At each grid point, use the normal vector to locate the sampling point of the 3D model; S23. Obtain the material information and UV coordinate information of the sampling point; S24. Use the material information and UV coordinate information to obtain the rendering color value of this point; S3. Organize and temporarily store the rendering color values using a two-dimensional array; S4. Perform image encoding on the organized and temporarily stored rendering color values, output a two-dimensional picture file and save it.

2. The method for flattening and extracting a surface pattern of a three-dimensional model based on rendering sampling according to claim 1, wherein The 3D model is a 3D model of a solid of revolution.

3. A method for flattening and extracting surface patterns of a 3D model based on rendering sampling according to claim 1, characterized in that, The spline line used for constructing the sampling grid and the path of the spline line are manually set according to the actual 3D model and the surface area that needs to be flattened and extracted for patterns.

4. A method for flattening and extracting surface patterns of a 3D model based on rendering sampling according to claim 1, characterized in that, The step of using the material information and UV coordinate information to obtain the rendering color value of this point further includes the following steps: S241. Obtain the diffuse texture map of this material according to the material information; S242. Calculate the pixel point corresponding to this UV coordinate on the diffuse texture map according to the UV coordinate information and the resolution of the diffuse texture map, and obtain the rendering color value of this point.

5. The three-dimensional model surface pattern flattening extraction method based on rendering sampling according to claim 4, characterized in that The resolution formula of the two-dimensional picture is as follows: W*h = 2 π r: l where r is the average value of the distances from each sampling point on the spline curve to its rotation axis, l and l is the length of the spline curve.

6. A method for flattening and extracting surface patterns of a 3D model based on rendering sampling according to claim 1, characterized in that The step of obtaining the material information and UV coordinate information at the sampling point further includes the following steps: S231. Use ray detection technology to locate the sampling point of the 3D model and obtain the material information and UV coordinate information at this point.

7. A method for flattening and extracting surface patterns of a 3D model based on rendering sampling according to claim 6, characterized in that, The ray detection technology includes initiating ray detection with each sampling grid point as the ray starting point and the normal vector towards the 3D model at this grid point as the ray direction; If the 3D model is hit, the hit point is the sampling point, and the material information and UV coordinate information at this point are provided; If the 3D model is not hit, use a pre-set fixed color value to replace the result of the render sampling.

Citation Information

Patent Citations

  • Method and system for texturing of 3D model in 2d environment

    US20090153577A1

  • Texture mapping system and method

    WO2018151612A1