Method, device and equipment for three-dimensional text fusion editing and computer storage medium
By projecting and editing the vertex and texture coordinates of 3D text, a fused model with the 3D model is generated, solving the problem of low efficiency in 3D text fusion editing in existing technologies and achieving efficient text replacement and fusion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD
- Filing Date
- 2024-12-06
- Publication Date
- 2026-06-09
AI Technical Summary
Existing 3D text fusion and editing methods have low editing efficiency, requiring designers to recreate the model to replace the 3D text on the model.
By obtaining the vertex coordinates and texture coordinates of the 3D text and model, the vertices of the 3D text are projected onto the triangular mesh of the 3D model, the fusion coordinates and texture coordinates of the projection points are determined, and the model is edited based on these coordinates to generate a fused model.
It improves the efficiency of 3D text fusion editing, avoids the step of remaking the model, and ensures the consistency of text and model in terms of 3D details and textures.
Smart Images

Figure CN122176253A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of text rendering technology, and in particular relates to a method, apparatus, device and computer storage medium for three-dimensional text fusion editing. Background Technology
[0002] Text is one of the important carriers for information transmission in front-end business. In order to better integrate into the virtual environment, text is no longer in the traditional two-dimensional form. Its form of expression has been transformed into three-dimensional, which enhances the user's sense of immersion and participation in the virtual space.
[0003] In existing technologies, when users need to use the style of a 3D model to add or replace text in the 3D model, designers often need to reset the model and then upload it to the virtual scene, resulting in low editing efficiency for 3D text fusion editing. Summary of the Invention
[0004] This application provides a method, apparatus, device, and computer storage medium for three-dimensional text fusion editing, in order to solve the problem of low editing efficiency in existing three-dimensional text fusion editing methods.
[0005] In a first aspect, embodiments of this application provide a method for three-dimensional text fusion editing, the method comprising:
[0006] Obtain the 3D text to be fused, the 3D model, the text vertex thickness values of the 3D text, and the vertex coordinates and vertex texture coordinates of the 3D model;
[0007] Project the vertices of the 3D text onto the triangular mesh on the surface of the 3D model to obtain the coordinates of the projection point;
[0008] The fusion coordinates and texture coordinates of the projection point are determined based on the projection point coordinates, the vertex coordinates of the triangle mesh, the vertex texture coordinates of the triangle mesh, and the text vertex thickness value of the 3D text corresponding to the projection point. The fusion coordinates are the text vertex coordinates corresponding to the projection point after the 3D text and the 3D model are fused. The vertex coordinates of the triangle mesh are the vertex coordinates of the 3D model corresponding to the triangle mesh. The vertex texture coordinates of the triangle mesh are the vertex coordinates of the 3D model corresponding to the triangle mesh.
[0009] The 3D model is edited based on the fusion coordinates and texture coordinates of the projection point to obtain a fused model of 3D text and 3D model.
[0010] Secondly, embodiments of this application provide a three-dimensional text fusion editing apparatus, the apparatus comprising:
[0011] The acquisition module is used to acquire the 3D text to be fused, the 3D model, the text vertex thickness values of the 3D text, and the vertex coordinates and vertex texture coordinates of the 3D model;
[0012] The projection module is used to project the vertices of 3D text onto the triangular mesh on the surface of the 3D model to obtain the coordinates of the projection point;
[0013] The determination module is used to determine the fusion coordinates and texture coordinates of the projection point based on the projection point coordinates, the vertex coordinates of the triangle mesh, the vertex texture coordinates of the triangle mesh, and the text vertex thickness value of the 3D text corresponding to the projection point. The fusion coordinates are the text vertex coordinates corresponding to the projection point after the 3D text and the 3D model are fused. The vertex coordinates of the triangle mesh are the vertex coordinates of the 3D model corresponding to the triangle mesh. The vertex texture coordinates of the triangle mesh are the vertex coordinates of the 3D model corresponding to the triangle mesh.
[0014] The editing module is used to edit the 3D model based on the fusion coordinates and texture coordinates of the projection point to obtain a fused model of 3D text and 3D model.
[0015] Thirdly, embodiments of this application provide a terminal device, the device including: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the three-dimensional text fusion editing method as described in the first aspect.
[0016] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the three-dimensional text fusion editing method as described in the first aspect.
[0017] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform a three-dimensional text fusion editing method as described in the first aspect.
[0018] This application provides a method, apparatus, device, and computer storage medium for 3D text fusion editing. The method first obtains the 3D text to be fused, a 3D model, the text vertex thickness values of the 3D text, and the vertex coordinates and texture coordinates of the 3D model. The vertices of the 3D text are projected onto a triangular mesh on the surface of the 3D model to obtain the projection point coordinates. The projection operation effectively determines the position of the text vertices on the model surface, thus obtaining the projection point coordinates, providing necessary basic data for subsequent fusion. Based on the projection point coordinates, the vertex coordinates of the triangular mesh, the vertex texture coordinates of the triangular mesh, and the text vertex thickness values of the 3D text corresponding to the projection point, the fusion coordinates and texture coordinates of the projection point are determined. The fusion coordinates are the text vertex coordinates corresponding to the projection point after the 3D text and 3D model are fused. By considering the thickness values of the text vertices, the fused text is ensured to retain its original 3D details. Simultaneously, the texture coordinates are calculated to ensure that the fused text and the model maintain consistency in texture. The 3D model is edited based on the fusion coordinates and texture coordinates of the projection point to obtain a fused model of the 3D text and the 3D model. By calculating and fusing coordinates and texture coordinates and merging text and models, text replacement on 3D models does not require rebuilding the entire model. Instead, it only requires creating the 3D text to be merged and fusing it with the 3D model, thus improving the efficiency of 3D text fusion editing. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the three-dimensional text fusion and editing method provided in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of the projection point provided in an embodiment of this application;
[0022] Figure 3 This is a schematic diagram of a triangular mesh provided in an embodiment of this application;
[0023] Figure 4 This is a flowchart illustrating one implementation of determining the fusion coordinates and texture coordinates of the projection point according to an embodiment of this application.
[0024] Figure 5 This is a flowchart illustrating one implementation method for generating three-dimensional text provided in an embodiment of this application;
[0025] Figure 6This is a flowchart illustrating one implementation method for obtaining a target text point set and a target background point set provided in an embodiment of this application;
[0026] Figure 7 This is a flowchart illustrating one implementation method for determining a target thickness value provided in an embodiment of this application;
[0027] Figure 8 This is a schematic diagram of the structure of the three-dimensional text fusion editing device provided in the embodiments of this application;
[0028] Figure 9 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. Detailed Implementation
[0029] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0030] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0031] Existing methods use vector data to render 3D text. This involves obtaining the corresponding 2D vector data of the character to be rendered, parsing the text vector data to obtain vertex data suitable for 3D construction, and finally triangulating the vertices to obtain triangular facet indices. The vertex data and triangular facet indices are then assembled into rendering data and passed to the graphics library for rendering. Alternatively, a 3D text model can be constructed using an extrusion method. The bottom, top, and sides of the 3D text are modeled separately, with the top face copied from the bottom face, and the sides formed by corresponding points on the top and bottom faces. Every four adjacent vertices form a facet, which is then triangulated to obtain the final rendering data, generating the 3D text. However, both of these methods require using the style of the existing 3D text model. When only replacing the 3D text on the model, designers often need to recreate the model offline and then upload it to the virtual scene, resulting in low editing efficiency for 3D text fusion and editing.
[0032] To address the problems of existing technologies, this application provides a method, apparatus, device, and computer storage medium for 3D text fusion and editing. The method first obtains the 3D text to be fused, a 3D model, the text vertex thickness values of the 3D text, and the vertex coordinates and texture coordinates of the 3D model. The vertices of the 3D text are projected onto a triangular mesh on the surface of the 3D model to obtain the projection point coordinates. The projection operation effectively determines the position of the text vertices on the model surface, thus obtaining the projection point coordinates, providing necessary basic data for subsequent fusion. Based on the projection point coordinates, the vertex coordinates of the triangular mesh, the vertex texture coordinates of the triangular mesh, and the text vertex thickness values of the 3D text corresponding to the projection point, the fusion coordinates and texture coordinates of the projection point are determined. The fusion coordinates are the text vertex coordinates corresponding to the projection point after the 3D text and 3D model are fused. By considering the thickness values of the text vertices, the fused text is ensured to retain its original 3D details. Simultaneously, the texture coordinates are calculated to ensure that the fused text and the model maintain consistency in texture. The 3D model is edited based on the fusion coordinates and texture coordinates of the projection point to obtain a fused model of the 3D text and the 3D model. By calculating and fusing coordinates and texture coordinates and merging text and models, text replacement on 3D models does not require rebuilding the entire model. Instead, it only requires creating the 3D text to be merged and fusing it with the 3D model, thus improving the efficiency of 3D text fusion editing.
[0033] The following section first introduces the method for three-dimensional text fusion and editing provided in the embodiments of this application.
[0034] Figure 1 This illustration shows a flowchart of a method for 3D text fusion editing according to an embodiment of this application. Figure 1 As shown, the method may include the following steps: S101 to S104.
[0035] S101, obtain the 3D text to be fused, the 3D model, the text vertex thickness value of the 3D text, and the vertex coordinates and vertex texture coordinates of the 3D model.
[0036] In this system, 3D text refers to the 3D text model to be merged, and 3D models refer to other 3D models to be merged. The 3D text and 3D models are each composed of vertices of the 3D text and the vertices of the 3D model, respectively. The vertex thickness of the 3D text is the thickness value of each vertex of the 3D text, and the vertex texture coordinates of the 3D text are the coordinate positions of each vertex of the 3D text on the texture map. The texture map is a pattern or color mapped onto the surface of the 3D text.
[0037] In some embodiments, the 3D text to be fused is generated from the text vector data corresponding to the 3D text.
[0038] Acquire the key data required for the fusion process, including the 3D text and 3D model to be fused, as well as their respective vertex and texture information, for use in the subsequent text-model fusion calculation process.
[0039] S102 projects the vertices of the 3D text onto the triangular mesh on the surface of the 3D model, obtaining the coordinates of the projection points.
[0040] Among them, the triangular mesh is the mesh structure of the surface of the 3D model. The surface of the 3D model is composed of multiple triangular meshes, and the projection point coordinates are the coordinates of the points where the text vertices are projected onto the surface model.
[0041] In some embodiments, the vertices of the 3D text are projected onto a triangular mesh on the surface of the 3D model to obtain the coordinates of the projection points, which can be:
[0042] The three-dimensional model and three-dimensional text are rendered into a scene using orthogonal imaging, and the three-dimensional model and three-dimensional text are adjusted. The orthogonal camera is oriented in the opposite direction of the z-axis and perpendicular to the xy plane. The ray intersection method is used to project the vertices of the three-dimensional text onto the surface of the three-dimensional model, starting from the vertices of the three-dimensional text.
[0043] When adjusting the 3D model and 3D text, the reference 3D model is rendered first at a distance from the camera plane, and then rotated and adjusted so that different parts of the 3D model face the camera. The 3D text is closer to the camera plane and does not intersect with the surface of the 3D model. The text position can be changed and scaled on the xy plane according to the user's needs.
[0044] In one example, such as Figure 2 As shown, the vertices P1', P2', and P3' of the 3D text are projected onto the surface of the 3D model along the direction of the orthogonal camera, resulting in the projection point P. 1n P 2n and P3n .
[0045] S103. Determine the fusion coordinates and texture coordinates of the projection point based on the projection point coordinates, the vertex coordinates of the triangular mesh, the vertex texture coordinates of the triangular mesh, and the text vertex thickness value of the 3D text corresponding to the projection point. The fusion coordinates are the text vertex coordinates corresponding to the projection point after the 3D text and the 3D model are fused. The vertex coordinates of the triangular mesh are the vertex coordinates of the 3D model corresponding to the triangular mesh. The vertex texture coordinates of the triangular mesh are the vertex coordinates of the 3D model corresponding to the triangular mesh.
[0046] Among them, the texture coordinates of the projection point are the positions of the texture coordinates of the projection point on the texture map after the 3D text and 3D model are merged.
[0047] S104: Edit the 3D model based on the fusion coordinates and texture coordinates of the projection point to obtain a fusion model of the 3D text and the 3D model.
[0048] In some embodiments, the 3D model is edited based on the fusion coordinates and texture coordinates of the projection point to obtain a fused model of 3D text and the 3D model, which may include:
[0049] The 3D model is modified based on the fusion coordinates of the projection points to obtain the target 3D model;
[0050] The target 3D model is rendered based on the texture coordinates of the projection point to obtain a fused model of 3D text and 3D model.
[0051] Projection operations effectively determine the positions of text vertices on the model surface, thus obtaining projection point coordinates, providing necessary foundational data for subsequent blending. By considering the thickness values of the text vertices, the blended text retains its original 3D details. Simultaneously, texture coordinates are calculated to ensure that the blended text and model maintain textual consistency. By calculating blending coordinates and texture coordinates and fusing the text and model, text replacement on a 3D model does not require rebuilding the entire model; only the 3D text to be blended needs to be created and merged with the 3D model, improving the efficiency of 3D text blending and editing.
[0052] In some embodiments, after projecting the vertices of the 3D text onto the triangular mesh of the surface of the 3D model, the projection points are used as new vertices of the 3D model, and the triangular mesh of the surface of the 3D model is re-divided.
[0053] In one example, such as Figure 3 As shown, P1, P2, and P3 are the vertices of an existing triangular mesh in the 3D model, forming a triangular mesh (P1, P2, P3). When vertex P... 1nAfter insertion, three new triangular meshes are created, namely (P1, P... 1n (P3), (P1, P) 1n (P2), (P) 1n P1, P2, P3), and discard the original triangular mesh (P1, P2, P3), when vertex P 2n After insertion, further subdivide into 3 new triangular meshes, namely (P1, P... 2n (P3), (P1, P) 2n P 1n ), (P 1n P 2n P3), and discard the triangular mesh (P1, P2). 1n (P3).
[0054] In some embodiments, such as Figure 4 As shown, the blending coordinates and texture coordinates of the projection point are determined based on the projection point coordinates, the vertex coordinates of the triangle mesh, the vertex texture coordinates of the triangle mesh, and the text vertex thickness value of the three-dimensional text corresponding to the projection point. This can include S401 to S403.
[0055] S401, determine the face normal of the triangular mesh based on the vertex coordinates of the triangular mesh;
[0056] S402, determine the fusion coordinates of the projection point based on the face normal of the triangular mesh, the coordinates of the projection point, and the thickness value of the text vertex of the 3D text corresponding to the projection point;
[0057] S403 determines the texture coordinates of the projection point based on the vertex texture coordinates of the triangular mesh.
[0058] By calculating the surface normal, the direction of the projection point on the model surface can be determined more accurately; by combining the surface normal and the thickness value, the specific position of the projection point on the model surface can be determined; at the same time, the vertex texture coordinates of the triangle mesh are used to determine the texture coordinates of the projection point, ensuring the continuity and consistency of the texture of the fused model.
[0059] In some embodiments, such as Figure 5 As shown, before acquiring the 3D text to be fused, the method may further include: S501 to S504.
[0060] S501, Obtain the target text point set and target background point set of the texture image corresponding to the three-dimensional text;
[0061] S502, determine the target texture field distance corresponding to the target text point set and the target background point set based on the relationship between the text point set, the background point set and the field texture distance;
[0062] S503, determine the target thickness value of the points in the target text point set based on the target text point set, the target background point set, and the target texture field distance;
[0063] S504 generates three-dimensional text based on the target text point set and the target thickness value.
[0064] The relative distance between the text and its background is obtained by calculating the target texture field distances corresponding to the target text point set and the target background point set. The determination of the target thickness value is based on the complex relationship between the text point set, the background point set, and the texture field distance, allowing each text point to have different thicknesses depending on its position and background, thereby increasing the detail and sense of layering of the generated 3D text.
[0065] In some embodiments, the relationship between the text point set, the background point set, and the field texture distance can be:
[0066]
[0067] Where d is the texture field distance, x m y m These are the x and y coordinates of the point where the text points are concentrated, respectively. n y n These are the x and y coordinates of the background point set point, respectively.
[0068] In some embodiments, such as Figure 6 As shown, obtaining the target text point set and target background point set of the texture image corresponding to the three-dimensional text may include: S601 to S603.
[0069] S601, Obtain the text vector data corresponding to the 3D text. The text vector data includes the instruction type and vertex position.
[0070] S602, according to the instruction type and the preset corresponding rules, the text vector data is split and stored in an array to obtain the two-dimensional contour path points of the three-dimensional text. Each segment of the array includes the instruction type and the corresponding vertex position.
[0071] S603 renders the two-dimensional contour path points onto a preset texture image to obtain a target text point set and a target background point set. The target text point set is the text pixel set of the texture image, and the target background point set is the background pixel set of the texture image.
[0072] By acquiring the text vector data corresponding to the three-dimensional text, the geometric shape and outline of the text can be accurately obtained. The command type and preset corresponding rules allow the text vector data to be flexibly split and processed, allowing the processing of different types of text vector data. The distinction between the target text point set and the target background point set helps to accurately identify and process the text region and background region in subsequent processing.
[0073] In some embodiments, text vector data can be path data in Scalable Vector Graphics (SVG), i.e., a string consisting of instructions and fixed-point positions.
[0074] In some embodiments, the instruction types may include: move to a specified coordinate position (moveto, M), draw a straight line to a specified coordinate position (lineto, L), draw a horizontal line to a specified x-coordinate (horizontal lineto, H), draw a vertical line to a specified y-coordinate (vertical lineto, V), draw a cubic Bézier curve (curveto, C), draw a smooth cubic Bézier curve (smooth curveto, S), draw a quadratic Bézier curve (quadratic Bézier curve, Q), draw a smooth quadratic Bézier curve (smooth quadratic Bézier curveto, T), and close path (closepath, Z).
[0075] In some embodiments, uppercase command letters represent absolute coordinates, and lowercase command letters represent relative coordinates. When a command letter is a relative coordinate, it needs to be converted to an absolute coordinate.
[0076] In one example, the array could be: [{type:M,points:[x1,y1]},{type:L,points:[x2,y2]},...,{type:Z}].
[0077] Where type is the instruction type and points are the coordinates.
[0078] In some embodiments, such as Figure 7 As shown, determining the target thickness value of points in the target text point set based on the target text point set, the target background point set, and the target texture field distance can include: S701 to S705.
[0079] S701, Obtain the preset grayscale values of the points in the target text point set and the target background point set;
[0080] S702, determine the target surface gradient corresponding to the target texture field distance based on the relationship between texture field distance and surface gradient;
[0081] S703, determine the target reflection intensity corresponding to the target surface gradient based on the relationship between the surface gradient and the reflection intensity;
[0082] S704, based on the relationship between surface gradient, reflection intensity, gray value, first thickness value and second thickness value, determine the target surface gradient, target reflection intensity, preset gray value and target first thickness value corresponding to the target second thickness value, where the target first thickness value is the target texture field distance;
[0083] S705, take the second target thickness value as the new first target thickness value, and repeatedly calculate the second target thickness value according to the relationship between surface gradient, reflection intensity, gray value, first thickness value and second thickness value until the preset number of times is met, and take the second target thickness value as the target thickness value.
[0084] By considering texture field distance, surface gradient, and reflection intensity, we can more realistically simulate and calculate the thickness changes of text in three-dimensional space. By iteratively calculating the target thickness value, we can gradually optimize the thickness representation of the text.
[0085] In some embodiments, the relationship between texture field distance and surface gradient can be:
[0086]
[0087] Where p is the x-axis component of the surface gradient, q is the y-axis component of the surface gradient, and x and y are the horizontal and vertical coordinates of the pixel, respectively.
[0088] In some embodiments, the relationship between surface gradient and reflection intensity can be:
[0089]
[0090] Where I is the reflection intensity, p is the x-axis component of the surface gradient, and q is the y-axis component of the surface gradient.
[0091] In some embodiments, the relationship between surface gradient, reflection intensity, grayscale value, first thickness value, and second thickness value can be:
[0092]
[0093] Among them, Z i+1 (x,y) represents the second thickness value, Z i (x,y) represents the first thickness value, I(x,y) represents the reflection intensity of the current pixel, and cos(θ) represents the angle between the light source direction and the surface normal. This is the partial derivative of the reflection intensity with respect to the depth value.
[0094] In some embodiments, before generating three-dimensional text based on the target text point set and the target thickness value, the method may further include:
[0095] Obtain the preset thickness threshold value of points in the target text point set;
[0096] Based on the relationship between the preset thickness value, the thickness threshold, and the height value, the target height value corresponding to the preset thickness threshold and the target preset thickness value is determined and used as the updated target thickness value. The preset thickness value is the target thickness value before the update.
[0097] Based on the relationship between preset thickness value, thickness threshold, and height value, the target height value is determined. The height of the text can be adjusted according to preset conditions to make the generated 3D text more in line with the expected stereoscopic effect.
[0098] In some embodiments, the relationship between the preset thickness value, the thickness threshold, and the height value can be:
[0099]
[0100] Among them, h max The thickness threshold is k, the preset slope parameter is h. i h is the preset thickness value of the i-th vertex, and h is the height value of the i-th vertex.
[0101] In some embodiments, before obtaining the two-dimensional contour path points of the three-dimensional text, the method may further include:
[0102] When the instruction type is curve connection, obtain the target bending control point of the curve;
[0103] Determine the target interpolation point corresponding to the target bending control point based on the relationship between the coordinates of the bending control point and the interpolation point.
[0104] Add the target interpolation point to the two-dimensional contour path point to obtain the updated two-dimensional contour path point.
[0105] Determining the target interpolation point based on the relationship between the curve control point and the interpolation point coordinates helps to smoothly transition curve segments in the case of curve connections, improving the continuity and fluency of the generated text path.
[0106] The target bending control point is a preset value, which can be set as needed.
[0107] In one example, when the instruction is to draw a cubic Bézier curve, the number of target interpolation points is set to n, and the relationship between the coordinates of the bending control points and the interpolation points is as follows:
[0108] P s *m 3 +3*C1*t*m 2 +3*C2*t 2 *m+P e *t 3 =P i
[0109] i / n = t
[0110] 1-t=m
[0111] Among them, P s Starting from point C1, which is the first target bending control point, and point C2, which is the second target bending control point, P... e Let m be the relative position from the end point to the start point, t be the relative position from the start point to the end point, and P be the relative position from the start point to the end point. i Let i be the i-th target interpolation point.
[0112] Figure 8 This application illustrates a three-dimensional text fusion editing apparatus 800, which may include:
[0113] The acquisition module 801 is used to acquire the 3D text to be fused, the 3D model, the text vertex thickness values of the 3D text, and the vertex coordinates and vertex texture coordinates of the 3D model;
[0114] Projection module 802 is used to project the vertices of 3D text onto the triangular mesh of the surface of the 3D model to obtain the coordinates of the projection point;
[0115] The determination module 803 is used to determine the fusion coordinates and texture coordinates of the projection point based on the projection point coordinates, the vertex coordinates of the triangle mesh, the vertex texture coordinates of the triangle mesh, and the text vertex thickness value of the 3D text corresponding to the projection point. The fusion coordinates are the text vertex coordinates of the projection point after the 3D text and the 3D model are fused. The vertex coordinates of the triangle mesh are the vertex coordinates of the 3D model corresponding to the triangle mesh. The vertex texture coordinates of the triangle mesh are the vertex coordinates of the 3D model corresponding to the triangle mesh.
[0116] The editing module 804 is used to edit the 3D model based on the fusion coordinates and texture coordinates of the projection point to obtain a fused model of 3D text and 3D model.
[0117] In some embodiments, the determining module 803 is further configured to determine the face normal of the triangular mesh based on the vertex coordinates of the triangular mesh;
[0118] The determination module 803 is also used to determine the fusion coordinates of the projection point based on the face normal of the triangular mesh, the coordinates of the projection point, and the thickness value of the text vertex of the three-dimensional text corresponding to the projection point;
[0119] The determination module 803 is also used to determine the texture coordinates of the projection point based on the vertex texture coordinates of the triangular mesh.
[0120] In some embodiments, the three-dimensional text fusion editing apparatus 800 may further include:
[0121] The acquisition module 801 is also used to acquire the target text point set and the target background point set of the texture image corresponding to the three-dimensional text;
[0122] The determination module 803 is also used to determine the target texture field distance corresponding to the target text point set and the target background point set based on the relationship between the text point set, the background point set and the field texture distance;
[0123] The determination module 803 is also used to determine the target thickness value of the points in the target text point set based on the target text point set, the target background point set, and the target texture field distance;
[0124] The generation module is used to generate 3D text based on the target text point set and the target thickness value.
[0125] In some embodiments, the three-dimensional text fusion editing apparatus 800 may further include:
[0126] The acquisition module 801 is also used to acquire the text vector data corresponding to the three-dimensional text, which includes the instruction type and vertex position;
[0127] The splitting module is used to split the text vector data according to the instruction type and the preset corresponding rules and store it into an array to obtain the two-dimensional contour path points of the three-dimensional text. Each segment of the array includes the instruction type and the corresponding vertex position.
[0128] The rendering module is used to render two-dimensional contour path points onto a preset texture image to obtain a target text point set and a target background point set. The target text point set is the text pixel set of the texture image, and the target background point set is the background pixel set of the texture image.
[0129] In some embodiments, the three-dimensional text fusion editing apparatus 800 may further include:
[0130] The acquisition module 801 is also used to acquire the preset grayscale values of the points in the target text point set and the target background point set;
[0131] The determination module 803 is also used to determine the target surface gradient corresponding to the target texture field distance based on the relationship between the texture field distance and the surface gradient;
[0132] The determination module 803 is also used to determine the target reflection intensity corresponding to the target surface gradient based on the relationship between the surface gradient and the reflection intensity;
[0133] The determination module 803 is also used to determine the target second thickness value corresponding to the target surface gradient, target reflection intensity, preset gray value and target first thickness value based on the relationship between surface gradient, reflection intensity, gray value, first thickness value and second thickness value, wherein the target first thickness value is the target texture field distance.
[0134] The calculation module is used to take the second target thickness value as the new first target thickness value, and repeatedly calculate the second target thickness value according to the relationship between surface gradient, reflection intensity, gray value, first thickness value and second thickness value until the preset number of times is met, and then take the second target thickness value as the target thickness value.
[0135] In some embodiments, the acquisition module 801 is further configured to acquire a preset thickness threshold of points in the target text point set;
[0136] The determining module 803 is further configured to determine, based on the relationship between the preset thickness value, the thickness value threshold, and the height value, the target height value corresponding to the preset thickness value and the target preset thickness value, as the updated target thickness value, wherein the preset thickness value is the target thickness value before the update.
[0137] In some embodiments, the three-dimensional text fusion editing apparatus 800 may further include:
[0138] The acquisition module 801 is also used to acquire the target bending control point of the curve when the instruction type is curve connection;
[0139] The determination module 803 is also used to determine the target interpolation point corresponding to the target bending control point based on the relationship between the coordinates of the bending control point and the interpolation point;
[0140] The update module is used to add the target interpolation point to the two-dimensional contour path point to obtain the updated two-dimensional contour path point.
[0141] Figure 8 The various modules in the device shown can achieve Figure 1 The various steps involved, and the corresponding technical effects achieved, will not be elaborated upon here for the sake of brevity.
[0142] Figure 9 A schematic diagram of the hardware structure of the terminal device provided in an embodiment of this application is shown.
[0143] The terminal device may include a processor 901 and a memory 902 storing computer program instructions.
[0144] Specifically, the processor 901 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0145] Memory 902 may include mass storage for data or instructions. For example, and not limitingly, memory 902 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 902 may include removable or non-removable (or fixed) media, or memory 902 may be non-volatile solid-state memory. Memory 902 may be internal or external to the integrated gateway disaster recovery device.
[0146] In one example, memory 902 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Thus, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method of three-dimensional text fusion editing according to this disclosure.
[0147] The processor 901 reads and executes computer program instructions stored in the memory 902 to achieve... Figure 1 The method for 3D text fusion and editing in the illustrated embodiment.
[0148] In one example, the terminal device may also include a communication interface 903 and a bus 904. Wherein, for example... Figure 9 As shown, the processor 901, memory 902, and communication interface 903 are connected through bus 904 and complete communication with each other.
[0149] The communication interface 903 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0150] Bus 904 includes hardware, software, or both, that couples components of an end device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 904 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0151] Furthermore, in conjunction with the three-dimensional text fusion and editing methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the three-dimensional text fusion and editing methods in the above embodiments.
[0152] This application also provides a computer program product, including a computer program, which, when executed, implements any of the three-dimensional text fusion editing methods described in the above embodiments.
[0153] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0154] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or text segments used to perform the required tasks. Programs or text segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Text segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0155] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0156] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0157] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for three-dimensional text fusion and editing, characterized in that, include: Obtain the 3D text to be fused, the 3D model, the text vertex thickness values of the 3D text, and the vertex coordinates and vertex texture coordinates of the 3D model; The vertices of the three-dimensional text are projected onto the triangular mesh on the surface of the three-dimensional model to obtain the coordinates of the projection points; Based on the projection point coordinates, the vertex coordinates of the triangular mesh, the vertex texture coordinates of the triangular mesh, and the text vertex thickness value of the 3D text corresponding to the projection point, the fusion coordinates and texture coordinates of the projection point are determined. The fusion coordinates are the text vertex coordinates corresponding to the projection point after the 3D text and the 3D model are fused. The vertex coordinates of the triangular mesh are the vertex coordinates of the 3D model corresponding to the triangular mesh. The vertex texture coordinates of the triangular mesh are the vertex coordinates of the 3D model corresponding to the triangular mesh. The 3D model is edited based on the fusion coordinates and texture coordinates of the projection point to obtain a fusion model of the 3D text and the 3D model.
2. The method for three-dimensional text fusion and editing according to claim 1, characterized in that, The blend coordinates and texture coordinates of the projection point are determined based on the projection point coordinates, the vertex coordinates of the triangular mesh, the vertex texture coordinates of the triangular mesh, and the text vertex thickness value of the 3D text corresponding to the projection point, including: The face normal of the triangular mesh is determined based on the vertex coordinates of the triangular mesh; The fusion coordinates of the projection point are determined based on the face normal of the triangular mesh, the coordinates of the projection point, and the thickness value of the text vertex of the three-dimensional text corresponding to the projection point; The texture coordinates of the projection point are determined based on the vertex texture coordinates of the triangular mesh.
3. The method for three-dimensional text fusion and editing according to claim 1, characterized in that, Before acquiring the 3D text to be fused, the method further includes: Obtain the target text point set and target background point set of the texture image corresponding to the three-dimensional text; The target texture field distance corresponding to the target text point set and the target background point set is determined based on the relationship between the text point set, the background point set, and the field texture distance. The target thickness value of the points in the target text point set is determined based on the target text point set, the target background point set, and the target texture field distance. Three-dimensional text is generated based on the target text point set and the target thickness value.
4. The method for three-dimensional text fusion and editing according to claim 3, characterized in that, The step of obtaining the target text point set and target background point set of the texture image corresponding to the three-dimensional text includes: Obtain the text vector data corresponding to the three-dimensional text, wherein the text vector data includes the instruction type and vertex position; According to the instruction type and the preset corresponding rules, the text vector data is split and stored in an array to obtain the two-dimensional contour path points of the three-dimensional text. Each segment of the array includes the instruction type and the corresponding vertex position. The two-dimensional contour path points are rendered onto a preset texture image to obtain the target text point set and the target background point set. The target text point set is the text pixel set of the texture image, and the target background point set is the background pixel set of the texture image.
5. The method for three-dimensional text fusion and editing according to claim 3, characterized in that, The step of determining the target thickness value of points in the target text point set based on the target text point set, the target background point set, and the target texture field distance includes: Obtain the preset grayscale values of the points in the target text point set and the target background point set; Determine the target surface gradient corresponding to the target texture field distance based on the relationship between texture field distance and surface gradient; Determine the target reflection intensity corresponding to the target surface gradient based on the relationship between the surface gradient and the reflection intensity. The target second thickness value is determined based on the relationship between the surface gradient, reflection intensity, gray value, first thickness value and second thickness value, where the target surface gradient, target reflection intensity, preset gray value and target first thickness value are determined, and the target first thickness value is the target texture field distance. The second target thickness value is used as the new first target thickness value. The second target thickness value is repeatedly calculated based on the relationship between surface gradient, reflection intensity, gray value, first thickness value and second thickness value until the preset number of times is met. The second target thickness value is then used as the target thickness value.
6. The method for three-dimensional text fusion and editing according to claim 3, characterized in that, Before generating three-dimensional text based on the target text point set and the target thickness value, the method further includes: Obtain the preset thickness threshold value of points in the target text point set; Based on the relationship between the preset thickness value, the thickness threshold, and the height value, the target height value corresponding to the preset thickness threshold and the target preset thickness value is determined as the updated target thickness value, wherein the preset thickness value is the target thickness value before the update.
7. The method for three-dimensional text fusion and editing according to claim 4, characterized in that, Before obtaining the two-dimensional contour path points of the three-dimensional text, the method further includes: When the instruction type is curve connection, obtain the target bending control point of the curve; The target interpolation point corresponding to the target bending control point is determined based on the relationship between the coordinates of the bending control point and the interpolation point; The target interpolation point is added to the two-dimensional contour path point to obtain the updated two-dimensional contour path point.
8. A device for three-dimensional text fusion and editing, characterized in that, The device includes: The acquisition module is used to acquire the 3D text to be fused, the 3D model, the text vertex thickness values of the 3D text, and the vertex coordinates and vertex texture coordinates of the 3D model; The projection module is used to project the vertices of the three-dimensional text onto the triangular mesh on the surface of the three-dimensional model to obtain the coordinates of the projection point; The determination module is used to determine the fusion coordinates and texture coordinates of the projection point based on the projection point coordinates, the vertex coordinates of the triangular mesh, the vertex texture coordinates of the triangular mesh, and the text vertex thickness value of the three-dimensional text corresponding to the projection point. The fusion coordinates are the text vertex coordinates corresponding to the projection point after the three-dimensional text and the three-dimensional model are fused. The vertex coordinates of the triangular mesh are the vertex coordinates of the three-dimensional model corresponding to the triangular mesh. The vertex texture coordinates of the triangular mesh are the vertex coordinates of the three-dimensional model corresponding to the triangular mesh. The editing module is used to edit the 3D model according to the fusion coordinates and texture coordinates of the projection point to obtain a fusion model of the 3D text and the 3D model.
9. A terminal device, characterized in that, The device includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the three-dimensional text fusion editing method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the three-dimensional text fusion editing method as described in any one of claims 1-7.
11. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the three-dimensional text fusion editing method as described in any one of claims 1-7.