Three-dimensional surface generation method, device, program product, and medium in geometric engine
By generating an elevation matrix and matching pixel points to three-dimensional space, and combining curve calculations to build a three-dimensional surface in the geometry engine, the inaccuracy problem of the geometry engine when creating a three-dimensional surface is solved, and accurate three-dimensional surface construction is achieved.
Patent Information
- Application Number
- CN202411349438.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-09-26
AI Technical Summary
Geometry engines are inaccurate and difficult when creating a three-dimensional surface of a planar geometric shape. This is mainly because the elevation information of pixel points depends on standardized data, so the surface can only be modeled based on the elevation information of scattered pixel points.
By generating an elevation matrix, we describe the elevation of pixel points in the picture, match the pixel points to three-dimensional space in the picture, obtain the three-dimensional spatial point matrix, and obtain the curve set through curve calculation, and finally build a three-dimensional surface in the three-dimensional space of the geometry engine.
It realizes the precise construction of two-dimensional surface graphics, solves the inaccuracy problem of geometry engines when creating three-dimensional surfaces, supports the creation of continuous three-dimensional surfaces in the geometry engine, and enhances the accuracy of three-dimensional modeling.
Smart Images

Figure CN118864234B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of three-dimensional modeling of geometric figures, and in particular to a three-dimensional surface generation method in a geometric engine, a computer device and a computer program product, and a computer-readable storage medium. Background Art
[0002] The geometry engine uses points, lines, surfaces, and bodies as the basis of geometric objects to implement 3D modeling and thus realize the creation of various 3D models. In the 3D modeling implemented by the geometry engine on plane geometric figures, the surface of the plane geometric figures often needs to rely on the elevation information of the pixel points in the surface. Based on the elevation information, the geometry engine constructs the corresponding 3D surface on the surface of the plane geometric figures.
[0003] However, since the elevation information of pixels depends on standardized data, such as only configuring elevation information for pixels of a specific color, the surface of plane geometric figures can only be three-dimensionally modeled based on the elevation information of scattered pixels, which is neither accurate nor easy to create corresponding three-dimensional surfaces in the geometry engine. Summary of the invention
[0004] One purpose of the present application is to solve the technical problem that it is inaccurate and difficult for a geometry engine to create three-dimensional surfaces from the surfaces of planar geometric figures, and to support the construction of three-dimensional surfaces involved in the creation of three-dimensional models by the geometry engine.
[0005] According to one aspect of an embodiment of the present application, a method for generating a three-dimensional surface in a geometry engine is disclosed, the method comprising:
[0006] Generate an elevation matrix of a picture imported by a geometry engine, wherein the elevation matrix describes the elevation of pixels in the picture, wherein the picture includes a two-dimensional surface graphic;
[0007] Matching pixels in the image to three-dimensional space through an elevation matrix to obtain a three-dimensional space point matrix, where the three-dimensional space is provided by the geometry engine;
[0008] Performing curve calculation on the three-dimensional space point matrix to obtain a curve set in the three-dimensional space;
[0009] The three-dimensional surface of the two-dimensional surface figure in the picture is obtained by constructing the curve set in the three-dimensional space of the geometry engine.
[0010] According to one aspect of an embodiment of the present application, generating an elevation matrix of a picture imported by a geometry engine includes:
[0011] Obtaining a preconfigured color set and elevation set for the image imported by the geometry engine, wherein the elements between the color set and the elevation set constitute an elevation pair, and the elevation in the elevation set represents the elevation of the corresponding color information in the color set;
[0012] Constructing a two-dimensional element set consisting of a one-dimensional color mapping value and a corresponding elevation through the color information to the elevation pair;
[0013] Drawing a color-elevation conversion curve in a two-dimensional coordinate space constructed by one-dimensional mapping values of elevation and color through the two-dimensional element set;
[0014] An elevation matrix is generated for the pixels in the image using the color-to-elevation conversion curve.
[0015] According to one aspect of an embodiment of the present application, constructing a two-dimensional element set consisting of a one-dimensional color mapping value and a corresponding elevation through the color information to the elevation pair includes:
[0016] Projecting the color information in the color set into a one-dimensional space to obtain a one-dimensional color mapping value corresponding to the color information;
[0017] A two-dimensional element set is constructed by taking the one-dimensional color mapping value and the elevation corresponding to the color information in the elevation set as objects.
[0018] According to one aspect of an embodiment of the present application, drawing a color-elevation conversion curve in a two-dimensional coordinate space constructed by one-dimensional mapping values of elevation and color through the two-dimensional element set includes:
[0019] Reduce the domain of the one-dimensional mapping value of the color in the two-dimensional element set to generate a reduced value that conforms to the specified domain;
[0020] Taking the objects in the two-dimensional element set as passing points, a two-dimensional coordinate space fitting curve constructed by the one-dimensional mapping values of elevation and color under the control of the reduction value is obtained to obtain a color elevation conversion curve.
[0021] According to one aspect of an embodiment of the present application, matching pixels in a picture to a three-dimensional space through an elevation matrix to obtain a three-dimensional space point matrix includes:
[0022] Sampling the elevation matrix to obtain a sampling matrix corresponding to the elevation of the described surface in the picture;
[0023] The sampling matrix is matched with coordinates of the three-dimensional space to obtain a three-dimensional space point matrix.
[0024] According to one aspect of an embodiment of the present application, the step of performing curve calculation on the three-dimensional space point matrix to obtain a set of curves in the three-dimensional space includes:
[0025] Facing the row set in the three-dimensional space point matrix, curve calculation is performed on the three-dimensional point array contained in the row set, and the calculated curves constitute the curve set in the three-dimensional space.
[0026] According to one aspect of an embodiment of the present application, the step of constructing a three-dimensional surface of a two-dimensional surface graphic in the picture by using the curve set in the three-dimensional space of the geometry engine includes:
[0027] Obtain the control points and weights of the curves for the curve set, and obtain the control point column vector and the related weight column vector of the curve.
[0028] Combining the control point column vectors of all curves in the curve set to form a control point matrix, and the related weight column vectors to form a weight matrix corresponding to the control point matrix;
[0029] A three-dimensional surface is constructed in the three-dimensional space of the geometry engine according to the control point matrix and the weight matrix of the curve set.
[0030] According to one aspect of an embodiment of the present application, a computer device is disclosed, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0031] According to one aspect of an embodiment of the present application, a computer program product is disclosed, including a computer program, wherein when the computer program is executed by a processor, the steps of any of the methods described above are implemented.
[0032] According to one aspect of an embodiment of the present application, a computer-readable storage medium is disclosed, on which a computer program is stored, and when the program is executed by a processor, the steps of any of the methods described above are implemented.
[0033] In an embodiment of the present application, for the two-dimensional surface graphics of the picture imported into the geometry engine, only the color information of a few discrete pixels has corresponding elevation information. For this purpose, an elevation matrix is first generated for the picture imported by the geometry engine. The picture contains a two-dimensional surface. The generated elevation matrix is used to describe the elevation of the pixels in the two-dimensional surface contained in the picture. Then, the elevation matrix is used to match the pixels in the picture to the three-dimensional space to obtain a three-dimensional space point matrix of the pixels described by the elevation matrix in the three-dimensional space, so that the pixels described by the elevation matrix can be matched to the three-dimensional space. Then, curve calculation can be performed in the three-dimensional space based on the three-dimensional space point matrix to obtain a series of curves in the three-dimensional space to form a curve set. Finally, the three-dimensional surface of the two-dimensional surface graphics in the picture is constructed in the three-dimensional space through the curve set, which realizes the continuous processing of the elevation information between each pixel point, and then constructs a continuous three-dimensional surface. Under the function of the geometry engine to create a three-dimensional surface for the surface of a plane geometric figure, the accurate construction of the three-dimensional surface corresponding to the two-dimensional surface graphics can be realized, supporting the construction of the three-dimensional surface involved in the geometry engine to create a three-dimensional model.
[0034] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0035] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0037] Figure 1 A flow chart of a method for generating a three-dimensional surface in a geometry engine according to an embodiment of the present application is shown.
[0038] Figure 2 is based on Figure 1 The corresponding embodiment shows a flow chart of a method for matching pixel points in a picture to three-dimensional space through an elevation matrix to obtain a three-dimensional space point matrix.
[0039] Figure 3 is based on Figure 1 The corresponding embodiment shows a method flow chart describing the steps of constructing a three-dimensional surface in the three-dimensional space of a geometry engine through a set of curves.
[0040] Figure 4 is based on Figure 1 A flowchart of a method for describing the steps of generating an elevation matrix of a picture imported by a geometry engine is shown in the corresponding embodiment.
[0041] Figure 5 is based on Figure 4 The corresponding embodiment is a method flow chart of the steps of constructing a two-dimensional element set consisting of a one-dimensional color mapping value and a corresponding elevation through an elevation pair from color information to elevation.
[0042] Figure 6 FIG. 4 is a schematic diagram showing the distribution of RGBN obtained by conversion on a one-dimensional axis according to an exemplary embodiment.
[0043] Figure 7 yes Figure 6 A schematic diagram of a color elevation conversion curve shown in the corresponding embodiment.
[0044] Figure 8 is based on Figure 4 A flowchart of a method for drawing a color-elevation conversion curve in a two-dimensional coordinate space constructed by one-dimensional mapping values of elevation and color through a two-dimensional element set in a corresponding embodiment. DETAILED DESCRIPTION
[0045] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0046] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.
[0047] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0048] On the one hand, the embodiments of the present application are used to realize the surface generation on the three-dimensional model in the geometry engine, so that the geometry engine is no longer unable to accurately generate the three-dimensional surface due to the lack of elevation information during the three-dimensional modeling process.
[0049] For example, the color information of only a small number of pixels has corresponding elevation information, which makes it impossible for the geometry engine to know the elevation of the pixels corresponding to other color information in the two-dimensional surface graphics. Therefore, the geometry engine cannot create a three-dimensional surface by directly performing the mapping of the two-dimensional surface graphics in the three-dimensional space based on the elevation, and it is even more impossible to obtain an accurate three-dimensional surface in the end.
[0050] Through the application of the embodiment of the present application in the geometry engine, the geometry engine can have the ability to accurately and quickly create three-dimensional surfaces, and then accurately and quickly generate three-dimensional surfaces in three-dimensional space, so that the three-dimensional modeling performed can have accurate and continuous three-dimensional surfaces.
[0051] With the enhancement of the 3D surface generation capability in the geometry engine, it will be possible to accurately construct continuous 3D surfaces, such as 3D surface terrain, for the realization of GIS (Geographic Information System) systems and 3D game virtual scenes, thus enhancing the model generation capability of GIS systems and 3D game virtual scenes.
[0052] It should be further explained that through the application of the embodiments of the present application in the geometry engine, the geometry engine can accurately construct a continuous three-dimensional surface through a simply drawn two-dimensional picture, and is no longer limited by the discreteness of pixel points. The construction of the model where the three-dimensional surface is located is not limited to the GIS system and the three-dimensional game virtual scene.
[0053] See also Figure 1 , Figure 1 A flow chart of a method for generating a three-dimensional surface in a geometry engine according to an embodiment of the present application is shown. The present application embodiment provides a method for generating a three-dimensional surface in a geometry engine, the method comprising:
[0054] Step S110, generating an elevation matrix of the image imported by the geometry engine, the elevation matrix describing the elevation of the pixels in the image;
[0055] Step S120, matching the pixel points in the image to the three-dimensional space through the elevation matrix to obtain a three-dimensional space point matrix, where the three-dimensional space is provided by the geometry engine;
[0056] Step S130, performing curve calculation on the three-dimensional space point matrix to obtain a curve set in the three-dimensional space;
[0057] Step S140, constructing a three-dimensional surface of the two-dimensional surface figure in the image in the three-dimensional space of the geometry engine through a set of curves.
[0058] These steps are described in detail below.
[0059] First of all, it should be noted that the geometry engine is used to construct a three-dimensional geometry model. Specifically, the geometry engine describes the constructed three-dimensional geometry model through the mathematical function obtained by calculation. For example, the constructed three-dimensional surface is also a visual representation of the function obtained by calculating a series of curves.
[0060] A picture used for three-dimensional modeling is imported into the geometry engine. The picture contains two-dimensional surface graphics. For example, it can be a two-dimensional surface graphics formed by a two-dimensional terrain. Therefore, the three-dimensional surface generation implemented in the geometry engine in the embodiment of the present application will generate a continuous three-dimensional surface terrain.
[0061] In step S110, an elevation matrix is generated for the image containing the two-dimensional surface graphics imported into the geometry engine. The generated elevation matrix corresponds to the pixels in the image to describe the elevation of each pixel.
[0062] In an exemplary embodiment, the image used to generate the three-dimensional surface, that is, the image containing the two-dimensional surface graphics, can be in the form of a pixel grid map, so as to obtain the pixel matrix of the image, and then generate the elevation matrix of the image based on the pixel matrix. Therefore, it should be understood that for the image imported by the geometry engine, each pixel point is traversed and converted into a corresponding block to form a pixel grid map, and then the pixel matrix of the image can be obtained on this basis.
[0063] The pixel matrix describes the pixel points distributed in the image, and each pixel point will also exist in the form of color information. Exemplarily, the color information is RGB information. Correspondingly, the RGB information is used to construct m OK n Column pixel matrix P ,Right now:
[0064]
[0065] in, , R denotes the field of real numbers, and the superscript 3 denotes the dimension of the vector space.
[0066] The elevation matrix is generated for the pixel matrix of the image, and each element in the generated elevation matrix corresponds to the color information of the corresponding pixel in the pixel matrix.
[0067] As mentioned above, the elevation matrix is generated based on the matching relationship between the color information and elevation of the discrete pixel points corresponding to the pixel points distributed in the image. It should be understood that for a pixel point in the image, it has color information and elevation information, so its elevation can be obtained according to the color information of the discrete pixel points in the image. The color information and the elevation constitute an elevation pair, that is, the matching relationship between the color information and the elevation.
[0068] The color-elevation conversion curve is calculated based on the color information of discrete pixel points and the corresponding elevation, so as to implement continuous processing on discrete pixel points. For pixel points with unknown elevation, their elevation can also be determined by calculating the color-elevation conversion curve, and finally the elevation matrix of the pixel points in the image can be obtained.
[0069] The color-elevation conversion curve defines the functional relationship between color information and elevation. Therefore, the color-elevation conversion curve can be used to convert the color information of pixels in the image to elevation, and then accurately determine the elevation of the pixels, and finally accurately obtain the elevation distribution corresponding to the two-dimensional surface graphics.
[0070] Apply the color-elevation conversion curve to directly generate an elevation matrix for the pixel matrix of the image. As mentioned above, the color-elevation conversion curve describes the functional relationship between color information and elevation. Therefore, the element value corresponding to the pixel in the pixel matrix, that is, the color information, can obtain the corresponding elevation under the functional relationship determined by the color-elevation conversion curve. This elevation is the elevation of the three-dimensional surface where the pixel is located.
[0071] Under the action of the color-elevation conversion curve, the elevation of several pixel points distributed in the image can be obtained, so that the corresponding three-dimensional surface generation is no longer limited to a few discrete pixel points, which is conducive to enhancing the accuracy of two-dimensional surface graphics in the image in three-dimensional modeling.
[0072] At this point, it should be understood that several discrete pixel points have corresponding elevations because of their specific color information. The aforementioned color-elevation conversion curve can be calculated based on the matching relationship between the color information and the elevation, and then the matching relationship between the specific color information and the elevation can be adapted to accurately obtain the corresponding elevations for other color information under the action of the color-elevation conversion curve. Similarly, an elevation matrix will be generated for the pixel matrix of the entire image to accurately locate the three-dimensional surface for the two-dimensional surface graphics of the image.
[0073] Further explained, the color-elevation conversion curve is calculated based on the matching relationship between specific color information and elevation, which is a function calculation process for accurately determining the elevation of the mapping of known specific color information and unknown color information based on the matching relationship. Exemplarily, the color-elevation conversion curve is obtained under the limitation of the obtained color one-dimensional mapping value and the elevation by the projection of the known specific color information in one-dimensional space and the matched elevation.
[0074] Specifically, the known specific color information is projected into a one-dimensional space to obtain a one-dimensional color mapping value, and then a two-dimensional element set is constructed with the one-dimensional color mapping value and the elevation under the matching relationship as the object. The color elevation conversion curve that limits the functional relationship between the elevation and color information is obtained by operating the constructed two-dimensional element set in two dimensions of elevation and one-dimensional color mapping value.
[0075] During the execution of step S110, the color information of the pixel points in the image is converted into a corresponding elevation matrix through color-elevation conversion curve calculation, so that the elevation of the distributed pixel points can be described for the two-dimensional surface graphics in the image, laying the foundation for accurately locating the elevation of the two-dimensional surface graphics in three-dimensional space.
[0076] In step S120, each pixel point in the image is matched to the three-dimensional space based on the elevation matrix to obtain a three-dimensional space point matrix, that is, the three-dimensional space point matrix of the pixel point matrix as described above.
[0077] The image corresponds to a certain range, that is, the content in the image, such as various graphics, has a specific location. For example, the image can be a terrain image, which is obtained by shooting the real terrain. Therefore, the image corresponds to a piece of terrain distributed in reality. Each pixel on it has a corresponding geographical location, and the pixel will be matched to the three-dimensional space constructed by the geometry engine based on the geographical location, and the corresponding three-dimensional model will be created in the three-dimensional space adapted to the real environment.
[0078] For images containing two-dimensional surface graphics, the corresponding specific range has a corresponding size, that is, the corresponding length, width and center point, so this will be used as a basis for matching the pixels in the image to the three-dimensional space.
[0079] So far, we still take the terrain image as an example. The terrain covered by the terrain image is the range referred to. Correspondingly, the length of the terrain L ,width W and the topographic center The size of the corresponding specific range is limited, and the pixel point will be matched to the three-dimensional space based on this to locate the three-dimensional coordinates of the three-dimensional space point ;
[0080] Among them, each three-dimensional coordinate matched in the three-dimensional space The definition is as follows:
[0081]
[0082]
[0083]
[0084] It is the input of pixel matching to three-dimensional space. For example, Represents the elevation of the pixel point. Obtained by the elevation matrix, in an exemplary embodiment, Can be obtained directly from the elevation matrix. In addition, It can also be obtained by sampling the elevation matrix to greatly reduce the amount of calculation.
[0085] , and Is the center point of the terrain ,Right now , three-dimensional coordinates middle, Corresponds to elevation.
[0086] To further explain, the matching of pixel points in the image to the three-dimensional space through the elevation matrix in step S120 is an execution process based on the elevation matrix to implement positioning in the three-dimensional space for the construction of the three-dimensional surface, which can be accurately achieved through the size of the coverage range corresponding to the image and the elevation matrix.
[0087] Under the effect of the elevation matrix, in an exemplary embodiment, the elevation matrix is first sampled, and then the sampled coordinates are matched in three-dimensional space to obtain corresponding three-dimensional coordinates, thereby forming a three-dimensional space point matrix.
[0088] Exemplarily, the sampling of the elevation matrix is a process of performing fuzzy operations on the elevation matrix to obtain a sampling matrix, thereby avoiding high computational complexity. Compared with precise sampling, the sampling under fuzzy operations can effectively avoid omissions and feature losses under precise sampling.
[0089] Furthermore, the sampling achieved by the fuzzy operation on the elevation matrix is obtained by weighted averaging the elevation matrix based on the probability density function. The elevation matrix is sampled with a set radius and probability density function, and then the sampled results are weighted averaged to obtain a sampling matrix of the elevation matrix.
[0090] After the sampling matrix is obtained, the sampling matrix is matched with the coordinates of the pixels in the three-dimensional space, and the obtained three-dimensional coordinates form a three-dimensional space point matrix.
[0091] For example, Figure 2 according to Figure 1 The corresponding embodiment shows a flow chart of a method for matching pixel points in a picture to three-dimensional space through an elevation matrix to obtain a three-dimensional space point matrix.
[0092] In an exemplary embodiment, step S120 of matching pixels in the image to three-dimensional space through an elevation matrix to obtain a three-dimensional space point matrix includes:
[0093] Step S121, sampling the elevation matrix to obtain a sampling matrix corresponding to the elevation of the described surface in the picture;
[0094] Step S122, matching the sampling matrix with the coordinates of the three-dimensional space to obtain a three-dimensional space point matrix.
[0095] The following describes these two steps in detail.
[0096] In step S121, as mentioned above, the elevation matrix corresponds to the distributed pixels of the image. Therefore, it is necessary to reduce the amount of data used for calculation by sampling in the elevation matrix, thereby greatly reducing the amount of calculation, and also smoothing the elevation matrix to reduce noise and retain useful structures.
[0097] The elevation matrix is sampled according to the number of sampling points, and the sampling operations performed include but are not limited to the fuzzy operations mentioned above. Wherein, adapted to the elevation matrix, the number of sampling points corresponds to m Line and n The sampling points of the columns are used to control the sampling process and the row and column values of the output sampling matrix.
[0098] For example, the height matrix is sampled using a simple Gaussian sampling function is implemented under control and by a Gaussian sampling function Get the required sampling result, that is, the sampling matrix .
[0099] Gaussian sampling function , A Any row or column of the input is greater than or equal to The elevation matrix of , The obtained sampling matrices are The row and column values of .
[0100] The resulting sampling matrix As shown in the following formula:
[0101]
[0102] in, k is the sampling radius, for example, its value can be set to 3; is the probability density function of the normal distribution; the input elevation matrix A is also controlled by the parameter under the control of the probability density function and parameters Constrained sampling; illustrative, parameters Corresponding to the row vector of the matrix, the parameters Then corresponding to the column vector of the matrix, the values of the two parameter operations are in the same direction, that is, they both take integers upward or downward.
[0103]
[0104] parameter and parameters Take the upper value or the lower value.
[0105] Therefore, substitute the elevation matrix into the Gaussian sampling function The output sampling matrix can be obtained , and corresponding to the above, the sampling matrix The ranks of are determined by the Gaussian sampling function Input parameters .
[0106] In step S122, the sampling matrix of the acquired elevation is , match the pixels in the image to the three-dimensional space and obtain the sampling matrix of the elevation Mapped to the coordinates of each pixel in three-dimensional space.
[0107] Therefore, the pixel points of the picture containing the two-dimensional surface graphics are mapped to the three-dimensional space after the generation of the elevation matrix and sampling of the elevation matrix, so as to obtain the three-dimensional space points that can accurately represent the elevation, and then form a three-dimensional space point matrix.
[0108] For example, the size of the image corresponding to the range is obtained, that is, the length and width ,center ,in, , ; Based on the obtained size, the obtained sampling matrix Match the pixel points in the image to the three-dimensional space to obtain the three-dimensional coordinates of several three-dimensional space points, forming a three-dimensional space point matrix.
[0109] The matching of pixels in the image to the three-dimensional space can be based on the corresponding size and elevation conversion. Therefore, after obtaining the size of the corresponding range of the image, the matrix composed of three-dimensional space points is obtained by the following conversion formula, that is, the three-dimensional space point matrix .
[0110]
[0111] in:
[0112]
[0113]
[0114]
[0115] So far, is the sampling matrix i Line j The elements of the column, are the row and column values of the sampling matrix respectively, It is the center point of the range corresponding to the image.
[0116] Therefore, the sampling matrix obtained in step S121 is pass The result is a three-dimensional space point matrix .
[0117] With the execution of step S120, the geometry engine matches the pixels in the image to the three-dimensional space through the elevation matrix, and can fit a series of curves to the two-dimensional surface graphics in the execution of step S130, thereby accurately providing elevation for the three-dimensional surface generation in the geometry engine.
[0118] It should be pointed out that the elevation used to achieve matching of pixels in an image to three-dimensional space can be represented by an elevation matrix generated for the image, or by a sampling matrix obtained by sampling the elevation matrix, and is not limited here.
[0119] In step S130 , a curve calculation is performed on the three-dimensional space point matrix in the three-dimensional space provided by the geometry engine to obtain a plurality of curves, and the obtained plurality of curves constitute a curve set for generating a three-dimensional surface.
[0120] As mentioned above, by matching the distributed pixels of the image to the three-dimensional space, several three-dimensional space points corresponding to the pixels are distributed in the three-dimensional space provided by the geometry engine, and a series of curves will be calculated for all three-dimensional space points.
[0121] Exemplarily, the curve calculation for three-dimensional space points can be performed in order according to the row set composed of row vectors in the three-dimensional space point matrix, or the column set composed of column vectors. Specifically, the curve calculation is performed on the three-dimensional point array contained in the row set or column set for the row set or column set in the three-dimensional space point matrix, and the calculated curves constitute the curve set in the three-dimensional space.
[0122] For example, a matrix composed of three-dimensional space points, that is, a three-dimensional space point matrix , extract the row set , by collecting each row The curve is calculated to fit the corresponding curve, and so on to form a curve set.
[0123] The curve calculation can be implemented by a NURBS mapping function and an interpolation function. For example, the NURBS mapping function can be a third-order NURBS mapping function.
[0124] Therefore, in the execution of step S130, curve calculation can be completed by using the NURBS mapping function and the interpolation function for a plurality of row sets or a plurality of column sets.
[0125] To further explain, for each curve calculation, the three-dimensional space points that match the image in the three-dimensional space will be used as control points, that is, the three-dimensional point arrays in the row set and the column set, so as to obtain a number of control points and weights required for the curve calculation as input of the NURBS mapping function, and combine with the interpolation function to obtain the curve mapped by the row set, or the curve mapped by the column set.
[0126] In an exemplary embodiment, the NURBS mapping function is as follows:
[0127]
[0128] in, is the control point, n is the number of control points, is the rational B-spline basis function;
[0129]
[0130] is the weight of the control point, which can be set to 1 by default. is the B-spline basis function, k is the order, for example, in the third-order NURBS mapping function, k The value of is 3.
[0131] The control points provided in rows or columns in the three-dimensional space point matrix are calculated through the NURBS mapping function and fitted with the interpolation function cscvn (points, t). The resulting curve will constitute a three-dimensional surface created for the two-dimensional surface graphics in the picture.
[0132] Interpolation function cscvn(points, t), wherein points is a two-dimensional element set as a passing point, namely, a two-dimensional point set formed by the one-dimensional color mapping value and the elevation obtained by the step S110 operation; the point set t corresponds to the point set of points, and under the action of the two-dimensional element set points and its corresponding point set t, the control points are obtained by the interpolation function cscvn operation, and the three-dimensional surface is obtained by drawing the curve mapped by the row set or the curve mapped by the column set.
[0133] Specifically, points is composed of a two-dimensional element set CP = The object composition in As an element point_i Forming a point set points, corresponding to this, the point set t Elements in t_i is the parameter point in the fitted function curve, that is, a set of Corresponds to t_i The point set t, as the parameter point in the function curve fitted to the point set points, will be used to control the node vector. The control is to ensure the consistency of the node vector of the control point, so that the three-dimensional surface can be smoothly fitted and drawn.
[0134] That is to say, the point set t is adapted to the row set or column set used to fit the three-dimensional surface, that is, t_i Corresponding to the elements in the row set or column set, t_i Act on the corresponding elements in the row set or column set to obtain the node vector, ensuring the consistency of the node vector. For example, t_i The default setting is an arithmetic progression from 0 to 1.
[0135] It should be understood that the point set points corresponds to the pixel points and their elevations in the image.
[0136] Parameter Points t_i It can be obtained by calculation in step S110 and directly obtained in the execution of step S130, but it can also be calculated again. t_i The calculation includes: for the pixel point of the three-dimensional space point on the image, its color information is projected into the one-dimensional space, and then the domain is adjusted to obtain the required t value, that is, the pixel parameter point t_i .
[0137] For example, the color information of a pixel is RGB information, that is, According to the formula Convert the color information to a one-dimensional value to obtain a one-dimensional color mapping value .
[0138] Similarly, for color values The corresponding color one-dimensional mapping value is obtained by calculation . Color one-dimensional mapping value is distributed in the interval Therefore, through the formula = For each generate , as input to the interpolation function.
[0139] In step S130, the fitting operation obtains a plurality of curves, and these curves are used to determine a three-dimensional surface in the three-dimensional space, so as to accurately generate a three-dimensional surface of a two-dimensional surface figure in the three-dimensional space.
[0140] In step S140, a three-dimensional surface is constructed by using several curves in the curve set, so as to construct a three-dimensional surface S in the three-dimensional space. The three-dimensional space points distributed on each curve in the curve set correspond to the pixel points on the image, that is, the three-dimensional space points distributed on the curve are the positioning of the pixel points on the image in the three-dimensional space, and include the precise positioning in elevation. On this basis, the continuous processing of the pixel points on the image is realized through the calculated curve, so each curve in the curve set will provide support for the precise construction of the three-dimensional surface.
[0141] For fitting a 3D surface to several curves in the curve set, the surface calculation is performed through the 3D space points corresponding to each curve. Specifically, there are several 3D space points distributed on each curve, so the 3D space points distributed on each curve are obtained to perform surface calculation.
[0142] Exemplarily, the surface calculation is implemented by NURBS surface calculation. Specifically, in the execution of step S130, the control points and weights of each curve in the curve set are obtained one by one based on the distributed three-dimensional space points, so as to construct a control point matrix and a weight matrix, and then the NURBS surface calculation is performed by the constructed control point matrix and weight matrix, and the calculated NURBS surface is the three-dimensional surface constructed for the image in the three-dimensional space.
[0143] In an exemplary embodiment, the NURBS surface is obtained by the following formula:
[0144]
[0145] in, is a point on the NURBS surface, Represents a parameter, and the domain of the parameter is ; is the control point, is the weight of the control point, n is the number of control points; and is the B-spline basis function, p and q is the order.
[0146] See also Figure 3 , Figure 3 is based on Figure 1The corresponding embodiment shows a method flow chart describing the steps of constructing a three-dimensional surface of a two-dimensional surface figure in a picture through a set of curves in the three-dimensional space of a geometry engine.
[0147] The step S140 of obtaining a three-dimensional surface of a two-dimensional surface graphic in a picture by constructing a curve set in the three-dimensional space of a geometry engine provided in an embodiment of the present application includes:
[0148] Step S141, obtaining the control points and weights of the curves from the curve set, and obtaining the control point column vectors and the related weight column vectors of the curves;
[0149] Step S142, combining the control point column vectors of all the curves in the curve set to form a control point matrix, and the related weight column vectors to form a weight matrix corresponding to the control point matrix;
[0150] Step S143, constructing a three-dimensional surface in the three-dimensional space of the geometry engine according to the control point matrix and the weight matrix of the curve set.
[0151] These steps are described in detail below.
[0152] First of all, it should be explained that in order to generate a three-dimensional surface from a set of curves through NURBS surface calculation, it is necessary to obtain corresponding control points and weights corresponding to each control point for calculation.
[0153] After the curves distributed on the surface are generated in step S130 to form a curve set, control points and weights for controlling the generation of the NURBS surface can be obtained based on a series of curves in the curve set.
[0154] In the curve set, control points and weights are obtained for each curve. The control points obtained from a curve will control a column vector, namely, the control point column vector. The weights corresponding to each control point constitute the weight column vector related thereto.
[0155] By analogy, a control point matrix is constructed for the control point column vectors corresponding to all curves, and the weight column vectors corresponding to the control point column vectors form a weight matrix for controlling the NURBS surface calculation.
[0156] It should be understood that obtaining control points for a curve can be an execution process that uses the three-dimensional spatial points distributed on the curve as control points for NURBS surface calculations, thereby reducing the amount of calculations and improving the efficiency of surface generation, while ensuring that the curve and the two-dimensional surface graphics mapped on the image by the three-dimensional spatial points distributed on the curve control the three-dimensional surface in the geometry engine.
[0157] To further illustrate, after obtaining the matrix of three-dimensional space points obtained by transforming the sampling matrix, that is, the three-dimensional space point matrix After that, the three-dimensional space point matrix will be obtained SP The row set , used for third-order NURBS curve calculation, to obtain a third-order NURBS curve , thus forming a set of curves .
[0158] By 3rd order NURBS curve Get the control point column vector , and the weight column vector , so the curve set Combined control point matrix , and the weight matrix .
[0159] At this point, you can perform NURBS surface calculations and generate a three-dimensional surface in three-dimensional space for the two-dimensional surface graphics of the image imported by the geometry engine.
[0160] Therefore, for the generation of three-dimensional surfaces in the geometry engine, it is independent of whether the imported image carries elevation information. When it carries elevation conversion information, the image can be directly converted to obtain a three-dimensional surface corresponding to the elevation indicated by the image. In the absence of elevation conversion information, it is also possible to match partial color information and elevation, calculate the fitting curve to obtain the elevation matched by other color information, and then obtain the elevation matrix of the image to construct a three-dimensional surface.
[0161] This will enable images that lack elevation conversion information to accurately generate the existing surfaces for the constructed model in geometric modeling, and the two-dimensional surface graphics adapted to the image ensure the consistency and continuity of the generated three-dimensional surface.
[0162] Please continue to read Figure 4 , Figure 4 is based on Figure 1 A flowchart of a method for describing the steps of generating an elevation matrix of a picture imported by a geometry engine is shown in the corresponding embodiment.
[0163] The step S110 of generating an elevation matrix of a picture imported by a geometry engine provided in the embodiment of the present application includes:
[0164] Step S111, obtaining a pre-configured color set and elevation set for the image imported by the geometry engine, wherein the elements between the color set and the elevation set constitute an elevation pair, and the middle elevation in the elevation set represents the elevation of the corresponding color information in the color set;
[0165] Step S112, constructing a two-dimensional element set consisting of a one-dimensional color mapping value and a corresponding elevation through an elevation pair from color information to elevation;
[0166] Step S113, drawing a color-elevation conversion curve in a two-dimensional coordinate space constructed by one-dimensional mapping values of elevation and color through a two-dimensional element set;
[0167] Step S114, generating an elevation matrix for the pixels in the image using the color-to-elevation conversion curve.
[0168] These steps are described in detail below.
[0169] In step S111, it should be noted first that a color set and an elevation set corresponding to the color set are configured in advance, so as to define the elevation corresponding to the specific color information.
[0170] In other words, there is a corresponding relationship between the color set and the elevation set, that is, the color information in the color set has a corresponding elevation in the elevation set, and there is a one-to-one corresponding relationship between the color information in the color set and the elevation in the elevation set.
[0171] The color information and elevation set may be pre-configured by the geometry engine or may be configured or modified by the user, which is not limited here.
[0172] It can be understood that the geometry engine and the user can globally configure the color set and the elevation set, so that the imported pictures can generate three-dimensional surfaces using the globally configured color set and elevation set.
[0173] The configured color set and elevation set can also be adapted to a specific picture for personalized customization. In addition, the color set and elevation set can also be configured by the user for a single picture, which are not listed here one by one.
[0174] The elements in the color set are color information, such as GRB information; the elements in the elevation set are elevations. Color information and elevation have a one-to-one correspondence. Therefore, the elements can be combined into elevation pairs between the color set and the elevation set to represent the matching relationship between color information and elevation.
[0175] The elevation in the elevation set represents the elevation of the corresponding color information in the color set, that is, the color set , an element in the color set , With the elements in the elevation collection It is a matching pair, which constitutes a matching relationship between color information and elevation. Based on this, an elevation pair is constructed for the elements in the color set and the elevation set.
[0176] The color information to elevation pair is obtained from the preconfigured color set and elevation set, as mentioned above and Based on this, in step S112, a one-dimensional projection of the color information in the elevation pair is first performed to obtain a one-dimensional color mapping value of the color information in the elevation pair. The one-dimensional color mapping value corresponds to the elevation of the elevation pair. Therefore, a two-dimensional element set is constructed with the one-dimensional color mapping value and the corresponding elevation as elements.
[0177] See also Figure 5 , Figure 5 is based on Figure 4 The corresponding embodiment is a method flow chart of the steps of constructing a two-dimensional element set consisting of a one-dimensional color mapping value and a corresponding elevation through an elevation pair from color information to elevation.
[0178] The step S112 of constructing a two-dimensional element set consisting of a one-dimensional color mapping value and a corresponding elevation through an elevation pair from color information to elevation provided in the embodiment of the present application includes:
[0179] Step S301, projecting color information in a color set into a one-dimensional space to obtain a one-dimensional color mapping value corresponding to the color information;
[0180] Step S302, constructing a two-dimensional element set with the one-dimensional color mapping value and the elevation corresponding to the color information in the elevation set as objects.
[0181] These two steps are explained below.
[0182] As mentioned above, one-dimensional projection of each color information in the color set is performed to obtain a one-dimensional color mapping value.
[0183] For color information in the form of RGB information , perform one-dimensional conversion of color information according to the following formula to obtain the one-dimensional color mapping value ,Right now:
[0184]
[0185] in, That is the one-dimensional conversion formula of RGB information; , ,and These are the components of RGB information.
[0186] In summary, no matter what form of color information, it will be projected into a one-dimensional space to obtain the corresponding color one-dimensional mapping value, which is used to construct a color information to elevation conversion model, that is, to finally obtain the aforementioned color elevation conversion.
[0187] The color information in the color set is converted into a one-dimensional color mapping value. At this time, since the color information has a matching elevation, the one-dimensional color mapping value also corresponds to an elevation, and then the one-dimensional color mapping value and its corresponding elevation can be used as an object to construct a two-dimensional element set.
[0188] Exemplarily, the converted RGBN, ie, the aforementioned one-dimensional color mapping value, may be sorted and then formed into a two-dimensional element set with the corresponding elevation H.
[0189] Specifically, the order referred to is ,when , sorted in order on a one-dimensional axis, and then with the corresponding elevation as another dimensional axis, we get a two-dimensional set of elements with orderly distribution of objects.
[0190] For example, see also Figure 6 , Figure 6 1 is a schematic diagram showing the distribution of RGBN obtained by conversion on a one-dimensional axis according to an exemplary embodiment. The color information in the color set is converted into a new set by performing one-dimensional conversion , and then sort and map to the one-dimensional axis to obtain Figure 6 The color one-dimensional mapping value shown is distributed in one-dimensional data for Figure 7 Plot of the color-elevation conversion curve shown.
[0191] In color collection With elevation collection Color information between With elevation The matching relationship will correspond to the color information One-dimensional mapping of color values to elevation Construct a two-dimensional set of elements for the object, that is, obtain the set , which can be used as the input of the NURBS mapping function to realize the drawing of the color-elevation conversion curve.
[0192] As step S112 is executed, a two-dimensional element set consisting of color one-dimensional mapping values and elevation as objects is obtained. Afterwards, the function mapping relationship between the color one-dimensional mapping value and the elevation is determined by executing step S113 to obtain a color-elevation conversion curve.
[0193] In step S113, the objects in the two-dimensional element set are used as the passing points of the calculated curve to perform curve fitting. At this point, in order to facilitate the calculation, the definition domain of the input one-dimensional color mapping value is reduced to generate parameter points that meet the specified definition domain, and then the objects in the two-dimensional element set are used as the passing points to fit the two-dimensional coordinate space constructed by the elevation and color one-dimensional mapping values under the control of the parameter points.
[0194] For example, the specified domain can be . One-dimensional color mapping value of RGB information In the interval Distribution, one-dimensional mapping value for each color Generate parameter points t_i Make = .
[0195] Two-dimensional element collection The objects that make up the elements in the collection , will be used as the passing point of the calculated curve, and the one-dimensional color mapping value is obtained by combining the NURBS mapping function with the interpolation function. and elevation The curve function relationship between the two, the obtained color elevation conversion curve is as follows Figure 7 As shown, Figure 7 yes Figure 6 A schematic diagram of a color elevation conversion curve shown in the corresponding embodiment.
[0196] Exemplarily, the NURBS mapping function may be a third-order NURBS mapping function, defined as follows:
[0197]
[0198] in, It is the control point of the NURBS mapping function, which is obtained by combining the interpolation function cscvn (points, t), where points is an object in a two-dimensional element set, and t is the parameter point corresponding to points, which is the function curve. C(t_i) The above corresponds to the parameter value of points, n is the number of control points; is the rational B-spline basis function, which is defined as:
[0199]
[0200] is the weight of the control point, is the B-spline basis function, k is the order. For example, you can set k =3, .
[0201] Therefore, we can use the interpolation function cscvn(points, t) to draw the following Figure 7 The cubic NURBS curve shown , which is the color-elevation conversion curve.
[0202] Among them, points is composed of a two-dimensional element set CP = The object composition in As an element point_i Forming a point set points, corresponding to this, the point set t In t_i is the parameter point in the fitted function curve, that is, a set of Corresponds to t_i Point Set t As the parameter points in the function curve fitted to the point set points, they will be used to control the node vectors. The control refers to ensuring the consistency of the node vectors of the control points, so that the color elevation conversion curve can be smoothly fitted and drawn through the node vectors with consistency. For example, the point set t is quantitatively adapted to the node vector, and the point set t Each of t_i Each corresponds to a node vector.
[0203] Exemplarily, the corresponding function curve is obtained by fitting the curve through the control points of the NURBS mapping function C(t_i) = point_i , and then in the two-dimensional element set The constructed two-dimensional parameters are used as passing points, and the color-elevation conversion curve is drawn under the action of the interpolation function cscvn (points, t).
[0204] In obtaining the color elevation conversion curve Then, for the image of the three-dimensional surface, in step S114, its pixel matrix P Substitute into the formula , get a new matrix, the elevation matrix ,in, . This allows the pixel matrix to be P The color information corresponding to each pixel in the image is converted into elevation to generate the elevation matrix of the image.
[0205] In summary, in an exemplary embodiment, see also Figure 8 , Figure 8 is based on Figure 4 A flowchart of a method for drawing a color-elevation conversion curve in a two-dimensional coordinate space constructed by one-dimensional mapping values of elevation and color through a two-dimensional element set in a corresponding embodiment.
[0206] The step S113 of drawing a color-elevation conversion curve in a two-dimensional coordinate space constructed by one-dimensional mapping values of elevation and color by using a two-dimensional element set provided in the embodiment of the present application includes:
[0207] Step S401, reducing the domain of the one-dimensional mapping value of the color in the two-dimensional element set to generate parameter points that meet the specified domain;
[0208] Step S402, taking the objects in the two-dimensional element set as passing points, fitting a two-dimensional coordinate space curve constructed by the one-dimensional mapping values of elevation and color under the control of parameter points to obtain a color-elevation conversion curve.
[0209] Furthermore, the execution process of step S401 includes: generating parameter points that conform to a specified definition domain for all the one-dimensional color mapping values in the two-dimensional element set according to the numerical distribution interval adapted by the one-dimensional color mapping values.
[0210] After obtaining the color-elevation conversion curve mapped in the two-dimensional coordinate space through the execution of step S113, the pixel points distributed in the image, i.e., the aforementioned pixel point matrix, can be generated into an elevation matrix through step S114 under the action of the color-elevation conversion curve.
[0211] In an exemplary embodiment, step S114 includes: converting the color information of the pixel points in the image into elevation information according to the fitted color-elevation conversion curve and the projection relationship in the one-dimensional space, and obtaining an elevation matrix of the pixel points.
[0212] That is to say, for the pixels in the image, an elevation matrix is generated based on the projection relationship of its color information in one-dimensional space and the color-elevation conversion curve obtained by fitting.
[0213] The projection relationship of color information in one-dimensional space is the one-dimensional color mapping value. Each pixel distributed on the image is mapped to a one-dimensional color value. and color elevation conversion curves ,pass Get the elevation matrix of the image.
[0214] The elevation matrix describes the elevation of the pixels in the image. The generated elevation matrix is used to match the pixels in the image to the three-dimensional space to obtain a three-dimensional space point matrix that represents the distribution of the pixels in the three-dimensional position. The curve-to-surface fitting is then performed to finally obtain a three-dimensional surface that accurately corresponds to the two-dimensional surface figure in the image.
[0215] By reconstructing the surface in three-dimensional space as described above, consistent continuity is ensured while the terrain can be generated accurately and quickly in GIS. The continuity of the generated terrain is ensured, and the continuous processing of the elevation between discrete pixels in the image is achieved.
[0216] And through the surface reconstruction of three-dimensional space as mentioned above, three-dimensional models suitable for GIS and three-dimensional game production scenarios will also be constructed, so as to build a large number of three-dimensional models with surfaces quickly and accurately at low cost, so that simply drawn two-dimensional pictures can also be used to construct continuous three-dimensional surfaces, greatly enhancing the model building ability of the geometry engine.
[0217] In an exemplary embodiment, the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.
[0218] In an exemplary embodiment, the present application further provides a computer program product, including a computer program, wherein the computer program implements the steps of the above-mentioned method when executed by a processor.
[0219] In an exemplary embodiment, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described above are implemented.
[0220] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0221] In an exemplary embodiment of the present application, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the method described in the above method embodiment.
[0222] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0223] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0224] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0225] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0226] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0227] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0228] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0229] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0230] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A three-dimensional surface generation method in a geometry engine, characterized in that: The method comprises: Obtaining a preconfigured color set and elevation set for the image imported by the geometry engine, wherein the elements between the color set and the elevation set constitute an elevation pair, and the elevation in the elevation set represents the elevation of the corresponding color information in the color set; Projecting the color information in the color set into a one-dimensional space to obtain a one-dimensional color mapping value corresponding to the color information; Taking the one-dimensional color mapping value and the elevation corresponding to the color information in the elevation set as objects, construct a two-dimensional element set; By using the objects in the two-dimensional element set as the passing points of the calculated curve, a color-elevation conversion curve is drawn in a two-dimensional coordinate space constructed by one-dimensional mapping values of elevation and color; Generate an elevation matrix for the pixels in the picture by using the color-elevation conversion curve, wherein the elevation matrix describes the elevations of the pixels in the picture, and the picture includes a two-dimensional curved surface graphic; Matching pixels in the image to three-dimensional space through an elevation matrix to obtain a three-dimensional space point matrix, where the three-dimensional space is provided by the geometry engine; Performing curve calculation on the three-dimensional space point matrix to obtain a curve set in the three-dimensional space; The three-dimensional surface of the two-dimensional surface figure in the picture is obtained by constructing the curve set in the three-dimensional space of the geometry engine.
2. The method according to claim 1, characterized in that: The object in the two-dimensional element set is used as a passing point of the calculated curve, and a color elevation conversion curve is drawn in a two-dimensional coordinate space constructed by one-dimensional mapping values of elevation and color, including: Reduce the domain of the one-dimensional mapping value of the color in the two-dimensional element set to generate a reduced value that conforms to the specified domain; Taking the objects in the two-dimensional element set as passing points, a two-dimensional coordinate space fitting curve constructed by the one-dimensional mapping values of elevation and color under the control of the reduction value is obtained to obtain a color elevation conversion curve.
3. The method according to claim 1, characterized in that The matching of pixel points in the image to the three-dimensional space through the elevation matrix to obtain the three-dimensional space point matrix includes: Sampling the elevation matrix to obtain a sampling matrix corresponding to the elevation of the described surface in the picture; The sampling matrix is matched with coordinates of the three-dimensional space to obtain a three-dimensional space point matrix.
4. The method according to claim 1, characterized in that The step of performing curve calculation on the three-dimensional space point matrix to obtain a set of curves in the three-dimensional space includes: Facing the row set in the three-dimensional space point matrix, curve calculation is performed on the three-dimensional point array contained in the row set, and the calculated curves constitute the curve set in the three-dimensional space.
5. The method according to claim 1, characterized in that The step of constructing a three-dimensional surface of a two-dimensional surface graphic in the picture by using the curve set in the three-dimensional space of the geometry engine includes: Obtain the control points and weights of the curves for the curve set, and obtain the control point column vector and the related weight column vector of the curve. Combining the control point column vectors of all curves in the curve set to form a control point matrix, and the related weight column vectors to form a weight matrix corresponding to the control point matrix; A three-dimensional surface is constructed in the three-dimensional space of the geometry engine according to the control point matrix and the weight matrix of the curve set.
6. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 5.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Special-shaped curved surface correction and edge fusion method
CN111857625A
Method and device for determining shortest distance track based on three-dimensional engine and medium
CN114782595A