A computational method for three-dimensionalization of ink painting to improve ink painting simulation technology

By extracting the feature lines of a three-dimensional mesh object and using the initial ink image as the texture, combined with OpenGL technology, the problem of hard texture maps in traditional ink painting simulation technology is solved, the three-dimensional three-dimensional ink effect is achieved, and the artistic expression of ink animation is enhanced.

CN114882193BActive Publication Date: 2025-01-10BEIJING UNIV OF TECH

Patent Information

Application Number
CN202210352550.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-05
Publication Date
2025-01-10
Estimated Expiration
2042-04-05

AI Technical Summary

Technical Problem

Traditional ink painting simulation technology is difficult to maintain artistic characteristics in three-dimensional rendering, resulting in a stiff and over-planar texture map, lacking ink and wash charm.

Method used

By extracting the feature lines of the three-dimensional mesh object as the trajectory of the ink strokes, and using the initial ink image as the texture, combined with the OpenGL graphics API, the tight arrangement and viewpoint orientation adjustment of the three-dimensional faces are achieved, simulating the thickness and thickness of the ink strokes.

Benefits of technology

It realizes the visual effect of three-dimensional ink and wash contour lines, solves the rigid problems caused by texture mapping, enhances the artistic characteristics and dynamic visual effects of ink and wash painting, and is suitable for ink and wash animation and other non-realistic rendering technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114882193B_ABST
    Figure CN114882193B_ABST
Patent Text Reader

Abstract

The present invention discloses a calculation method for three-dimensionalization of ink painting for improving ink painting simulation technology. First, a polygonal mesh object is created and the topological structure of the mesh is processed. The characteristic lines of the mesh object are extracted as the trajectory of the ink painting. The characteristic lines are the structural features of the three-dimensional model. After the characteristic lines are extracted, the coloring of the stroke appearance will use the initial image of the stroke as a texture map attached to the three-dimensional surface patch. The three-dimensional surface patch will be evenly distributed on the path line of the extracted characteristic line, and the stroke will be formed by closely arranging the line segments, and the thickness and lightness of the stroke will be controlled according to the attribute data stored in the vertices on the path line to simulate the handwriting of the ink painting. Each three-dimensional surface patch on the path line is made to face the viewpoint. Visually, three-dimensional ink lines can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer graphics technology. The main knowledge involved includes the use of some OpenGL function libraries, feature line drawing, image processing, texture coloring, three-dimensional rendering technology, and deep learning of computer ink painting simulation technology. Background Art

[0002] Chinese ink painting occupies an important position in the world of fine arts and is an artistic treasure of our traditional culture. The emergence of ink-and-wash animation has promoted and inherited China's traditional culture in a new form of expression. However, due to the particularity of ink materials, the complex and cumbersome production methods, and the lack of visual experience, the development of ink-and-wash animation has been hindered.

[0003] With the rapid development of computer image technology, new methods have been provided for the development of ink-and-wash animation. The use of ink-and-wash painting simulation technology and digital technologies such as three-dimensional rendering has simplified the production steps of ink-and-wash animation, enriched the expression of film and television language, and realized industrial production. However, how to maintain the artistic characteristics of ink-and-wash painting and combine it with the film and television language of modern animation to produce ink-and-wash animation works with Chinese traditional cultural characteristics has become a key research goal.

[0004] In summary, there are still some problems in the production of ink animations with traditional ink painting simulation technology and combined with 3D rendering technology. This is mainly reflected in the fact that when the virtual camera uses rotation, surround and other lens languages ​​in 3D space, the texture of the ink strokes on the model feature lines drawn by texture mapping in the scene will be attached to the turning point of the model, revealing the roughness of the model and the flat stroke map, thus losing the charm of ink. Although the feature lines extracted by the object space detection method can avoid the texture mapping problem at the turning point, the ink strokes drawn are too simple in form and lack the style characteristics of ink strokes. Summary of the invention

[0005] Based on the above analysis, the present invention mainly designs a method for applying in the ink painting simulation step to improve the three-dimensional spatial sense of ink painting simulation, mainly a calculation method for three-dimensionalizing ink painting with the characteristic lines of three-dimensional mesh objects as trajectories. The main components of three-dimensional ink painting are points, path lines and strokes. This method hopes to extract the characteristic lines of three-dimensional mesh objects as path trajectories, and present the appearance of strokes through initial ink image coloring. And when the viewpoint moves, the colored image will face the viewpoint, visually creating a three-dimensional ink contour line.

[0006] The first step is to create a polygonal mesh object and process the topological structure of the mesh. The feature lines of the mesh object are extracted as the trajectory of the ink brush stroke. The feature line is the structural feature of the three-dimensional model. It is at the turning point of the model surface, usually creases, ridges, gullies, etc. The feature line can also be called a wrinkle line. Each vertex of the extracted feature line will store all the attribute data that defines the final appearance of the stroke, including the position, alpha, pressure, vertex curvature and UV direction of the texture. The method of extracting feature lines is mainly a method of judging feature lines, which is based on the size of the adjacent angle, that is, the common edge of two polygons and the angle formed by these two adjacent polygons is greater than or less than the threshold T angle When , this common edge defines the crease edge or edge (Crease Edge), and the line connecting adjacent crease edges is the feature line.

[0007] After the feature lines are extracted, the stroke appearance will be colored using the initial image of the stroke as a texture map attached to each 3D patch. The 3D patches will be evenly distributed on the path line of the extracted feature line, and the strokes will be formed by closely arranging the line segments. The thickness and lightness of the strokes will be controlled according to the attribute data stored in the vertices on the path line, simulating the handwriting of ink painting. Calling the transform.LookAt() function makes each 3D patch on the path line face the viewpoint. When the viewpoint rotates and moves, the reverse side of the 3D patch cannot be seen visually, avoiding the appearance of "pieces" in the view. Visually, three-dimensional ink lines can be realized.

[0008] To achieve the above purpose, the present invention adopts the following technical solution: In order to better implement the whole method, Python is preferred as the method writing language, and it is developed based on the OpenGL graphics API. The model creation part uses GL_TRIANGLES to draw triangles, and each vertex is regarded as an independent triangle. Vertices 3n-2, 3n-1 and 3n define the nth triangle, and a total of N / 3 triangles are drawn. A total of N / 3 triangles are drawn.

[0009] The algorithm used in extracting feature lines is: let the normal vectors of triangles T1 and T2 be N1 and N2 respectively, then the dihedral angle theta of T1 and T2 and the angle angle of N1 and N2 satisfy the relationship theta + angle = π. Therefore, the wrinkle edge of the model surface is detected by the cosine value of the angle of the normal vector of the triangle:

[0010]

[0011] Assume T angle ≤60 degrees. In actual operation, when the cosine value of the angle is less than or equal to 60, the edge is a characteristic edge.

[0012] Then, the initial image is used as the texture map of the appearance of the stroke. The grayscale value is extracted from the RGB components of the input initial image using the average value method Gray = (R+G+B) / 3; as the transparency component of Alpha. R, G, B, and A are all values ​​from 0 to 1. When A is equal to 0, the image is completely transparent, and when A = 1, the image is completely covered. When the value is centered, the image is semi-transparent. After obtaining the transparent display of the stroke, the color scale value of the initial image is controlled to adjust the details of the image. Select the R, G, and B color components, and control the currently selected color channel. Use the color components as feature values ​​for color scale adjustment. The algorithm can be expressed as:

[0013]

[0014] Among them, C init With C end Represent the eigenvalues ​​before and after adjustment, L low With L high Represents the range of feature values. white With D black These are the parameters that control the bright and dark parts of the image respectively. white Adjust the bright range of the image. When the parameter is reduced, the bright details disappear. black Adjust the dark range of the image. The larger the parameter, the darker the image. The adjusted initial image with alpha channel is used as the appearance of the stroke and mapped to the 3D surface. Through close arrangement, the ink stroke effect is formed.

[0015] Finally, the plane strokes are made three-dimensional. This is an effect algorithm based on the idea of ​​rotation. The three-dimensional facets of the stroke appearance are uniformly oriented toward the viewpoint. The transform.LookAt(Vector targetpositon); function is called. However, in this method, the z-axis of the facet will always face the target viewpoint. To make the coordinate axis of the X-axis or Y-axis face the targetObject, a rotation transformation is required. Enter transform.Rotate(newVector3(90,0,0)); the y-axis of the facet will point to the viewpoint. Enter transform.Rotate(newVector3(0,-90,0)); the X-axis of the facet will point to the viewpoint.

[0016] A calculation method for three-dimensionalization of ink painting for improving ink painting simulation technology mainly includes:

[0017] Step 1: Create a polygonal mesh object, using graphics software to create it interactively.

[0018] Step 2: Based on the polygonal mesh object created in step 1, an algorithm for determining feature lines is used to calculate the polygonal mesh object and extract feature lines.

[0019] Step 3: Create an initial stroke image through an input device or image creation software.

[0020] Step 4: Use the feature lines extracted in step 2 as the path to generate a stroke consisting of closely arranged three-dimensional patches, and map the initial image texture produced in step 3 onto the patches.

[0021] Step 5: Align the three-dimensional faces that have completed texture mapping in step 4 toward the viewpoint to achieve three-dimensional strokes.

[0022] Preferably, step 1 takes the following steps:

[0023] Step 1.1: Use the opengl basic primitive type to create a simple polygonal mesh object. You can use quadrilateral mesh creation in an interactive way to reduce the difficulty of operation.

[0024] Step 1.2: Appropriately adjust the geometric structure of the polygonal mesh model, subdivide the mesh, perform operations such as cutting, extrusion, and connection, and then adjust the geometric structure.

[0025] Step 1.3: Repeat the above steps to create the final model.

[0026] Step 1.4: Adjust the topological structure of the mesh to facilitate the extraction of feature lines in the next step.

[0027] Preferably, step 2 takes the following steps:

[0028] Step 2.1: Select the model from which feature lines are to be extracted.

[0029] Step 2.2: Set the angle T angle Cosine value, detect wrinkles on the model surface.

[0030] Step 2.3: Extract the model feature lines based on the relationship between the cosine value of the angle between the normal vectors of the triangle patch and record the feature line group at the same time.

[0031] Preferably, step 3 takes the following steps:

[0032] Step 3.1: Analyze the initial effect of the brush on the paper and make an original image of the strokes. Or directly import an image of ink texture.

[0033] Step 3.2: Extract the grayscale value from the RGB components of the image as the Alpha transparency component of the image.

[0034] Step 3.3: Then use the method of controlling the RGB color components of the image, that is, process the ink effect of the image through means such as color levels, brightness, and contrast.

[0035] Step 3.4: And store the initial image with transparency as an image format with an alpha channel, such as tga format.

[0036] Preferably, step 4 takes the following steps:

[0037] Step 4.1: Select the extracted feature line group and the instance stroke as a three-dimensional face.

[0038] Step 4.2: According to the vertex texture coordinate values ​​on the editing line, the three-dimensional face instantiated on the editing line is assigned the initial image of the upper stroke.

[0039] Step 4.3: Adjust the density of the strokes to create a continuous ink painting effect.

[0040] Step 4.4: Use the vertex data information on the feature lines to adjust the size of the face to simulate the effect of the thickness of the ink brush strokes.

[0041] Preferably, step 5 takes the following steps:

[0042] Step 5.1: First call the transform.LookAt(Vectortargetpositon); function, and the Z axis of the stroke piece points to the viewpoint.

[0043] Step 5.2: Adjust the other coordinate axes of the patch to face the targetObject, then call transform.Rotate(newVector3(0,0,0)) and modify the parameters of Vector3(0,0,0). Change the Z axis of the patch to face the viewpoint in other directions, and realize the three-dimensionalization of the ink painting.

[0044] Compared with the existing technology, this method has the following advantages:

[0045] This method mainly improves the ink painting simulation technology, so that it can be better used in the field of ink animation. This method is to design the ink strokes in three dimensions. Although the strokes are visually three-dimensional, the effect can simulate the real ink smudge effect, and solve the problem that the structural feature lines of the model are stiff and too flat due to relying on texture mapping. The traditional method of improving the ink painting simulation technology can not only realize the artistic pursuit of flat ink painting, but also improve the visual effect of dynamic ink. This method can also smudge the environment to create a thicker ink atmosphere. And this method is also applicable to other non-realistic rendering technologies, watercolor simulation technology, oil painting simulation technology and other fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 : Flow chart of this method.

[0047] Figure 2 : Feature line definition diagram of the mesh model.

[0048] Figure 3 : Structural diagram of three-dimensional strokes. DETAILED DESCRIPTION

[0049] The present invention is further described in detail below in conjunction with specific examples and with reference to the accompanying drawings.

[0050] The hardware equipment used in the present invention includes a PC and a 1080 graphics card. In this part, we have carried out an example demonstration to explore the effect of this method. The three-dimensional stroke process flow chart designed by the present invention is as follows: Figure 1 As shown, the specific steps include:

[0051] Step 1: Create a polygonal mesh object, using graphics software to create it interactively.

[0052] Step 2: Based on the polygonal mesh object created in step 1, an edge algorithm for determining feature lines is used to calculate the polygonal mesh object and extract feature lines.

[0053] Step 3: Create an initial stroke image through an input device or image creation software.

[0054] Step 4: Use the feature lines extracted in step 2 as the path to generate a stroke consisting of closely arranged three-dimensional patches, and map the initial image texture produced in step 3 onto the patches.

[0055] Step 5: Align the three-dimensional faces that have completed texture mapping in step 4 toward the viewpoint to achieve three-dimensional strokes.

[0056] Preferably, step 1 takes the following steps:

[0057] Preferably, step 1 takes the following steps:

[0058] Step 1.1: Use the opengl basic primitive type to create a simple polygonal mesh object. You can use quadrilateral mesh creation in an interactive way to reduce the difficulty of operation.

[0059] Step 1.2: Appropriately adjust the geometric structure of the polygonal mesh model, subdivide the mesh, perform operations such as cutting, extrusion, and connection, and then adjust the geometric structure.

[0060] Step 1.3: Repeat the above steps to create the final model.

[0061] Step 1.4: Adjust the topological structure of the mesh to facilitate the extraction of feature lines in the next step.

[0062] Preferably, step 2 takes the following steps:

[0063] Step 2.1: Select the model from which feature lines are to be extracted.

[0064] Step 2.2: Set the angle T angle Cosine value, detect wrinkles on the model surface.

[0065] Step 2.3: Extract the model feature lines based on the relationship between the cosine value of the angle between the normal vectors of the triangle patch and record the feature line group at the same time.

[0066] Preferably, step 3 takes the following steps:

[0067] Step 3.1: Analyze the initial effect of the brush on the paper and make an original image of the strokes. Or directly import an image of ink texture.

[0068] Step 3.2: Extract the grayscale value from the RGB components of the image as the Alpha transparency component of the image.

[0069] Step 3.3: Then use the method of controlling the RGB color components of the image, that is, process the ink effect of the image through means such as color levels, brightness, and contrast.

[0070] Step 3.4: And store the initial image with transparency as an image format with an alpha channel, such as tga format.

[0071] Preferably, step 4 takes the following steps:

[0072] Step 4.1: Select the extracted feature line group and the instance stroke as a three-dimensional face.

[0073] Step 4.2: According to the vertex texture coordinate values ​​on the editing line, the three-dimensional face instantiated on the editing line is assigned the initial image of the upper stroke.

[0074] Step 4.3: Adjust the density of the strokes to create a continuous ink painting effect.

[0075] Step 4.4: Use the vertex data information on the feature lines to adjust the size of the face to simulate the effect of the thickness of the ink brush strokes.

[0076] Preferably, step 5 takes the following steps:

[0077] Step 5.1: First call the transform.LookAt(Vectortargetpositon); function, and the Z axis of the stroke piece points to the viewpoint.

[0078] Step 5.2: Adjust the other coordinate axes of the patch to face the targetObject, then call transform.Rotate(newVector3(0,0,0)) and modify the parameters of Vector3(0,0,0). Change the Z axis of the patch to face the viewpoint in other directions, and realize the three-dimensionalization of the ink painting.

[0079] Figure 1 The main process of the research method of the present invention is shown. Figure 2 It shows the characteristic line definition of the grid model. Figure 3 Show, Figure 3 It is a structural diagram of a three-dimensional stroke, consisting of vertices, path lines, and basic components of a stroke. The appearance of a stroke is a continuous stroke based on the initial ink image with an alpha channel. The higher the density, the closer the arrangement, forming an ink line with a smudge effect.

[0080] The above embodiments are only exemplary embodiments of the present invention and are not intended to limit the present invention. The protection scope of the present invention is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present invention within the essence and protection scope of the present invention, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present invention.

Claims

1. A method for calculating the three-dimensionalization of ink painting to improve ink painting simulation technology, characterized by: The calculation method includes, Step 1: Create a polygonal mesh object using interactive methods using graphics software; Step 2: Based on the polygonal mesh object created in step 1, an algorithm for determining feature lines is used to calculate the polygonal mesh object and extract feature lines; Step 3: Create an initial stroke image through an input device or image creation software; Step 4: Use the feature lines extracted in step 2 as the path to generate a stroke consisting of three-dimensional patches closely arranged, and map the initial image texture produced in step 3 onto the three-dimensional patches; Step 5: Align the three-dimensional faces that have completed texture mapping in step 4 toward the viewpoint to achieve three-dimensional strokes; Step 4 Take the following steps: Step 4.1: Select the extracted feature line group and the instance stroke as a three-dimensional face; Step 4.2: according to the vertex texture coordinate values ​​on the editing line, the three-dimensional face instantiated on the editing line is assigned the initial image of the upper stroke; Step 4.3: Adjust the density of the strokes to make them produce a continuous ink painting effect; Step 4.4: Use the vertex data information on the feature line to adjust the size of the patch to simulate the effect of the thickness of the ink brush stroke; Step 5 Take the following steps: Step 5.1: First call the transform.LookAt(Vector targetposition) function, and the Z axis of the stroke piece points to the viewpoint; Step 5.2: Adjust the other coordinate axes of the patch to face the targetObject, then call transform.Rotate(newVector3(0,0,0)) and modify the parameters of Vector3(0,0,0); change the Z axis of the patch to face the viewpoint in other directions to realize the three-dimensionalization of the ink painting.

2. The method for calculating the three-dimensionalization of ink painting according to claim 1, characterized in that: Step 1 Take the following steps: Step 1.1: Use the basic OpenGL primitive type to create a simple polygonal mesh object; create a quadrilateral mesh interactively to reduce the difficulty of operation; Step 1.2: Appropriately adjust the geometric structure of the polygonal mesh model, subdivide the mesh, perform cutting, extrusion and connection operations, and then adjust the geometric structure; Step 1.3: Repeat step 1.2 above to create the final model by adjusting the geometry structure; Step 1.4: Adjust the topological structure of the mesh to facilitate the extraction of feature lines in the next step; Step 2 Take the following steps: Step 2.1: Select the model to be used for feature line extraction; Step 2.2: Set the angle T angle Cosine value, detects wrinkle edges on the model surface; Step 2.3: Extract the model feature lines based on the relationship between the cosine value of the angle between the normal vectors of the triangle patch and record the feature line group at the same time.

3. The method for calculating the three-dimensionalization of ink painting according to claim 1, characterized in that: Step 3 Take the following steps: Step 3.1: Analyze the initial effect of the brush on the paper and make an original image of the strokes; or directly import an image of ink texture; Step 3.2: Extract the gray value from the RGB component of the image as the Alpha transparency component of the image; Step 3.3: Then, by using the method of controlling the RGB color components of the image, the ink effect of the image is processed by means of color level, brightness, and contrast; Step 3.4: And store the initial image with transparency as an image format with alpha channel.

Citation Information

Patent Citations

  • Ink painting simulation method of three-dimensional tree model

    CN103218846A

  • Modeling, drawing and rendering method for digital three-dimensional freehand Chinese brush landscape painting

    CN105678835A

Cited By

  • 3D scene wash and ink painting style rendering method based on 3dsmax

    CN115880413A