Three-dimensional model vertex stretching method and system based on a smooth step function
By using a 3D model vertex stretching method based on a smooth step function, the problem of abrupt transitions in edge regions caused by traditional stretching methods is solved, achieving natural gradations and multi-directional stretching, thus improving the realism of graphics rendering and the interactive experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ADSS DEV
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional vertex stretching methods tend to produce abrupt visual effects in edge transition areas, lacking naturalness and smoothness. Existing technologies often rely on fixed thresholds to control stretching intensity, making it impossible to dynamically adjust according to distance changes, resulting in insufficient deformation precision and affecting user experience.
A three-dimensional model vertex stretching method based on a smooth step function is adopted. By specifying the stretching center point, the Euclidean distance between the vertex and the center point is calculated. The smooth step function is called to calculate the stretching strength factor, and the model scaling factor is combined for normalization processing to record the degree of deformation.
It achieves a natural gradient effect for vertices within the stretching area, avoiding abruptness, supports multi-directional stretching, adapts to arbitrary topological structures, and enhances the realism of graphics rendering and interactive experience.
Smart Images

Figure CN122244398A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of 3D data processing technology, and in particular to a method and system for stretching 3D model vertices based on a smooth step function. Background Technology
[0002] In 3D graphics rendering and modeling, it is often necessary to perform local deformation operations on the model based on user interaction or program logic, such as simulating haptic feedback, collision deformation, and expression-driven operations. Traditional vertex stretching methods usually use linear interpolation or direct displacement. Although this method is simple to implement, it is prone to producing abrupt visual effects in edge transition areas, lacking naturalness and smoothness.
[0003] Furthermore, existing technologies often rely on fixed thresholds to control tensile strength, which cannot be dynamically adjusted according to changes in distance, resulting in insufficient precision in deformation and affecting user experience.
[0004] Therefore, there is an urgent need for a technical solution that can smoothly and controllably stretch model vertices in three-dimensional space to improve the realism of graphics rendering and the quality of interactive experience. Summary of the Invention
[0005] This specification provides one or more embodiments of a method for stretching vertices of a 3D model based on a smooth step function, including: Specify a stretching center point in three-dimensional space, and based on the transformation matrix of the current three-dimensional model, transform the stretching center point to its actual position in the world coordinate system using the transformation matrix. Traverse all vertices of the three-dimensional model, transform each vertex using the transformation matrix, and calculate the Euclidean distance between each vertex and the stretching center point; Based on a preset stretching threshold, for vertices whose Euclidean distance to the stretching center point is less than the threshold, a smoothing step function is called to calculate the corresponding tensile strength factor based on the distance. Based on the tensile strength factor and the preset tensile direction strength parameters, the coordinates of the vertex are offset and normalized by combining the model scaling factor. Based on the comparison between the offset vertex coordinates and the original backup coordinates, update the vertex's additional attributes to record the degree of deformation.
[0006] Furthermore, the tensile strength factor ranges from [0, 1], approaching 0 near the center of the tension and gradually approaching 1 away from the center of the tension.
[0007] Furthermore, the tensile strength parameters include a first strength parameter controlling the vertical stretching and a second strength parameter controlling the horizontal stretching.
[0008] Furthermore, the offset calculation of the vertex coordinates includes: The offset of the vertex in the Y-axis direction is calculated based on the first strength parameter and the tensile strength factor; The offset of the vertex in the Z-axis direction is calculated based on the second strength parameter and the tensile strength factor.
[0009] Furthermore, the additional attribute is a fourth component of the vertex coordinates, used to accumulate and store the deformation amplitude of the vertex, and the fourth component includes the discovery length or texture offset.
[0010] Furthermore, the specific method for recording the degree of deformation is as follows: Calculate the length of the difference vector between the stretched vertex coordinates and the backup coordinates, and add this length to the fourth component.
[0011] Furthermore, the stretching threshold is dynamically set based on the size of the three-dimensional model and the required stretching influence range.
[0012] This specification provides one or more embodiments of a three-dimensional model vertex stretching system based on a smooth step function, including: Center point definition module: Used to specify a stretching center point in three-dimensional space. Based on the transformation matrix of the current three-dimensional model, the stretching center point is transformed to its actual position in the world coordinate system through the transformation matrix. Distance calculation module: used to traverse all vertices of the 3D model, transform each vertex using the transformation matrix, and calculate the Euclidean distance between each vertex and the extrusion center point; Tensile strength factor calculation module: Based on a preset tensile threshold, for vertices whose Euclidean distance from the tensile center point is less than the threshold, the module calls a smooth step function to calculate the corresponding tensile strength factor. Vertex stretching module: used to calculate the offset of the vertex coordinates according to the stretching strength factor and the preset stretching direction strength parameters, and to perform normalization processing in combination with the model scaling factor; Deformation Recording Module: Used to update the additional attributes of vertices to record the degree of deformation based on the comparison between the offset vertex coordinates and the original backup coordinates.
[0013] This specification provides one or more embodiments of an electronic device, including: Processor; and, A memory is configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the above-described method for stretching vertexes of a 3D model based on a smooth step function.
[0014] This specification provides one or more embodiments of a storage medium for storing computer-executable instructions that, when executed, implement the steps of the above-described method for stretching vertex 3D models based on a smooth step function.
[0015] By introducing a smooth step function, this invention enables vertices to exhibit a natural gradient effect within the stretching region, avoiding the abruptness of traditional linear stretching. It can automatically adjust the stretching intensity based on distance, supports multi-directional stretching, and adapts to various application scenarios. It is suitable for mesh models with arbitrary topologies, requiring no preprocessing or complex configuration. The stretching direction, intensity, and radius of effect can be flexibly adjusted, facilitating integration into various 3D engines or graphics systems. It achieves natural transition deformation of vertices within a specified region, enhancing the realism and interactive experience of graphics rendering.
[0016] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a method for stretching vertices of a 3D model based on a smooth step function, provided for one or more embodiments of this specification; Figure 2 A schematic diagram illustrating the composition of a three-dimensional model vertex stretching system based on a smooth step function, provided for one or more embodiments of this specification; Figure 3 This is a schematic diagram of the structure of an electronic device provided for one or more embodiments of this specification. Detailed Implementation
[0019] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.
[0020] Method Implementation Examples According to an embodiment of the present invention, a method for stretching vertices of a three-dimensional model based on a smooth step function is provided. Figure 1 A flowchart illustrating a method for stretching vertices of a 3D model based on a smooth step function, provided for one or more embodiments of this specification, is shown below. Figure 1 As shown, the vertex stretching method for a 3D model based on a smooth step function according to an embodiment of the present invention specifically includes: S1. Specify a stretching center point in three-dimensional space, and based on the transformation matrix of the current three-dimensional model, transform the stretching center point to its actual position in the world coordinate system using the transformation matrix.
[0021] In 3D space, the extrusion center point refers to a user-specified or pre-defined 3D coordinate point, typically located within the model's local coordinate system or object space. It marks the core location of the deformation-affected area. The transformation matrix of the current 3D model integrates translation, rotation, and scaling operations. By multiplying the center point coordinates with this matrix, the model's local coordinate system is transformed to the world coordinate system.
[0022] S2. Traverse all vertices of the three-dimensional model, transform each vertex using the transformation matrix, and calculate the Euclidean distance between each vertex and the stretching center point.
[0023] Each vertex constituting the model mesh is accessed and processed sequentially to ensure that the deformation operation covers the entire geometry of the model. The vertices are transformed by using the same model transformation matrix as the center point transformation, mapping them from the local coordinate system to the world coordinate system, so that the vertices and the center point are in the same spatial reference system. In the world coordinate system, for each transformed vertex, the straight-line distance between its three-dimensional coordinates and the transformed center point coordinates is calculated.
[0024] S3. Based on the preset stretching threshold, for vertices whose Euclidean distance to the stretching center point is less than the threshold, the corresponding tensile strength factor is calculated by calling the smooth step function based on the distance.
[0025] The preset stretch threshold defines the spatial radius of the deformation effect. Vertices falling within this area participate in subsequent deformation calculations. This threshold is not a fixed value, but is dynamically set according to the size of the 3D model and the required stretch influence range.
[0026] For each vertex within the region, a smoothing step function is invoked based on the distance to calculate the corresponding stretching strength factor. The smoothing step function takes the vertex distance as input and maps it to a stretching strength factor between 0 and 1. When the vertex distance is 0, i.e., it is located at the center, the strength factor is 0. As the distance increases towards the threshold, the strength factor smoothly transitions to 1. This means that when the strength factor is close to 0, i.e., the vertex is close to the center, the stretching weight is close to 1, and the deformation strength is maximum; when the strength factor is close to 1, i.e., the vertex is close to the edge of the affected region, the stretching weight is close to 0, and the deformation strength is minimum.
[0027] S4. Based on the tensile strength factor and the preset tensile direction strength parameters, the coordinates of the vertex are offset and normalized by combining the model scaling factor.
[0028] The tensile strength parameters include a first strength parameter controlling the vertical stretching and a second strength parameter controlling the horizontal stretching. The offset calculation of the vertex coordinates includes: The offset of the vertex in the Y-axis direction is calculated based on the first strength parameter and the tensile strength factor; the offset of the vertex in the Z-axis direction is calculated based on the second strength parameter and the tensile strength factor.
[0029] S5. Based on the comparison between the offset vertex coordinates and the original backup coordinates, update the additional attributes of the vertex to record the degree of deformation.
[0030] Comparing the offset vertex coordinates with the original backup coordinates is crucial for quantifying the actual deformation physical displacement. The original backup coordinates refer to the copies of the vertex's initial position saved before the deformation process begins. By comparing the new coordinates after deformation with the backup coordinates, the absolute amount of movement of each vertex in 3D space can be calculated. Updating the vertex's additional attributes to record the degree of deformation means persistently storing the quantified amplitude information in the model data. Here, the additional attributes specifically refer to the fourth component of the vertex data structure, used to accumulate and store the vertex's deformation amplitude. This fourth component includes the discovery length or texture offset.
[0031] The specific method for recording the degree of deformation is as follows: calculate the length of the aforementioned difference vector to obtain a scalar value representing the displacement of this deformation, and then add this value to the existing value of the fourth component of the vertex.
[0032] The beneficial effects of this invention are as follows: By introducing a smooth step function, vertices exhibit a natural gradient effect within the stretching region, avoiding the abruptness of traditional linear stretching. It can automatically adjust the stretching intensity based on distance, supports multi-directional stretching, and adapts to various application scenarios. It is suitable for mesh models with arbitrary topology without the need for preprocessing or complex configuration. The stretching direction, intensity, and radius of effect can all be flexibly adjusted, facilitating integration into various 3D engines or graphics systems. It achieves natural transition deformation of vertices within a specified region, enhancing the realism and interactive experience of graphics rendering.
[0033] System Implementation Examples According to embodiments of the present invention, a three-dimensional model vertex stretching system based on a smooth step function is provided. Figure 3 A schematic diagram illustrating the composition of a three-dimensional model vertex stretching system based on a smooth step function, provided for one or more embodiments of this specification, is shown below. Figure 3 As shown, the 3D model vertex stretching system based on a smooth step function according to an embodiment of the present invention specifically includes: Center point definition module 20: used to specify a stretching center point in three-dimensional space, and based on the transformation matrix of the current three-dimensional model, transform the stretching center point to its actual position in the world coordinate system through the transformation matrix; Distance calculation module 22: used to traverse all vertices of the three-dimensional model, transform each vertex using the transformation matrix, and calculate the Euclidean distance between each vertex and the stretching center point; Tensile strength factor calculation module 24: is used to calculate the corresponding tensile strength factor for vertices whose Euclidean distance from the tensile center point is less than the preset tensile threshold by calling a smooth step function based on the distance. Vertex stretching module 26: used to calculate the offset of the vertex coordinates according to the stretching strength factor and the preset stretching direction strength parameter, and to perform normalization processing in combination with the model scaling factor; Deformation Recording Module 28: Used to update the additional attributes of vertices to record the degree of deformation based on the comparison results between the offset vertex coordinates and the original backup coordinates.
[0034] The embodiments of the present invention are system embodiments corresponding to the above method embodiments. The specific operation of each module can be understood by referring to the description of the method embodiments, and will not be repeated here.
[0035] Device Example 1 This invention provides an electronic device, such as... Figure 3 As shown, it includes: a memory 30, a processor 32, and a computer program stored in the memory 30 and executable on the processor 32. When the computer program is executed by the processor 32, it performs the following method steps: S1. Specify a stretching center point in three-dimensional space, and based on the transformation matrix of the current three-dimensional model, transform the stretching center point to its actual position in the world coordinate system using the transformation matrix; S2. Traverse all vertices of the three-dimensional model, transform each vertex using the transformation matrix, and calculate the Euclidean distance between each vertex and the stretching center point; S3. Based on the preset stretching threshold, for vertices whose Euclidean distance to the stretching center point is less than the threshold, the corresponding tensile strength factor is calculated by calling the smooth step function based on the distance; S4. Based on the tensile strength factor and the preset tensile direction strength parameters, the coordinates of the vertex are offset and normalized by combining the model scaling factor. S5. Based on the comparison between the offset vertex coordinates and the original backup coordinates, update the additional attributes of the vertex to record the degree of deformation.
[0036] Device Example 2 This invention provides a computer-readable storage medium storing an information transmission implementation program. When executed by a processor 32, the program performs the following method steps: S1. Specify a stretching center point in three-dimensional space, and based on the transformation matrix of the current three-dimensional model, transform the stretching center point to its actual position in the world coordinate system using the transformation matrix; S2. Traverse all vertices of the three-dimensional model, transform each vertex using the transformation matrix, and calculate the Euclidean distance between each vertex and the stretching center point; S3. Based on the preset stretching threshold, for vertices whose Euclidean distance to the stretching center point is less than the threshold, the corresponding tensile strength factor is calculated by calling the smooth step function based on the distance; S4. Based on the tensile strength factor and the preset tensile direction strength parameters, the coordinates of the vertex are offset and normalized by combining the model scaling factor. S5. Based on the comparison between the offset vertex coordinates and the original backup coordinates, update the additional attributes of the vertex to record the degree of deformation.
[0037] The computer-readable storage media described in this embodiment include, but are not limited to, ROM, RAM, disk, or optical disk.
[0038] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for stretching vertices of a 3D model based on a smooth step function, characterized in that, include: Specify a stretching center point in three-dimensional space, and based on the transformation matrix of the current three-dimensional model, transform the stretching center point to its actual position in the world coordinate system using the transformation matrix. Traverse all vertices of the three-dimensional model, transform each vertex using the transformation matrix, and calculate the Euclidean distance between each vertex and the stretching center point; Based on a preset stretching threshold, for vertices whose Euclidean distance to the stretching center point is less than the threshold, a smoothing step function is called to calculate the corresponding tensile strength factor based on the distance. Based on the tensile strength factor and the preset tensile direction strength parameters, the coordinates of the vertex are offset and normalized by combining the model scaling factor. Based on the comparison between the offset vertex coordinates and the original backup coordinates, update the vertex's additional attributes to record the degree of deformation.
2. The method according to claim 1, characterized in that, The tensile strength factor ranges from [0, 1], approaching 0 near the center of the tension and gradually approaching 1 away from the center of the tension.
3. The method according to claim 1, characterized in that, The tensile strength parameters include a first strength parameter that controls the vertical tension and a second strength parameter that controls the horizontal tension.
4. The method according to claim 3, characterized in that, The offset calculation of the vertex coordinates includes: The offset of the vertex in the Y-axis direction is calculated based on the first strength parameter and the tensile strength factor; The offset of the vertex in the Z-axis direction is calculated based on the second strength parameter and the tensile strength factor.
5. The method according to claim 1, characterized in that, The additional attribute is the fourth component of the vertex coordinates, used to accumulate and store the deformation amplitude of the vertex. The fourth component includes the discovery length or texture offset.
6. The method according to claim 5, characterized in that, The specific method for recording the degree of deformation is as follows: Calculate the length of the difference vector between the stretched vertex coordinates and the backup coordinates, and add this length to the fourth component.
7. The method according to claim 1, characterized in that, The stretching threshold is dynamically set based on the size of the 3D model and the required stretching influence range.
8. A vertex stretching system for a three-dimensional model based on a smooth step function, characterized in that, include: Center point definition module: Used to specify a stretching center point in three-dimensional space. Based on the transformation matrix of the current three-dimensional model, the stretching center point is transformed to its actual position in the world coordinate system through the transformation matrix. Distance calculation module: used to traverse all vertices of the 3D model, transform each vertex using the transformation matrix, and calculate the Euclidean distance between each vertex and the extrusion center point; Tensile strength factor calculation module: Based on a preset tensile threshold, for vertices whose Euclidean distance from the tensile center point is less than the threshold, the module calls a smooth step function to calculate the corresponding tensile strength factor. Vertex stretching module: used to calculate the offset of the vertex coordinates according to the stretching strength factor and the preset stretching direction strength parameters, and to perform normalization processing in combination with the model scaling factor; Deformation Recording Module: Used to update the additional attributes of vertices to record the degree of deformation based on the comparison between the offset vertex coordinates and the original backup coordinates.
9. An electronic device, characterized in that, include: processor; as well as, A memory configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the three-dimensional model vertex stretching method based on a smooth step function as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, Used to store computer-executable instructions, which, when executed, implement the steps of the three-dimensional model vertex stretching method based on a smooth step function as described in any one of claims 1 to 7.