WO2023185228A1 - 网格模型处理方法、装置、设备以及存储介质 - Google Patents

网格模型处理方法、装置、设备以及存储介质 Download PDF

Info

Publication number
WO2023185228A1
WO2023185228A1 PCT/CN2023/073411 CN2023073411W WO2023185228A1 WO 2023185228 A1 WO2023185228 A1 WO 2023185228A1 CN 2023073411 W CN2023073411 W CN 2023073411W WO 2023185228 A1 WO2023185228 A1 WO 2023185228A1
Authority
WO
WIPO (PCT)
Prior art keywords
vertex
corner
spline
target value
vector
Prior art date
Application number
PCT/CN2023/073411
Other languages
English (en)
French (fr)
Inventor
郭政扬
李银
侯鸿宇
易武军
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2023185228A1 publication Critical patent/WO2023185228A1/zh
Priority to US18/383,250 priority Critical patent/US20240054728A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • G06T17/205Re-meshing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/10Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20161Level set
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/04Architectural design, interior design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/20Indexing scheme for editing of 3D models
    • G06T2219/2021Shape modification

Definitions

  • Embodiments of the present application relate to the field of computer graphics of artificial intelligence, and more specifically, to mesh model processing methods, devices, equipment and storage media.
  • Free-Form Deformation FLD
  • Free-Form Deformation is a commonly used deformation method, and its method is roughly as follows: on a given static mesh In the bounding box of the grid, a total of m*n*k lattices in m layers, n rows and k columns are evenly selected as control points. When the position of the control point changes, the position of each vertex on the static mesh is usually recalculated according to Bernstein polynomial interpolation; Lattice Deformer is usually used to handle elastic deformation, and its operation method is similar to FFD Similarly, the lattice is uniformly selected as the control point in the bounding box.
  • FFD Free-Form Deformation
  • Embodiments of the present application provide a mesh model processing method, device, equipment and storage medium, which can make the distance between the first vector and at least one first spline at the first corner after the first corner deforms to the second corner.
  • the positional relationship is the same as the positional relationship between the second vertex under the second corner and the spline passing through the control point used to control the second corner.
  • it is beneficial to realize the second corner on the second mesh model and The connecting surface between the walls is still perpendicular to the wall.
  • the thickness of the wall on the second grid model is the same as the thickness of the wall on the first grid model.
  • the second corner on the second grid model is the same as the wall. There are no cracks or gaps between them.
  • embodiments of the present application provide a grid model processing method, including:
  • Obtain a first mesh model which includes a first corner and a first vertex
  • the first vector is a vector from the first control point to the first vertex
  • the at least A first spline is a line passing through the first control point and used to characterize the outline of the first mesh model
  • the vertex coordinates of the second vertex is the vertex corresponding to the first vertex after the first corner is transformed into the second corner;
  • a second mesh model under the second corner is determined.
  • embodiments of the present application provide a grid model processing device, including:
  • An acquisition unit used to acquire a first mesh model, where the first mesh model includes a first corner and a first vertex;
  • a first determination unit configured to obtain the second rotation angle in response to an operation performed by the user on the first control point used to control the first rotation angle on the display interface
  • the second determination unit is configured to determine at least one target value corresponding to the first corner based on the positional relationship between the first vector and the at least one first spline, the first vector being the first control point to the third spline.
  • a vector of vertices, the at least one first spline is a line passing through the first control point and used to represent the outline of the first mesh model;
  • a third determination unit configured to determine at least one target value corresponding to the first rotation angle and at least one target value corresponding to the second rotation angle;
  • the fourth determination unit is configured to determine the vertex coordinates of a second vertex based on at least one target value corresponding to the second corner, the second vertex corresponding to the first vertex after the first corner is transformed into the second corner. vertex;
  • the fifth determination unit is used to determine the second mesh model under the second corner based on the vertex coordinates of the second vertex.
  • an electronic device including:
  • a processor adapted to execute a computer program
  • a computer-readable storage medium stores a computer program, and the computer program is loaded by the processor and executes the method of the first aspect.
  • embodiments of the present application provide a computer-readable storage medium.
  • the computer-readable storage medium stores computer instructions.
  • the computer instructions When the computer instructions are read and executed by a processor of a computer device, the computer device executes the above-mentioned step.
  • At least one target value corresponding to the first corner is determined as at least one target value corresponding to the second corner, and based on at least one target value corresponding to the second corner, the vertex of the second vertex is determined. Coordinates that can deform the first corner to the second corner, the positional relationship between the first vector and at least one first spline under the first corner, and the second vertex and the process under the second corner are used to control the second The positional relationship between the splines of the corner control points is the same. Furthermore, it is beneficial to realize the connection surface between the second corner and the wall on the second grid model, and the wall is still perpendicular to the second grid model.
  • the wall thickness on the grid model is the same as the wall thickness on the first grid model, and there are no cracks or penetrations between the second corner on the second grid model and the wall.
  • the solution provided by this application only requires the user to perform operations on the first control point used to control the first corner on the display interface to generate the second corner.
  • the second grid model has fewer user operation steps and is simple and convenient to use; and the solution of this application only needs to input a grid model, and the rotation angle of the first grid model can be adjusted to any angle between 0° and 180°. deformation to obtain a grid model at any angle, which not only improves the reuse rate of the model, but also saves art costs and improves art production efficiency.
  • Figure 1 is a schematic diagram of the Valletta Fortress in Malta provided by the embodiment of the present application.
  • Figure 2 is a schematic diagram of a star-shaped fortress constructed according to an embodiment of the present application.
  • Figure 3 is a schematic diagram of using corners to connect two thick walls according to an embodiment of the present application.
  • Figure 4 is a schematic comparison diagram of the mesh model before and after corner deformation in the existing solution provided by the embodiment of the present application.
  • Figure 5 is a schematic diagram of the relationship between the corner and the wall before and after corner deformation in the existing solution provided by the embodiment of the present application.
  • Figure 6 is a flow chart of a grid model processing method provided by an embodiment of the present application.
  • Figure 7 is provided by the embodiment of the present application, considering that the positional relationship between the first vector and at least one first spline remains unchanged before and after the corner deformation, and the existing solution does not consider the positional relationship to be unchanged. Rendering of mesh model for comparison.
  • Figure 8 is an example of at least one target value corresponding to the first corner provided by the embodiment of the present application on the grid model.
  • FIG. 9 is a schematic diagram of dividing the first grid model into hierarchies according to the embodiment of the present application.
  • Figure 10 is provided by an embodiment of the present application. Considering that the number of pixels per unit length in the texture after corner deformation is the same as the number of pixels per unit length in the texture before corner deformation, the generated second mesh model is the same as the generated second grid model. Comparative renderings of the second mesh model generated with unchanged texture before and after corner deformation in one scheme.
  • Figure 11 is a rendering of the corner deformation on the multi-level corner model provided by the embodiment of the present application.
  • Figure 12 is a rendering of the corner deformation of the corner model with an inclined surface provided by the embodiment of the present application.
  • Figure 13 is an effect diagram after corner deformation on a corner model with multiple levels of structure and inclined surfaces provided by the embodiment of the present application.
  • Figure 14 is another flow chart of the grid model processing method provided by the embodiment of the present application.
  • Figure 15 is a schematic block diagram of a grid model processing device provided by an embodiment of the present application.
  • Figure 16 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the angle between two adjacent spline segments in the spline also varies. It may not be the standard 90°.
  • some of the angles between two adjacent spline segments are obtuse angles close to 180°, and some are between two adjacent spline segments.
  • the angle is greater than 180°.
  • Another example is the architectural star-shaped fortress shown in Figure 2, also known as a star fortress or bastion. The corners of its walls include relatively sharp angles and angles greater than 180°.
  • the common building process generation idea is: first, make several standardized wall modules, and then splice and stack them according to certain rules and methods, and finally form a complete building.
  • This idea can greatly improve the reusability rate, and under the premise of given patches, through different splicing, placement and stacking methods, buildings with different shapes but consistent styles can be generated.
  • the walls on the building are thick, the walls cannot be connected perfectly and must be connected by adding corners; for example, as shown in Figure 3, the two sides with thickness are on the left Wall, the right side shows the two walls after adding a corner connection; since buildings in real scenes and in game scenes have different shapes, the angles between two adjacent walls are often different.
  • the current Free-Form Deformation (FFD) method and Lattice Deformer method of corner deformation are not applicable in architectural scenes; among them, the free-form deformation method serves as a smooth and elastic transformation method.
  • the rigid relationship on the static mesh cannot be guaranteed during the deformation process; for example, as shown in Figure 4, for the first target on the static mesh, the left side is the first target on the static mesh before corner deformation. , the right side is the first target on the static mesh after the corner deformation, as shown on the right side of Figure 4.
  • the rigid relationship between the first target and the wall changes; among them, the rigidity Relationships include but are not limited to, three points are collinear, two lines are parallel, four points are coplanar, two lines are perpendicular, etc.
  • three-point collinearity refers to the three points on the mesh body that are collinear before the corner deformation, and the three points are still collinear after the corner deformation; two lines are parallel refers to the two parallel lines on the mesh body before the corner deformation.
  • the two lines are still parallel after the corner deformation;
  • the four-point coplanarity refers to the two coplanar patches on the mesh body before the corner deformation, and the two patches are still coplanar after the corner deformation;
  • the two lines are perpendicular to the corner deformation.
  • the two vertical lines on the front mesh remain vertical after the corner deformation. Since the above-mentioned rigid relationship between the first target and the wall cannot be maintained, the first target is no longer perpendicular to the left wall after the corner deformation, and the first target is stretched.
  • connection surface between the corner and the wall is no longer perpendicular to the wall after the corner deformation, geometric gaps or overlaps will occur between the corner and the wall; for example, as shown in Figure 5 on the left before the corner deformation.
  • the connecting surface between the corner and the wall is perpendicular to the wall, and the connecting surface does not overlap with the wall.
  • the connection surface between the corner and the wall is no longer perpendicular to the wall; and the connection surface overlaps with the wall.
  • the lattice deformation scheme has the same problems as the free deformation scheme, and both schemes will change the thickness of the wall after corner deformation. Therefore, the two corner deformation methods of free deformation and lattice deformation are not suitable for Corner deformation on buildings.
  • FFD is a deformation method that changes the shape of the model by pulling control points. It mainly recalculates the deformation of the model shape through the changes in the position of the control points before and after the control points are pulled; the deformation methods of Lattice Deformer and FFD are the same. , both change the shape of the model through control points. The difference between the two lies in the calculation process and method of deformation.
  • this application provides a mesh model processing solution that can control the positional relationship between the vector from the control point of the corner deformation to any vertex on the mesh body and the spline passing through the control point before and after the corner deformation. At least one of the determined values is the same, which is equivalent to considering that the mesh body still needs to satisfy the above-mentioned rigid relationships of three points being collinear, two lines being parallel, four points being coplanar, and two lines being perpendicular after corner deformation, which is beneficial to after corner deformation. , to achieve that the connection surface between the corner and the wall on the grid is perpendicular to the wall, the thickness of the wall does not change, and there are no cracks or overlap between the corner and the wall.
  • AI artificial intelligence
  • a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
  • artificial intelligence is a comprehensive technology of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence.
  • Artificial intelligence is the study of the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making.
  • the grid model processing method provided by the embodiments of the present application can be implemented through artificial intelligence methods.
  • artificial intelligence technology is a comprehensive subject that covers a wide range of fields, including both hardware-level technology and software-level technology.
  • Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, mechatronics and other technologies.
  • Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
  • artificial intelligence technology has been researched and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless driving, autonomous driving, and drones. , robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
  • Embodiments of the present application may involve computer vision (CV) technology in artificial intelligence technology.
  • Computer vision is a science that studies how to make machines "see”. Furthermore, it refers to using cameras and computers to replace human eyes. Machine vision is used to identify, monitor and measure targets, and further performs graphic processing, so that computer processing becomes an image more suitable for human eye observation or transmitted to instruments for detection.
  • Computer vision studies related theories and technologies trying to build artificial intelligence systems that can obtain information from images or multi-dimensional data.
  • Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content/behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, etc.
  • CV technology can be used to realize the grid model processing method and image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantics Understanding, video content/behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality and other related functions.
  • Embodiments of this application may also relate to machine learning (ML) in artificial intelligence technology.
  • ML is a multi-field interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. Subject. It specializes in studying how computers can simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structures to continuously improve their performance.
  • Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications cover all fields of artificial intelligence.
  • Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, teaching learning and other technologies.
  • the grid model involved in the embodiment of the present application can be trained through ML technology.
  • Embodiments of the present application may also relate to the field of computer graphics;
  • computer graphics is a science that uses mathematical algorithms to convert two-dimensional or three-dimensional graphics into a grid form for a computer display.
  • the main research content of computer graphics is to study how to represent graphics in computers and the related principles and algorithms of using computers to calculate, process and display graphics.
  • Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize data calculation, storage, processing, and sharing.
  • Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool and use it on demand, which is flexible and convenient. Cloud computing technology will become an important support.
  • the background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data at different levels will be processed separately, and all types of industry data need to be powerful. System backing support can only be achieved through cloud computing.
  • Cloud gaming also known as gaming on demand, is an online gaming technology based on cloud computing technology. Cloud gaming technology enables thin clients with relatively limited graphics processing and data computing capabilities to run high-quality games.
  • the game is not played on the player's game terminal, but runs on the cloud server, and the cloud server renders the game scene into a video and audio stream, which is transmitted to the player's game terminal through the network.
  • Player game terminals do not need to have powerful graphics computing and data processing capabilities. They only need to have basic streaming media playback capabilities and the ability to obtain player input instructions and send them to the cloud server.
  • Distance maintenance that is, the distance between certain points on the grid model remains unchanged before and after the corner deformation.
  • Angle conformance that is, the angle between certain line segments on the grid model remains unchanged before and after the corner deformation.
  • the application scenarios of this application include but are not limited to the construction of buildings in virtual scenes such as 3D games/3D film and television works/short videos.
  • the solution provided by this application can be applied to the effect conversion from standard building corners to specific building corners in 3D game scenes.
  • using the solution provided by this application can not only save the time of the game screen
  • the production cost and rendering cost are reduced, and the mesh model obtained by using the mesh model processing method provided by this application maintains the rigid relationship of the mesh model before and after corner deformation, making the mesh model after corner deformation more realistic and improving user understanding. Game playing experience.
  • Figure 6 is a flow chart of the grid model processing method 100 provided by the embodiment of the present application.
  • the grid model processing method 100 can be executed by any electronic device with data processing capabilities.
  • the electronic device can be a terminal device.
  • the terminal device includes but is not limited to mobile phones, tablet computers, notebook computers, PDAs, Mobile Internet device (mobile internet device, MID) or other terminal device with display function.
  • the electronic device can also be a server.
  • the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also provide cloud services, cloud databases, cloud computing, cloud functions, and cloud storage. , network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • the grid model processing method provided by this application will be described below by taking a grid model processing device as an example.
  • the method 100 may include some or all of the following:
  • the first vector is a vector from the first control point to the first vertex
  • the at least one first spline is a line passing through the first control point and used to characterize the outline of the first mesh model
  • S104 Determine at least one target value corresponding to the first rotation angle and at least one target value corresponding to the second rotation angle;
  • S105 Based on at least one target value corresponding to the second corner, determine the vertex coordinates of the second vertex; the second vertex is the vertex corresponding to the first vertex after the first corner is transformed into the second corner;
  • the first mesh model made by the user in three-dimensional (3D) modeling software is obtained, and in response to the drag operation performed by the user on the first control point on the display interface, the first corner is transformed into the third Two corners.
  • the included angle of the first turning angle before dragging may be 90°
  • the included angle of the second turning angle after dragging may be any angle between 0° and 180°.
  • the included angle of the first rotation angle can also be any angle between 0° and 180°, which is not specifically limited in this application.
  • the user may select the first control point and input the included angle of the second corner to obtain the second corner.
  • the first vertex can be any vertex on the first mesh model.
  • At least one target value corresponding to the first corner is determined as at least one target value corresponding to the second corner, and based on at least one target value corresponding to the second corner, the vertex of the second vertex is determined. Coordinates that can deform the first corner to the second corner, the positional relationship between the first vector and at least one first spline under the first corner, and the second vertex and the process under the second corner are used to control the second The positional relationship between the splines of the corner control points is the same. Furthermore, it is beneficial to realize the connection surface between the second corner and the wall on the second grid model, and the wall is still perpendicular to the second grid model.
  • the wall thickness on the grid model is the same as the wall thickness on the first grid model, and there are no cracks or penetrations between the second corner on the second grid model and the wall.
  • the solution provided by this application only requires the user to perform operations on the first control point used to control the first corner on the display interface to generate the second corner.
  • the second grid model has fewer user operation steps and is simple and convenient to use; and the solution of this application only needs to input a grid model, and the rotation angle of the first grid model can be adjusted to any angle between 0° and 180°. deformation to obtain a grid model at any angle, which not only improves the reuse rate of the model, but also saves art costs and improves art production efficiency.
  • the grid model processing solution of this application since the grid model processing solution of this application only needs to input one grid model, the corner of the first grid model can be deformed at any angle between 0° and 180°, and we get For grid models at any corner, for buildings with different game scene shapes but consistent styles, the grid model processing solution provided by this application eliminates the need to construct grid models at different angles at the same corner, improving the grid model in game scenes. The reuse rate saves game screen production costs and rendering costs.
  • the grid model after deformation of the building corners in the game scene will not appear deformation, interspersion, cracks, etc., improving the user's gaming experience.
  • Figure 7 is provided by the embodiment of the present application, considering that the positional relationship between the first vector and at least one first spline remains unchanged before and after the corner deformation, and the existing solution does not consider the positional relationship to be unchanged. Rendering of mesh model for comparison.
  • the left side is the second grid model generated by considering that the positional relationship between the first vector and at least one first spline remains unchanged before and after the corner deformation.
  • the corner sum of the second grid model is The connecting surface of the wall is not cracked and is perpendicular to the wall; the right side is generated in the existing scheme without considering that the positional relationship between the first vector and at least one first spline remains unchanged before and after the corner deformation.
  • the second grid model, the connection surface between the corner and the wall on the second grid model is cracked and not perpendicular to the wall.
  • S103 may include:
  • the first component is a component perpendicular to a spline close to the first vertex among the at least one first spline, and the at least one first spline is a plurality of first splines, and the The first horizontal plane is a horizontal plane formed by the plurality of first splines, and at least one target value corresponding to the first corner includes the first target value.
  • Figure 8 is an example of at least one target value corresponding to the first rotation angle provided by the embodiment of the present application on the grid model; as shown in Figure 8, assume that P 0 is the first value used to control the first rotation angle. Control point, P 1 is the first vertex on the first mesh model, and at least one first spline passing through P 0 is x 1 , x 2 ; among them, the spline close to the first vertex is x 2 , P vector from 0 to P 1 is the first vector above, is the first vector The component of the vertical spline x 2 in the first horizontal plane formed by the splines x 1 , x 2 .
  • determining the modulus of the first component of the first vector in the first horizontal plane as the first target value is equivalent to using at least one first spline when determining the first target value.
  • the angle bisector divides the first grid model into left and right parts, and the module of the spline component corresponding to the grid model where the first vector is located after the division is always calculated.
  • the modulus of the first component of the first vector in the first horizontal plane as the first target value, it is equivalent to considering that the wall on the first grid model has a thickness.
  • the wall thickness on the second grid model under the second corner cannot be changed; that is, using the first target value under the first corner and the first target under the second corner
  • the values are the same. Calculate the vertex coordinates of the second vertex to ensure that the thickness of the wall on the first grid model is the same as the thickness of the wall on the second grid model, so that under the second corner, the second grid model
  • the second corner on the wall can be seamlessly connected to the wall.
  • S103 may include:
  • the at least one first spline is a plurality of first splines
  • the first horizontal plane is a horizontal plane formed by the plurality of first splines
  • at least one target value corresponding to the first corner includes the second target value.
  • P 0 is the first control point used to control the first rotation angle
  • P 1 is the first vertex on the first mesh model, and passing through at least one first point of P 0
  • the splines are x 1 and x 2 ; among them, the spline near the first vertex is x 2 , and the vector from P 0 to P 1 is the first vector above, is the first vector
  • the component of the first vector perpendicular to the spline of the at least one first spline close to the first vertex in the first horizontal plane, and the first vector along the at least one first spline is not specifically limited.
  • the module of the component of the first vector perpendicular to the first horizontal plane is determined as the second target value
  • the second target value at the first corner is determined as the second target value at the second corner.
  • S103 may include:
  • the first direction is the direction of the spline close to the first vertex among the at least one first spline
  • the at least one first spline is two splines
  • the first The cotangent value is the minimum of the two splines
  • the cotangent value of the half angle of the included angle, and at least one target value corresponding to the first rotation angle includes the third target value.
  • P 0 is the first control point used to control the first rotation angle
  • P 1 is the first vertex on the first mesh model, and passing through at least one first point of P 0
  • the splines are x 1 and x 2 ; among them, the spline near the first vertex is x 2 , and the vector from P 0 to P 1 is the first vector above, is the first vector Along the spline is the x2 direction component.
  • the component of the first vector perpendicular to the spline of the at least one first spline close to the first vertex in the first horizontal plane, and the component of the first vector perpendicular to the first horizontal plane There is no specific limit on portion size.
  • the ratio of the modulus of the component of the first vector in the first direction to the first cotangent value is determined as the third target value corresponding to the first rotation angle, and the third target value corresponding to the first rotation angle is determined.
  • the target value is determined as the third target value corresponding to the second corner.
  • the first The cotangent value is determined as the cotangent value of the half angle of the minimum angle between the two splines, so that after the first corner is deformed to the second corner, there will be no intersection or overlap between the second corner and the wall.
  • At least one target value corresponding to the second rotation angle is determined based on the positional relationship between a second vector and at least one second spline.
  • the second vector is used to control the second rotation angle.
  • the vector from the second control point to the second vertex; the at least one second spline is a line passing through the second control point and used to characterize the outline of the second mesh model;
  • S105 may include:
  • the vertex coordinates of the second vertex are calculated based on the position of the at least one second spline, the position of the second control point and at least one target value corresponding to the second rotation angle.
  • At least one target value corresponding to the second corner is determined based on the positional relationship between the second vector and at least one second spline. It can be understood that the at least one target value corresponding to the second corner is: able to embody A target value of a positional relationship between the second vector sum and at least one second spline.
  • the vertex coordinates of the second vertex satisfy the first condition, which is the positional relationship between the first vector and at least one first spline, and the second vector and at least one second spline. The positional relationship between them is the same.
  • the grid model processing method provided by this application not only considers ensuring that the distance between the first vector on the static grid and at least one first spline is The positional relationship remains unchanged.
  • the free deformation method implemented in the 3D modeling software Autodesk 3ds Max only focuses on the geometric deformation of the vertices and does not recalculate the UV coordinates corresponding to the vertices, resulting in corner deformation, the new network The texture corresponding to the grid model is stretched or compressed; if the texture is a regular and textured texture, this problem will be very obvious.
  • the left side is the third target on the static mesh before corner deformation
  • the right side is the third target on the static mesh after corner deformation.
  • the third target is stretched.
  • the grid model processing method not only considers the positional relationship between the first vector and at least one first spline on the static grid model before and after corner deformation to be unchanged, but also considers the positional relationship between the first vector and at least one first spline on the second grid model.
  • the UV coordinates of the vertices in the map are recalculated so that the connection surface between the corner and the wall on the second mesh model is perpendicular to the wall, the thickness of the wall does not change, and there are no cracks or cracks between the corner and the wall.
  • it can also prevent the textures on the corners from stretching, dislocating, twisting and breaking.
  • S106 may include:
  • the first map is the first mesh
  • the map corresponding to the grid model; the plurality of vertices include the third vertex, and the third vertex and the first vertex are at the same level in the plurality of levels;
  • the number of pixels per unit length on the first horizontal distance is determined as the number of pixels per unit length on the second horizontal distance
  • the second horizontal distance is the position between the second vertex and the fourth vertex in the second texture.
  • the horizontal distance in , the fourth vertex is the vertex corresponding to the third vertex after the first corner is transformed into the second corner
  • the second texture is the texture corresponding to the second mesh model
  • a second mesh model under the second corner is determined.
  • the vertices of adjacent geometric heights in the first mesh model are divided into the same level based on the angle bisector of the first corner to obtain the multiple levels.
  • the first grid model is divided into two third grid models based on the angle bisector of the first corner; the vertices of adjacent geometric heights in the third grid model are divided into the same Level, get the multiple levels.
  • the first mesh model is divided into two parts using the corner bisector of the first corner.
  • the vertex P 0 and the vertex P on the third mesh model are P 1 belongs to two vertices at the same level; vertex P 1 and vertex P 2 belong to two vertices at the same level; among them, the corresponding coordinates of P 0 in the texture are (U 0 , V 0 ), and the corresponding coordinates of P 1 in the texture The coordinates of are (U 1 , V 1 ); the corresponding coordinates of P 2 in the texture are (U 2 , V 2 ).
  • the first grid model is divided into two third grid models through the angle bisector of the first corner, and then each third grid model is divided into levels respectively. , and then calculate the vertex coordinates under the second corner for each third grid model, so that the textures between the second corner and the two connected walls can be seamlessly spliced without any breakage or dislocation between them.
  • the third vertex may be any vertex at the same level as the first vertex. It should be noted that the third vertex is different from the first vertex.
  • each vertex in the second texture is recalculated on the second mesh model.
  • the V coordinate of each vertex in the second map is the same as its V coordinate in the first map.
  • the V coordinate of each vertex in the first texture is the same as its V coordinate in the second texture, so that the textures between the second corner and the two connected walls in the second texture can be spliced in Together.
  • the third vertex is determined as a vertex at the same level as the first vertex. This is equivalent to considering the horizontal line segment at the corner, whose geometric size is usually only approximately proportional to the UV size in the map. , are not numerically identical. If the vertices at different levels are calculated together and interact with each other, it will cause the texture of the triangular patch under the second corner to be stretched or distorted.
  • the first vertex and the third vertex can be The horizontal part of the vertex in the first texture will not be stretched, broken or misaligned in the second texture, thereby ensuring that the textures at each level in the second texture will not be stretched, broken or misaligned.
  • the grid model processing scheme of this application takes into account that the texture map on the grid model cannot be stretched, broken or dislocated before and after corner deformation, therefore, the grid model processing scheme of this application is applied to When building a game scene, it can make the texture of the buildings in the game scene closer to the game scene and more realistic, which helps to improve the playing effect of 3D games and thereby enhance the user experience.
  • Figure 10 is provided by an embodiment of the present application. Considering that the number of pixels per unit length in the texture after corner deformation is the same as the number of pixels per unit length in the texture before corner deformation, the generated second mesh model is the same as the generated second grid model. There are plans A comparison rendering of the second mesh model generated before and after the corner deformation with the texture unchanged. As shown in Figure 10, the left side is the second mesh model generated by considering that the number of pixels per unit length in the texture after corner deformation is the same as the number of pixels per unit length in the texture before corner deformation. The texture on the mesh model is not stretched or distorted; on the right is the second mesh model generated with the texture unchanged before and after the corner deformation. The texture on the second mesh model is stretched and deformed, and cracks appear.
  • the solution provided by this embodiment divides the first grid model into hierarchies, the solution is applicable to multi-level corner models, corner models with inclined surfaces, and corner models with multiple hierarchical structures and inclined surfaces at the same time.
  • the grid model processing solution provided by the embodiment of the present application is used to process the corners of multi-level corner models, corner models with inclined surfaces, and corner models with multi-level structures and inclined surfaces at the same time. After deformation, the generated mesh models remain in good condition without stretching, breaking, twisting or dislocation.
  • this misalignment is within an acceptable range, and if the horizontal geometric size between two vertices at different levels at the corner and its corresponding U in the map When the sizes are relatively close, the misalignment of the texture part corresponding to the patch where the two vertices are located in the second texture will be relatively small.
  • the number of pixels per unit length on the first horizontal distance can be determined in the following manner:
  • the ratio of the first horizontal distance to the first projection is determined as the number of pixels per unit length of the first horizontal distance.
  • the horizontal distance between two vertices at the same level in the map and the distance between the two vertices along the spline direction passing through the control corner The geometric horizontal distance is always proportional, so the ratio of the first horizontal distance to the first projection is determined as the number of pixels per unit length on the first horizontal distance to avoid the first corner deformation to the second corner.
  • the textures of the patches where the two vertices of the same level are located are stretched, broken, distorted or misaligned.
  • the U coordinate of the second vertex in the second map can be calculated in the following manner:
  • the U coordinate of the second vertex in the second map is calculated.
  • the U coordinate of the fourth vertex in the second texture can be the same as the U coordinate of the third vertex in the first texture.
  • the U coordinate of the fourth vertex in the second texture can be calculated as follows:
  • the sixth vertex is the vertex corresponding to the fifth vertex after the first corner is transformed into the second corner.
  • the second mesh model is determined in the following manner:
  • the UV coordinates of the second vertex in the second texture and the vertex coordinates of the second vertex are linearly superimposed to determine the second mesh model.
  • Figure 14 is another flowchart of the grid model processing method 200 provided by the embodiment of the present application.
  • the method 200 may include some or all of the following:
  • S202 Obtain a second rotation angle in response to an operation performed by the user on the first control point used to control the first rotation angle on the display interface.
  • the first vector is a vector from the first control point to the first vertex, and the first component is a spline perpendicular to the at least one first spline close to the first vertex.
  • the at least one first spline is a line passing through the first control point and used to characterize the outline of the first mesh model;
  • the at least one first spline is a plurality of first splines ,
  • the first horizontal plane is a horizontal plane formed by the plurality of first splines, and at least one target value corresponding to the first corner includes the first target value.
  • S204 Based on the positional relationship between the first vector and at least one first spline, determine the modulus of the component of the first vector perpendicular to the first horizontal plane as the second target value corresponding to the first rotation angle.
  • At least one target value corresponding to the first rotation angle includes the second target value.
  • S205 Based on the positional relationship between the first vector and at least one first spline, determine the ratio of the module of the component of the first vector in the first direction to the first cotangent value as the third target value.
  • the first direction is the direction of the spline close to the first vertex among the at least one first spline, and the at least one first spline is two splines, so
  • the first cotangent value is the cotangent value of a half angle of the minimum angle between the two spline lines, and at least one target value corresponding to the first corner includes the third target value.
  • S206 Determine the first target value, the second target value, and the third target value corresponding to the first corner as the first target value, the second target value, and the third target value corresponding to the second corner, respectively.
  • S207 Determine the vertex coordinates of the second vertex based on the first target value, the second target value, and the third target value corresponding to the second corner.
  • S209 Determine the first horizontal distance between the first vertex and the third vertex in the first map.
  • the first texture is a texture corresponding to the first mesh model; the third vertex is in the level where the first vertex is located and is close to the first vertex in the at least one first spline.
  • the U coordinate corresponding to the third vertex in the first map of the vertex farthest from the first control point in the direction of the spline is the same as the U coordinate corresponding to the fourth vertex in the second map.
  • S210 Based on the first horizontal distance, determine the number of pixels per unit length on the first horizontal distance.
  • S211 Determine the number of pixel points per unit length on the first horizontal distance as the number of pixel points per unit length on the second horizontal distance.
  • the second horizontal distance is the horizontal distance between the second vertex and the fourth vertex in the second map, and the fourth vertex corresponds to the third vertex after the first corner is transformed into the second corner.
  • the vertex of , the second texture is the texture corresponding to the second mesh model;
  • S212 Determine the U coordinate of the second vertex in the second map based on the number of pixels per unit length on the second horizontal distance.
  • V coordinate of the second vertex in the second map is the same as the V coordinate of the first vertex in the first map.
  • the coordinates are the same.
  • S213 Perform linear superposition processing on the UV coordinates of the second vertex in the second texture and the vertex coordinates of the second vertex to determine the second mesh model under the second corner.
  • the first target value at the first corner is determined based on the positional relationship between the first vector and at least one first spline.
  • the second target value and the third target value on the one hand, can ensure that the thickness of the wall on the first grid model is the same as the thickness of the wall on the second grid model, so that under the second corner, the second The second corner and wall on the mesh model can be seamlessly connected.
  • the height of the second corner remains unchanged, thereby ensuring that the connecting surface between the second corner and the wall is still perpendicular to the wall, that is, ensuring that there is no gap between the corner and the connecting surface. There will be gaps. And it can ensure that there will be no cracks, penetrations and overlaps between the second corner and the wall.
  • the number of pixel points per unit length on the first horizontal distance is determined as the number of pixel points per unit length on the second horizontal distance. number, it can be realized that in the level where the first vertex is located, the horizontal parts of the first vertex and the third vertex in the first map will not be stretched, broken or misplaced in the second map, thereby ensuring that each level in the second map The textures on will not be stretched, broken or misaligned.
  • the size of the sequence numbers of the above-mentioned processes does not mean the order of execution.
  • the execution order of each process should be determined by its functions and internal logic, and should not be used in this application.
  • the implementation of the examples does not constitute any limitations.
  • Figure 15 is a schematic block diagram of the grid model processing device 300 provided by the embodiment of the present application.
  • the grid model processing device 300 may include:
  • Acquisition unit 310 configured to acquire a first mesh model, where the first mesh model includes a first corner and a first vertex;
  • the first determining unit 320 is configured to obtain the second rotation angle in response to an operation performed by the user on the first control point used to control the first rotation angle on the display interface;
  • the second determination unit 330 is configured to determine at least one target value corresponding to the first corner based on the positional relationship between the first vector and the at least one first spline, the first vector being the first control point to the A vector of the first vertex, the at least one first spline is a line passing through the first control point and used to characterize the outline of the first mesh model;
  • the third determination unit 340 is configured to determine at least one target value corresponding to the first rotation angle and at least one target value corresponding to the second rotation angle;
  • the fourth determination unit 350 is configured to determine the vertex coordinates of a second vertex based on at least one target value corresponding to the second corner.
  • the second vertex corresponds to the first vertex after the first corner is transformed into the second corner. the vertex;
  • the fifth determination unit 360 is configured to determine the second mesh model under the second corner based on the vertex coordinates of the second vertex.
  • the second determining unit 330 is specifically used to:
  • the first component is a spline perpendicular to the at least one first spline close to the first vertex.
  • the at least one first spline is a plurality of first splines
  • the first horizontal plane is a horizontal plane formed by the plurality of first splines
  • at least one target value corresponding to the first corner includes the a target value.
  • the second determination unit 330 is also specifically used to:
  • the at least one first spline is a plurality of first splines
  • the first horizontal plane is a horizontal plane formed by the plurality of first splines
  • at least one target value corresponding to the first corner includes the second target value.
  • the second determination unit 330 is also specifically used to:
  • the first direction is the direction of the spline close to the first vertex among the at least one first spline
  • the at least one first spline is two splines
  • the first cotangent The value is the cotangent value of the half angle of the minimum angle between the two spline lines
  • at least one target value corresponding to the first corner includes the third target value.
  • At least one target value corresponding to the second rotation angle is determined based on the positional relationship between a second vector and at least one second spline.
  • the second vector is used to control the second rotation angle.
  • the vector from the second control point to the second vertex; the at least one second spline is a line passing through the second control point and used to characterize the outline of the second mesh model;
  • the fourth determining unit 350 is specifically used to:
  • the vertex coordinates of the second vertex are calculated based on the position of the at least one second spline, the position of the second control point and at least one target value corresponding to the second rotation angle.
  • the fifth determining unit 360 is specifically used to:
  • the plurality of vertices include the third vertex, and the third vertex The same level in the plurality of levels as the first vertex;
  • the number of pixels per unit length on the first horizontal distance is determined as the number of pixels per unit length on the second horizontal distance
  • the second horizontal distance is the position between the second vertex and the fourth vertex in the second texture.
  • the horizontal distance in , the fourth vertex is the vertex corresponding to the third vertex after the first corner is transformed into the second corner
  • the second texture is the texture corresponding to the second mesh model
  • a second mesh model under the second corner is determined.
  • the fifth determination unit 360 is also specifically used to:
  • the ratio of the first horizontal distance to the first projection is determined as the number of pixels per unit length of the first horizontal distance.
  • the fifth determination unit 360 is also specifically used to:
  • the fifth determination unit 360 is also specifically used to:
  • Linear superposition processing is performed on the UV coordinates of the second vertex in the second texture and the vertex coordinates of the second vertex to determine the second mesh model.
  • the third vertex is in the level where the first vertex is located and is distanced from the first control point in the direction of a spline close to the first vertex in the at least one first spline.
  • the farthest vertex, the U coordinate corresponding to the third vertex in the first map is the same as the U coordinate corresponding to the fourth vertex in the second map.
  • the fifth determination unit 360 is also specifically used to:
  • the device embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be repeated here.
  • the grid model processing device 300 may correspond to the corresponding subject in executing the method 100 or the method 200 in the embodiment of the present application, and each unit in the grid model processing device 300 is respectively intended to implement the corresponding part in the method 100 or the method 200. The process, for the sake of brevity, will not be repeated here.
  • each unit in the grid model processing device 300 involved in the embodiment of the present application can be separately or entirely combined into one or several other units to form, or some of the units (some) can be further split. It is composed of multiple functionally smaller units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application.
  • the above units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the grid model processing device 300 may also include other units. In practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by multiple units in cooperation.
  • a general-purpose computing device including a general-purpose computer including processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), etc.
  • a computer program (including program code) capable of executing each step involved in the corresponding method is run on the computer to construct the grid model processing device 300 involved in the embodiment of the present application, and to implement the grid model processing method of the embodiment of the present application.
  • the computer program can be recorded on, for example, a computer-readable storage medium, loaded into an electronic device through the computer-readable storage medium, and run therein to implement the corresponding methods provided by the embodiments of the present application.
  • the units mentioned above can be implemented in the form of hardware, can also be implemented in the form of instructions in the form of software, or can be implemented in the form of a combination of software and hardware.
  • each step of the method embodiments in the embodiments of the present application can be completed by integrated logic circuits of hardware in the processor and/or instructions in the form of software.
  • the steps of the methods disclosed in conjunction with the embodiments of the present application can be directly embodied in hardware.
  • the execution of the decoding processor is completed, or the execution is completed using a combination of hardware and software in the decoding processor.
  • the software can be located in a mature storage medium in this field such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in combination with its hardware.
  • FIG. 16 is a schematic structural diagram of an electronic device 400 provided by an embodiment of the present application.
  • the electronic device 400 at least includes a processor 410 and a computer-readable storage medium 420 .
  • the processor 410 and the computer-readable storage medium 420 may be connected through a bus or other means.
  • the computer-readable storage medium 420 is used to store a computer program 421, the computer program 421 includes computer instructions, and the processor 410 is used to execute the computer instructions stored in the computer-readable storage medium 420.
  • the processor 410 is the computing core and control core of the electronic device 400. It is suitable for implementing one or more computer instructions, specifically suitable for loading and executing one or more computer instructions to implement the corresponding method flow or corresponding functions.
  • the processor 410 may also be called a central processing unit (Central Processing Unit, CPU).
  • the processor 410 may include, but is not limited to: a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or a field programmable gate array. Field Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the computer-readable storage medium 420 can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it can also be at least one located far away from the aforementioned processor 410 computer-readable storage media.
  • the computer-readable storage medium 420 includes, but is not limited to: volatile memory and/or non-volatile memory.
  • non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory.
  • Volatile memory may be Random Access Memory (RAM), which is used as an external cache.
  • RAM Random Access Memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • Enhanced SDRAM, ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • Direct Rambus RAM Direct Rambus RAM
  • the electronic device 400 may be the grid model processing device 300 shown in Figure 15; computer instructions are stored in the computer-readable storage medium 420; the computer-readable storage medium is loaded and executed by the processor 410 420 to implement the corresponding steps in the method embodiment; in specific implementation, the computer instructions in the computer-readable storage medium 420 are loaded by the processor 410 and execute the corresponding steps. To avoid duplication, they will not be described again here. .
  • embodiments of the present application also provide a computer-readable storage medium (Memory).
  • the computer-readable storage medium is a memory device in the electronic device 400 and is used to store programs and data.
  • computer-readable storage medium 420 may include a built-in storage medium in the electronic device 400 , and of course may also include an extended storage medium supported by the electronic device 400 .
  • the computer-readable storage medium provides storage space that stores the operating system of the electronic device 400 .
  • one or more computer instructions suitable for being loaded and executed by the processor 410 are also stored in the storage space. These computer instructions may be one or more computer programs 421 (including program codes).
  • the electronic device 400 may also include a transceiver 430 , which may be connected to the processor 410 or the computer-readable storage medium 420 .
  • the computer-readable storage medium 420 can control the transceiver 430 to communicate with other devices. Specifically, it can send information or data to other devices, or receive information or data sent by other devices.
  • Transceiver 430 may include a transmitter and a receiver.
  • the transceiver 430 may further include an antenna, and the number of antennas may be one or more.
  • a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium.
  • computer program 421 the electronic device 400 may be a computer.
  • the processor 410 reads the computer instructions from the computer-readable storage medium 420.
  • the processor 410 executes the computer instructions, so that the computer executes the grid model provided in the above various optional ways. Approach.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transmitted from a website, computer, server, or data center to Wired (e.g. coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g. (such as infrared, wireless, microwave, etc.) to another website, computer, server or data center.
  • Wired e.g. coaxial cable, fiber optic, digital subscriber line (DSL)
  • wireless e.g. (such as infrared, wireless, microwave, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本申请提供了一种网格模型处理方法、装置、设备以及存储介质,涉及人工智能的计算机图形学领域,该方法包括:基于第一网格模型上的第一向量和至少一个第一样条线之间的位置关系,确定该第一转角对应的至少一个目标值;将该第一转角对应的至少一个目标值,分别确定为该第二转角对应的至少一个目标值;基于该第二转角对应的至少一个目标值,确定第二顶点的顶点坐标;基于该第二顶点的顶点坐标,确定该第二转角下的第二网格模型。该方法能够有利于实现第二转角与相邻墙体之间的衔接面、和墙体仍然垂直,第二网格模型上的墙体厚度和第一网格模型上的墙体厚度相同、第二转角和相邻墙体之间不出现裂缝或穿插。

Description

网格模型处理方法、装置、设备以及存储介质
本申请要求于2022年03月28日提交中国专利局、申请号为202210316824.4、发明名称为“网格模型处理方法、装置、设备以及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及人工智能的计算机图形学领域,并且更具体地,涉及网格模型处理方法、装置、设备以及存储介质。
背景技术
目前,转角形变的方式通常包括两种:自由变形和晶格变形;其中,自由变形(Free-Form Deformation,FFD)是一种常用的形变方式,其做法大体为:在一个给定的静态网格的包围盒中,均匀选取m层n行k列总计m*n*k个点阵作为控制点。当控制点的位置发生改变时,通常按照伯恩斯坦(Bernstein)多项式插值重新计算静态网格上各个顶点的位置;晶格变形(Lattice Deformer)通常被用来处理弹性形变,其操作方式与FFD一样,也是在包围盒中均匀选取点阵作为控制点,当控制点的位置发生变化,重新计算网格上各个顶点的位置,而且在晶格变形中,网格体上每个顶点的变化都会受到其材质的影响,形变过程中网格体的体积基本不变。
但是,上述两种形变方式在建筑场景中并不适用,因为转角形变后可能导致转角和墙体之间的衔接面与墙体之间不再垂直、出现裂缝、或者转角和墙体之间的衔接面与墙体之间重叠。
发明内容
本申请实施例提供了一种网格模型处理方法、装置、设备以及存储介质,能够使第一转角形变到第二转角后,第一转角下第一向量和至少一个第一样条线之间的位置关系、和第二转角下第二顶点与经过用于控制第二转角的控制点的样条线之间的位置关系相同,进一步的,有利于实现第二网格模型上第二转角与墙体之间的衔接面、和墙体仍然垂直,第二网格模型上的墙体厚度和第一网格模型上的墙体厚度相同、第二网格模型上的第二转角和墙体之间不出现裂缝或穿插。
第一方面,本申请实施例提供了一种网格模型处理方法,包括:
获取第一网格模型,该第一网格模型包括第一转角和第一顶点;
响应于用户在显示界面上对用于控制该第一转角的第一控制点执行的操作,得到第二转角;
基于第一向量和至少一个第一样条线之间的位置关系,确定该第一转角对应的至少一个目标值;该第一向量为该第一控制点到该第一顶点的向量,该至少一个第一样条线为经过该第一控制点的且用于表征该第一网格模型的轮廓的线条;
将该第一转角对应的至少一个目标值,分别确定为该第二转角对应的至少一个目标值;
基于该第二转角对应的至少一个目标值,确定第二顶点的顶点坐标;该第二顶点为该第一转角形变为该第二转角后与该第一顶点对应的顶点;
基于该第二顶点的顶点坐标,确定该第二转角下的第二网格模型。
第二方面,本申请实施例提供了一种网格模型处理装置,包括:
获取单元,用于获取第一网格模型,该第一网格模型包括第一转角和第一顶点;
第一确定单元,用于响应于用户在显示界面上对用于控制该第一转角的第一控制点执行的操作,得到第二转角;
第二确定单元,用于基于第一向量和至少一个第一样条线之间的位置关系,确定该第一转角对应的至少一个目标值,该第一向量为该第一控制点到该第一顶点的向量,该至少一个第一样条线为经过该第一控制点的且用于表征该第一网格模型的轮廓的线条;
第三确定单元,用于将该第一转角对应的至少一个目标值,分别确定为该第二转角对应的至少一个目标值;
第四确定单元,用于基于该第二转角对应的至少一个目标值,确定第二顶点的顶点坐标,该第二顶点为该第一转角形变为该第二转角后与该第一顶点对应的顶点;
第五确定单元,用于基于该第二顶点的顶点坐标,确定该第二转角下的第二网格模型。
第三方面,本申请实施例提供了一种电子设备,包括:
处理器,适于执行计算机程序;
计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,该计算机程序被该处理器加载并执行上述第一方面的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机指令,该计算机指令被计算机设备的处理器读取并执行时,使得计算机设备执行上述第一方面的方法。
在本实施例中,通过将该第一转角对应的至少一个目标值,分别确定为第二转角对应的至少一个目标值,并基于第二转角对应的至少一个目标值,确定第二顶点的顶点坐标,能够使第一转角形变到第二转角后,第一转角下第一向量和至少一个第一样条线之间的位置关系、和第二转角下第二顶点与经过用于控制第二转角的控制点的样条线之间的位置关系相同,进一步的,有利于实现第二网格模型上第二转角与墙体之间的衔接面、和墙体仍然垂直,第二网格模型上的墙体厚度和第一网格模型上的墙体厚度相同、第二网格模型上的第二转角和墙体之间不出现裂缝或穿插。
此外,相较于自由变形和晶格变形两种方式,本申请提供的方案仅需要用户在显示界面上对用于控制该第一转角的第一控制点执行操作,就可以生成第二转角下的第二网格模型,用户操作步骤少,使用简单、方便;而且本申请的方案仅需输入一个网格模型,可以对该第一网格模型的转角进行0°至180°之间任意角度的形变,得到任意转角的网格模型,不仅提高了模型的复用率,而且节约美术成本、提高美术制作效率。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的建筑马耳他的瓦莱塔要塞的示意图。
图2是本申请实施例提供的建筑星形要塞的示意图。
图3是本申请实施例提供的利用转角衔接两面有厚度的墙体的示意图。
图4是本申请实施例提供的已有方案中转角形变前后网格模型的对比示意图。
图5是本申请实施例提供的已有方案中转角形变前后转角和墙体之间关系的示意图。
图6是本申请实施例提供的网格模型处理方法的流程图。
图7是本申请实施例提供的,考虑第一向量和至少一个第一样条线之间的位置关系在转角形变前后不变、和已有方案中未考虑该位置关系不变生成的第二网格模型进行对比的效果图。
图8是本申请实施例提供的第一转角对应的至少一个目标值在网格模型上的示例。
图9是本申请实施例提供的对第一网格模型划分层级的示意图。
图10是本申请实施例提供的,考虑转角形变后贴图中单位长度内像素点的个数与转角形变前贴图中单位长度内像素点的个数相同,生成的第二网格模型、和已有方案中转角形变前后贴图不变生成的第二网格模型的对比效果图。
图11是本申请实施例提供的多层次的墙角模型上转角形变后的效果图。
图12是本申请实施例提供的有倾斜面的墙角模型上转角形变后的效果图。
图13是本申请实施例提供的同时有多层次结构和倾斜面的墙角模型上转角形变后的效果图。
图14是本申请实施例提供的网格模型处理方法的另一流程图。
图15是本申请实施例提供的网格模型处理装置的示意性框图。
图16是本申请实施例提供的电子设备的示意结构图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
通常情况下,无论是现实场景中的建筑还是游戏场景中的建筑都形态各异,其样条线也会根据需要而千差万别,样条线中相邻两个样条线段之间的夹角也有可能不是标准的90°。例如,如图1所示的建筑马耳他的瓦莱塔要塞,有的相邻两个样条线段之间的夹角是接近180°的钝角,有的相邻两个样条线段之间的夹角大于180°。再如,如图2所示的建筑星形要塞,也被称为星堡或棱堡,其城墙的转角既有比较尖锐的锐角,也有大于180°的转角。
目前,常见的建筑过程化生成思路为:首先,制作若干个标准化墙体模块,然后按照一定的规则和方式进行拼接和堆叠,最后形成一个完整的建筑。这种思路可以大大提高可复用率,并且在给定面片的前提下,通过不同的拼接摆放和堆叠方式,可以生成形态不同但风格比较一致的建筑。在这样的思路下,若建筑上的墙体有厚度时,则墙和墙之间是无法完美连接的,必须通过添加转角来衔接;例如,如图3所示,左侧为有厚度的两面墙体,右侧为添加转角衔接后的两面墙体;由于无论现实场景中的建筑还是游戏场景中的建筑都形态各异,相邻两面墙之间的夹角常常不同,为了提高建筑模型的可复用率,节约美术成本、提高美术制作效率,人们通常希望输入一个转角为标准角度(90°)的转角模型,通过程序化将该转角形变成0°到180°之间指定角度的转角,得到转角形变后的转角模型;即,对于复杂的建筑,美术方面只需要制作一个标准转角模型,其他转角下的模型全部通过形变自动生成,以节约美术制作的成本、提高美术制作的效率。
然而,目前转角形变的自由变形(Free-Form Deformation,FFD)方式和晶格变形(Lattice Deformer)方式在建筑场景中并不适用;其中,自由变形的形变方式作为一种光滑和弹性的变换方式,在形变过程中并不能保证静态网格上的刚性关系;例如,如图4所示,针对静态网格体上的第一目标,左侧为转角形变前静态网格体上的第一目标,右侧为转角形变后静态网格体上的第一目标,如图4右侧所示,在转角形变后,该第一目标与墙体之间的刚性关系发生改变;了其中,该刚性关系包括但不限于,三点共线、两线平行、四点共面,两线垂直等。需要说明的是,三点共线指转角形变前网格体上共线的三点,在转角形变后该三点仍共线;两线平行指转角形变前网格体上平行的两条线,在转角形变后该两条线仍平行;四点共面指转角形变前网格体上共面的两个面片在转角形变后该两个面片仍共面;两线垂直指转角形变前网格体上垂直的两条线,在转角形变后该两条线仍垂直。由于第一目标与墙体之间无法保持上述刚性关系,则导致转角形变后第一目标不再和左侧墙体垂直,且第一目标发生拉伸。
同时,由于转角形变后转角和墙体之间的衔接面不再和墙面垂直,在几何上会导致转角和墙面之间出现缝隙或者相互重叠;例如,如图5左侧转角形变前的第二目标所示,转角和墙体之间的衔接面与墙体垂直,且该衔接面与墙体不重叠,在转角形变后,如图5中右侧转角形变后的第二目标所示,转角和墙体之间的衔接面与墙体不再垂直;且衔接面与墙体重叠。同理,晶格变形的方案和自由变形方案中存在的问题相同,而且两个方案在转角形变后均会改变墙体厚度,所以,自由变形和晶格变形两种转角形变方式并不适用于建筑物上的转角形变。
需要说明的是,FFD是一种通过拉动控制点来改变模型形状的形变方式,主要通过控制点被拉动前后控制点位置的变化,来重新计算模型形状的形变;Lattice Deformer和FFD的形变方式相同,都是通过控制点改变模型形状,二者的区别在于形变的计算过程和方式不同。
基于此,本申请提供了一种网格模型处理方案,能够基于转角形变前后,控制转角形变的控制点到网格体上任一顶点的向量、与经过控制点的样条线之间的位置关系确定的至少一个数值相同,相当于,考虑到网格体在转角形变后仍然需要满足上述三点共线、两线平行、四点共面,两线垂直的刚性关系,有利于在转角形变后,实现网格体上转角和墙体之间的衔接面与墙体垂直、墙体的厚度不发生改变、且转角和墙面之间不出现裂缝和相互重叠。
应理解的是,本申请提供的方案可涉及人工智能技术。
其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。换句话说,人工智能是计算机科学的一个综合技术,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器。人工智能也就是研究各种智能机器的设计原理与实现方法,使机器具有感知、推理与决策的功能。
结合本申请实施例提供的网格模型处理方法来说,可通过人工智能的方法实现本申请实施例提供的网格模型处理方法。
应理解,人工智能技术是一门综合学科,涉及领域广泛,既有硬件层面的技术也有软件层面的技术。人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。
随着人工智能技术研究和进步,人工智能技术在多个领域展开研究和应用,例如常见的智能家居、智能穿戴设备、虚拟助理、智能音箱、智能营销、无人驾驶、自动驾驶、无人机、机器人、智能医疗、智能客服等,相信随着技术的发展,人工智能技术将在更多的领域得到应用,并发挥越来越重要的价值。
本申请实施例可涉及人工智能技术中的计算机视觉(Computer Vision,CV)技术,计算机视觉是一门研究如何使机器“看”的科学,更进一步的说,就是指用摄影机和电脑代替人眼对目标进行识别、监测和测量等机器视觉,并进一步做图形处理,使电脑处理成为更适合人眼观察或传送给仪器检测的图像。作为一个科学学科,计算机视觉研究相关的理论和技术,试图建立能够从图像或者多维数据中获取信息的人工智能系统。计算机视觉技术通常包括图像处理、图像识别、图像语义理解、图像检索、OCR、视频处理、视频语义理解、视频内容/行为识别、三维物体重建、3D技术、虚拟现实、增强现实等。
结合本申请实施例提供的网格模型处理方法来说,可以通过CV技术,来实现该网格模型处理方法中与图像处理、图像识别、图像语义理解、图像检索、OCR、视频处理、视频语义理解、视频内容/行为识别、三维物体重建、3D技术、虚拟现实、增强现实等相关功能。
本申请实施例也可以涉及人工智能技术中的机器学习(Machine Learning,ML),ML是一门多领域交叉学科,涉及概率论、统计学、逼近论、凸分析、算法复杂度理论等多门学科。专门研究计算机怎样模拟或实现人类的学习行为,以获取新的知识或技能,重新组织已有的知识结构使之不断改善自身的性能。机器学习是人工智能的核心,是使计算机具有智能的根本途径,其应用遍及人工智能的各个领域。机器学习和深度学习通常包括人工神经网络、置信网络、强化学习、迁移学习、归纳学习、式教学习等技术。
结合本申请实施例提供的网格模型处理方法来说,可以通过ML技术来训练本申请实施例涉及的网格模型。
本申请实施例还可涉及计算机图形学领域;计算机图像学是一种使用数学算法将二维或三维图形转化为计算机显示器的栅格形式的科学。简单地说,计算机图形学的主要研究内容就是研究如何在计算机中表示图形、以及利用计算机进行图形的计算、处理和显示的相关原理与算法。
在介绍本申请方案之前,下面先对本申请的相关知识进行说明。
1、云技术(Cloud technology),是指在广域网或局域网内将硬件、软件、网络等系列资源统一起来,实现数据的计算、储存、处理和共享的一种托管技术。云技术(Cloud technology)基于云计算商业模式应用的网络技术、信息技术、整合技术、管理平台技术、应用技术等的总称,可以组成资源池,按需所用,灵活便利。云计算技术将变成重要支撑。技术网络系统的后台服务需要大量的计算、存储资源,如视频网站、图片类网站和更多的门户网站。伴随着互联网行业的高度发展和应用,将来每个物品都有可能存在自己的识别标志,都需要传输到后台系统进行逻辑处理,不同程度级别的数据将会分开处理,各类行业数据皆需要强大的系统后盾支撑,只能通过云计算来实现。
2、云游戏(Cloud gaming),又可称为游戏点播(gaming on demand),是一种以云计算技术为基础的在线游戏技术。云游戏技术使图形处理与数据运算能力相对有限的轻端设备(thin client)能运行高品质游戏。在云游戏场景下,游戏并不在玩家游戏终端,而是在云服务器中运行,并由云服务器将游戏场景渲染为视频音频流,通过网络传输给玩家游戏终端。玩家游戏终端无需拥有强大的图形运算与数据处理能力,仅需拥有基本的流媒体播放能力与获取玩家输入指令并发送给云服务器的能力即可。
3、保距:即转角形变前后,网格模型上某些点之间的距离在转角形变前后不变。
4、保角:即转角形变前后,网格模型上某些线段之间的夹角在转角形变前后不变。
需要说明的是,本申请的应用场景包括但不限于3D游戏/3D影视作品/短视频等虚拟场景中建筑的搭建。例如,本申请提供的方案可适用于3D游戏场景中标准建筑转角到特定建筑转角的效果转换,对于游戏场景中形态不同但风格比较一致的建筑,利用本申请提供的方案不仅能够节省游戏画面的制作成本和渲染成本,而且利用本申请提供的网格模型处理方法得到的网格模型,保持了转角形变前后网格模型的刚性关系,使转角形变后的网格模型更加逼真,提高了用户对游戏的游玩体验。
下边具体通过如下实施例对本申请提供的方案进行说明:
图6是本申请实施例提供的网格模型处理方法100的流程图。
需要说明的是,该网格模型处理方法100可以由任何具有数据处理能力的电子设备执行,该电子设备可以是终端设备,该终端设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(mobile internet device,MID)或其他具有显示功能的终端设备。该电子设备也可以是服务器,服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。
下面以网格模型处理装置为例对本申请提供的网格模型处理方法进行说明。
如图6所示,该方法100可包括以下中的部分或全部内容:
S101,获取第一网格模型,该第一网格模型包括第一转角和第一顶点;
S102,响应于用户在显示界面上对用于控制该第一转角的第一控制点执行的操作,得到第二转角;
S103,基于第一向量和至少一个第一样条线之间的位置关系,确定该第一转角对应的至少一个目标值;该第一向量为该第一控制点到该第一顶点的向量,该至少一个第一样条线为经过该第一控制点的且用于表征该第一网格模型的轮廓的线条;
S104,将该第一转角对应的至少一个目标值,分别确定为该第二转角对应的至少一个目标值;
S105,基于该第二转角对应的至少一个目标值,确定第二顶点的顶点坐标;该第二顶点为该第一转角形变为该第二转角后与该第一顶点对应的顶点;
S106,基于该第二顶点的顶点坐标,确定该第二转角下的第二网格模型。
在一些实现方式中,获取用户在三维(3D)建模软件中制作的第一网格模型,响应于用户在显示界面上对第一控制点执行的拖拽操作,将第一转角形变为第二转角。示例性的,拖拽前该第一转角的夹角可以是90°,拖拽后该第二转角的夹角可以是0°至180°之间的任一角度。当然,该第一转角的夹角也可以是0°至180°之间的任一角度,本申请对此不作具体限制。
在另一些实现方式中,也可以是用户选中第一控制点,并输入第二转角的夹角,得到第二转角。
需要说明的是,该第一顶点可以是该第一网格模型上的任一顶点。
在本实施例中,通过将该第一转角对应的至少一个目标值,分别确定为第二转角对应的至少一个目标值,并基于第二转角对应的至少一个目标值,确定第二顶点的顶点坐标,能够使第一转角形变到第二转角后,第一转角下第一向量和至少一个第一样条线之间的位置关系、和第二转角下第二顶点与经过用于控制第二转角的控制点的样条线之间的位置关系相同,进一步的,有利于实现第二网格模型上第二转角与墙体之间的衔接面、和墙体仍然垂直,第二网格模型上的墙体厚度和第一网格模型上的墙体厚度相同、第二网格模型上的第二转角和墙体之间不出现裂缝或穿插。
此外,相较于自由变形和晶格变形两种方式,本申请提供的方案仅需要用户在显示界面上对用于控制该第一转角的第一控制点执行操作,就可以生成第二转角下的第二网格模型,用户操作步骤少,使用简单、方便;而且本申请的方案仅需输入一个网格模型,可以对该第一网格模型的转角进行0°至180°之间任意角度的形变,得到任意转角的网格模型,不仅提高了模型的复用率,而且节约美术成本、提高美术制作效率。
需要说明的是,一方面,由于本申请的网格模型处理方案仅需输入一个网格模型,就可以对该第一网格模型的转角进行0°至180°之间任意角度的形变,得到任意转角的网格模型,则对于游戏场景形态不同但风格比较一致的建筑,利用本申请提供的网格模型处理方案,无需构建同一转角不同角度下的网格模型,提高游戏场景下网格模型的复用率,节省游戏画面的制作成本和渲染成本。另一方面,利用本申请提供的网格模型处理方案,得到游戏场景下建筑转角形变后的网格模型不会出现变形、穿插,裂缝等,提高用户对游戏的游玩体验。
图7是本申请实施例提供的,考虑第一向量和至少一个第一样条线之间的位置关系在转角形变前后不变、和已有方案中未考虑该位置关系不变生成的第二网格模型进行对比的效果图。如图7所示,左侧为考虑第一向量和至少一个第一样条线之间的位置关系在转角形变前后不变,生成的第二网格模型,该第二网格模型上转角和墙体的衔接面未裂开,且与墙体垂直;右侧为已有方案中未考虑第一向量和至少一个第一样条线之间的位置关系在转角形变前后不变,而生成的第二网格模型,该第二网格模型上转角和墙体的衔接面裂开,未与墙体垂直。
在本申请的一些实施例中,S103可包括:
基于第一向量和至少一个第一样条线之间的位置关系,将所述第一向量在第一水平面内的第一分量的模,确定为第一目标值;
其中,所述第一分量为垂直所述至少一个第一样条线中靠近所述第一顶点的样条线的分量,该至少一个第一样条线为多个第一样条线,该第一水平面为该多个第一样条线形成的水平面,该第一转角对应的至少一个目标值包括该第一目标值。
示例性的,图8是本申请实施例提供的第一转角对应的至少一个目标值在网格模型上的示例;如图8所示,假设P0为用于控制该第一转角的第一控制点,P1为第一网格模型上的第一顶点,经过P0的至少一个第一样条线为x1、x2;其中,靠近第一顶点的样条线为x2,P0到P1的向量为上述第一向量,为第一向量在样条线x1、x2形成的第一水平面内垂直样条线x2的分量。
需要说明的是,将所述第一向量在第一水平面内的第一分量的模,确定为第一目标值,相当于,在确定第一目标值时,利用至少一个第一样条线的角平分线将第一网格模型分为左右两部分,始终计算第一向量在划分后的第一向量所在网格模型对应的样条线的分量的模。
需要说明的是,在本实施例中对第一向量在沿至少一个第一样条线中靠近该第一顶点的样条线方向的分量、以及第一向量垂直第一水平面的分量不作具体限制。
在本实施例中,通过将将所述第一向量在第一水平面内的第一分量的模,确定为第一目标值,相当于,考虑到第一网格模型上的墙体有厚度时,第一转角形变为第二转角后,第二转角下的第二网格模型上的墙体厚度不能变;即,利用第一转角下的第一目标值和第二转角下的第一目标值相同,计算第二顶点的顶点坐标,能够保证在第一网格模型上的墙体有厚度和第二网格模型上的墙体厚度相同,以便在第二转角下,第二网格模型上的第二转角和墙体能够无缝衔接。
在本申请的一些实施例中,S103可包括:
基于第一向量和至少一个第一样条线之间的位置关系,将该第一向量垂直第一水平面的分量的模,确定为第二目标值;
其中,该至少一个第一样条线为多个第一样条线,该第一水平面为该多个第一样条线形成的水平面,该第一转角对应的至少一个目标值包括该第二目标值。
示例性的,如图8所示,假设P0为用于控制该第一转角的第一控制点,P1为第一网格模型上的第一顶点,经过P0的至少一个第一样条线为x1、x2;其中,靠近第一顶点的样条线为x2,P0到P1的向量为上述第一向量,为第一向量垂直于x1、x2形成的第一水平面的分量。
需要说明的是,在本实施例中对第一向量在第一水平面内垂直该至少一个第一样条线中靠近该第一顶点的样条线的分量、以及第一向量沿至少一个第一样条线中靠近该第一顶点的样条线方向的分量不作具体限制。
在本实施例中,通过将该第一向量垂直第一水平面的分量的模,确定为第二目标值,并将第一转角下的第二目标值确定为第二转角下的第二目标值,能够使第一转角形变为第二转角后,第二转角的高度不变;由于第二转角的高度不变,进而保证第二转角和墙体的衔接面与墙体仍垂直,即保证转角和衔接面之间不会出现断层。
在本申请的一些实施例中,S103可包括:
基于第一向量和至少一个第一样条线之间的位置关系,将所述第一向量在第一方向的分量的模与第一余切值的比值,确定为第三目标值;
其中,所述第一方向为所述至少一个第一样条线中靠近所述第一顶点的样条线方向,所述至少一个第一样条线为两个样条线,所述第一余切值为所述两个样条线的最小 夹角的半角的余切值,所述第一转角对应的至少一个目标值包括所述第三目标值。
示例性的,如图8所示,假设P0为用于控制该第一转角的第一控制点,P1为第一网格模型上的第一顶点,经过P0的至少一个第一样条线为x1、x2;其中,靠近第一顶点的样条线为x2,P0到P1的向量为上述第一向量,为第一向量沿样条线为x2方向的分量。
需要说明的是,在本实施例中对第一向量在第一水平面内垂直该至少一个第一样条线中靠近该第一顶点的样条线的分量、以及第一向量垂直第一水平面的分量不作具体限制。
在本实施例中,通过将该第一向量在第一方向的分量的模与第一余切值的比值,确定为第一转角对应的第三目标值,并将第一转角对应的第三目标值,确定为该第二转角对应的第三目标值,一方面,能够保证第二转角和墙体之间不会出现裂缝;另一方面,由于在计算第三目标值时,将第一余切值确定为该两个样条线的最小夹角的半角的余切值,能够实现第一转角形变到第二转角后,第二转角和墙体之间不会出现穿插或重叠。
在本申请的一些实施例中,该第二转角对应的至少一个目标值基于第二向量和至少一个第二样条线之间的位置关系确定,该第二向量为用于控制该第二转角的第二控制点到该第二顶点的向量;该至少一个第二样条线为经过该第二控制点的且用于表征该第二网格模型的轮廓的线条;
基于此,S105可包括:
基于该至少一个第二样条线的位置、该第二控制点的位置和该第二转角对应的至少一个目标值,计算该第二顶点的顶点坐标。
示例性地,该第二转角对应的至少一个目标值基于第二向量和至少一个第二样条线之间的位置关系确定,可以理解为该第二转角对应的至少一个目标值是:能够体现该第二向量和和至少一个第二样条线之间的位置关系的目标值。
在本实施例中,通过将第一转角对应的至少一个目标值,确定为第二转角对应的至少一个目标值,并基于第二转角对应的至少一个目标值,确定第二顶点的顶点坐标,能够保证计算出的第二顶点的顶点坐标满足第一条件,该第一条件为第一向量和至少一个第一样条线之间的位置关系、与第二向量和至少一个第二样条线之间的位置关系相同。
需要说明的是,本申请提供的网格模型处理方法在计算第二转角下的第二网格模型时,不仅考虑了保证静态网格上第一向量和至少一个第一样条线之间的位置关系不变,除此之外,由于三维建模软件Autodesk 3ds Max中实现的自由变形方式只关注顶点在几何上的形变,并没有重新计算顶点对应的UV坐标,导致转角形变之后,新网格模型对应的贴图被拉伸或压缩;如果贴图是有规则有纹理的贴图,这个问题会非常明显。例如,如图4所示,针对静态网格体上的第三目标,左侧为转角形变前静态网格体上的第三目标,右侧为转角形变后静态网格体上的第三目标,如图4右侧所示,在转角形变后,该第三目标被拉伸。
基于此,本申请提供的网格模型处理方法在考虑转角形变前后静态网格模型上第一向量和至少一个第一样条线之间的位置关系不变外,还对第二网格模型上顶点在贴图中的UV坐标重新计算,使第二网格模型上转角和墙体之间的衔接面与墙体垂直、墙体的厚度不发生改变、且转角和墙面之间不出现裂缝和相互重叠的基础上,还能够使转角上的贴图不发生拉伸、错位、扭曲和断裂。
下边对本申请提供的方案中如何计算第二贴图中的UV坐标,并结合第二网格模型上的顶点坐标生成第二网格模型进行详细说明:
在本申请的一些实施例中,S106可包括:
基于该第一网格模型上多个顶点的几何高度,将该第一网格模型划分为多个层级;
确定该第一顶点与第三顶点在第一贴图中的第一水平距离,该第一贴图为该第一网 格模型对应的贴图;该多个顶点包括该第三顶点、且该第三顶点与该第一顶点在该多个层级中的同一层级;
基于该第一水平距离,确定该第一水平距离上单位长度内像素点的个数;
将该第一水平距离上单位长度内像素点的个数,确定为第二水平距离上单位长度内像素点的个数,该第二水平距离为该第二顶点与第四顶点在第二贴图中的水平距离,该第四顶点为该第一转角形变为该第二转角后与该第三顶点对应的顶点,该第二贴图为该第二网格模型对应的贴图;
基于该第二水平距离上单位长度内像素点的个数,确定该第二顶点在该第二贴图中的U坐标;
基于该第二顶点在该第二贴图中的U坐标和该第二顶点的顶点坐标,确定该第二转角下的第二网格模型。
在一些实现方式中,基于该第一转角的角平分线将该第一网格模型中相邻几何高度的顶点划分为同一层级,得到该多个层级。
在另一些实现方式中,基于该第一转角的角平分线将该第一网格模型划分为两个第三网格模型;将该第三网格模型中相邻几何高度的顶点划分为同一层级,得到该多个层级。示例性的,如图9所示,利用第一转角的角平分线将第一网格模型一分为二,针对左侧第三网格模型,该第三网格模型上顶点P0和顶点P1属于同一层级的两个顶点;顶点P1和顶点P2属于同一层级的两个顶点;其中,P0在贴图中对应的坐标为(U0,V0),P1在贴图中对应的坐标为(U1,V1);P2在贴图中对应的坐标为(U2,V2)。
在该实现方式中,在划分层级前,先通过第一转角的角平分线将第一网格模型均分为两个第三网格模型,再分别对每一个第三网格模型进行层级划分,进而针对每一个第三网格模型计算第二转角下的顶点坐标,能够使第二转角和相连的两面墙体之间的贴图无缝拼接,彼此之间不会出现断裂或错位。
在一些实现方式中,该第三顶点可以是与该第一顶点在同一层级的任一顶点。需要说明的是,该第三顶点与该第一顶点不同。
应理解,由于第一转角形变只是在沿第一转角的水平方向上放缩,在第一转角的垂直方向上保持不变,因此在重新计算第二网格模型上每个顶点在第二贴图中对应的UV坐标时,只需计算每个顶点在第二贴图中的U坐标,每个顶点在第二贴图中的V坐标和其在第一贴图中的V坐标相同。需要说明的是,每个顶点在第一贴图中的V坐标和其在第二贴图中的V坐标相同,能够使第二贴图中第二转角和相连的两面墙体之间的贴图可以拼接在一起。
在本实施例中,首先,将第三顶点确定为与该第一顶点在同一层级的顶点,相当于,考虑到转角上的水平线段,其几何尺寸通常只是和贴图中的UV尺寸近似成比例,并不是在数值上完全相同,如果将不同层次的顶点一起计算,相互影响,会导致第二转角下部分三角面片的贴图拉伸或扭曲。
其次,通过将该第一水平距离上单位长度内像素点的个数,确定为第二水平距离上单位长度内像素点的个数,能够实现第一顶点所在层次中,第一顶点和第三顶点在第一贴图中的水平部分在第二贴图中不会被拉伸、断裂或错位,进而保证第二贴图中每个层级上的贴图不会被拉伸、断裂或错位。
需要说明的是,由于本申请的网格模型处理方案考虑到转角形变前后,网格模型上纹理贴图不能出现拉伸、断裂或错位的性质,所以,将本申请的网格模型处理方案应用在游戏场景搭建时,能够使游戏场景中建筑的纹理更贴近游戏场景,更加逼真,有助于提升3D游戏的游玩效果,进而提升用户体验。
图10是本申请实施例提供的,考虑转角形变后贴图中单位长度内像素点的个数与转角形变前贴图中单位长度内像素点的个数相同,生成的第二网格模型、和已有方案中 转角形变前后贴图不变生成的第二网格模型进行对比的效果图。如图10所示,左侧为考虑转角形变后贴图中单位长度内像素点的个数与转角形变前贴图中单位长度内像素点的个数相同,生成的第二网格模型,该第二网格模型上贴图没有被拉伸或扭曲;右侧为转角形变前后贴图不变生成的第二网格模型,该第二网格模型上贴图被拉伸变形,出现裂缝。
此外,由于本实施例提供的方案对第一网格模型划分层级;所以该方案对多层次的墙角模型、有倾斜面的墙角模型、以及同时有多层次结构和倾斜面的墙角模型均适用。
如图11至图13所示,利用本申请实施例提供的网格模型处理方案,对多层次的墙角模型、有倾斜面的墙角模型、以及同时有多层次结构和倾斜面的墙角模型的转角进行形变,生成的网格模型均保持完好的状态,无拉伸、断裂、扭曲和错位。
虽然本实施例得到的第二贴图中不同层级间可能会有错位,但这种错位在可接受范围,而且若转角上不同层级的两顶点之间的水平几何尺寸和其在贴图中对应的U尺寸比较接近时,则该两顶点所在的面片对应的贴图部分在第二贴图中的错位就会比较小。
在本申请的一些实施例中,可通过如下方式确定第一水平距离上单位长度内像素点的个数:
确定该第一顶点到该第三顶点的向量在该至少一个第一样条线中靠近该第一顶点的样条线上的第一投影;
将该第一水平距离与该第一投影的比值,确定为该第一水平距离上单位长度内像素点的个数。在本实施例中,由于考虑到第一转角形变到第二转角的过程中,同一层级的两个顶点在贴图中的水平距离、和该两个顶点在沿经过控制转角的样条线方向的几何水平距离永远成比例,所以将该第一水平距离与该第一投影的比值,确定为该第一水平距离上单位长度内像素点的个数,以避免第一转角形变到第二转角的过程中,同一层级的两个顶点所在面片的贴图发生拉伸、断裂、扭曲或错位。
在本申请的一些实施例中,可通过如下方式计算该第二顶点在该第二贴图中的U坐标:
确定该第二顶点到该第四顶点的向量在至少一个第二样条线中靠近该第二顶点的样条线上的第二投影;该至少一个第二样条线为经过用于控制该第二转角的第二控制点的且用于表征该第二网格模型的轮廓的线条;
将该第二投影与该第二水平距离上单位长度内像素点的个数的乘积,确定为该第二顶点与该第四顶点在该第二贴图中的第二水平距离;
基于该第二水平距离和该第四顶点在该第二贴图中的U坐标,计算该第二顶点在该第二贴图中的U坐标。
在一种实现方式中,若第三顶点为该第一顶点所在层级中、且在该至少一个第一样条线中靠近该第一顶点的样条线方向上距离该第一控制点最远的顶点,则第四顶点在第二贴图中的U坐标可以和第三顶点在第一贴图中的U坐标相同。
在一种实现方式中,若第三顶点不为该第一顶点所在层级中、且在该至少一个第一样条线中靠近该第一顶点的样条线方向上距离该第一控制点最远的顶点,则可通过如下方式计算第四顶点在第二贴图中的U坐标:
先确定该第一顶点所在层级中、且在该至少一个第一样条线中靠近该第一顶点的样条线方向上距离该第一控制点最远的第五顶点;
确定第三顶点与第五顶点在第一贴图中的水平距离上单位长度内像素点的个数;
基于第三顶点与第五顶点在第一贴图中的水平距离上单位长度内像素点的个数,和第四顶点与第六顶点在第二贴图中的水平距离上单位长度内像素点的个数相同、且第五顶点在第一贴图中的U坐标和第六顶点在第二贴图中的U坐标相同,确定第四顶点在贴图中的U坐标。
其中,第六顶点为该第一转角形变为该第二转角后与该第五顶点对应的顶点。
在本申请的一些实施例中,在确定出第二顶点的U坐标后,通过如下方式确定第二网格模型:
将该第一顶点在该第一贴图中的V坐标,确定为该第二顶点在该第二贴图中的V坐标;
将该第二顶点在该第二贴图中的UV坐标与该第二顶点的顶点坐标进行线性叠加处理,确定该第二网格模型。
图14是本申请实施例提供的网格模型处理方法200的另一流程图。
如图14所示,该方法200可包括以下中的部分或全部内容:
S201,获取第一网格模型,该第一网格模型包括第一转角和第一顶点。
S202,响应于用户在显示界面上对用于控制该第一转角的第一控制点执行的操作,得到第二转角。
S203,基于第一向量和至少一个第一样条线之间的位置关系,将所述第一向量在第一水平面内的第一分量的模,确定为第一目标值。
需要说明的是,该第一向量为该第一控制点到该第一顶点的向量,所述第一分量为垂直所述至少一个第一样条线中靠近所述第一顶点的样条线的分量,该至少一个第一样条线为经过该第一控制点的且用于表征该第一网格模型的轮廓的线条;该至少一个第一样条线为多个第一样条线,该第一水平面为该多个第一样条线形成的水平面,该第一转角对应的至少一个目标值包括该第一目标值。
S204,基于第一向量和至少一个第一样条线之间的位置关系,将该第一向量垂直第一水平面的分量的模,确定为第一转角对应的第二目标值。
需要说明的是,所述第一转角对应的至少一个目标值包括所述第二目标值。
S205,基于第一向量和至少一个第一样条线之间的位置关系,将所述第一向量在第一方向的分量的模与第一余切值的比值,确定为第三目标值。
需要说明的是,所述第一方向为所述至少一个第一样条线中靠近所述第一顶点的样条线方向,所述至少一个第一样条线为两个样条线,所述第一余切值为所述两个样条线的最小夹角的半角的余切值,所述第一转角对应的至少一个目标值包括所述第三目标值。
S206,将第一转角对应的第一目标值、第二目标值、第三目标值,分别确定为第二转角对应的第一目标值、第二目标值、第三目标值。
S207,基于第二转角对应的第一目标值、第二目标值、第三目标值,确定第二顶点的顶点坐标。
S208,基于该第一网格模型上多个顶点的几何高度,将该第一网格模型划分为多个层级。
S209,确定该第一顶点与第三顶点在第一贴图中的第一水平距离。
需要说明的是,该第一贴图为该第一网格模型对应的贴图;该第三顶点为该第一顶点所在层级中、且在该至少一个第一样条线中靠近该第一顶点的样条线方向上距离该第一控制点最远的顶点,该第三顶点在该第一贴图中对应的U坐标与该第四顶点在该第二贴图中对应的U坐标相同。
S210,基于该第一水平距离,确定该第一水平距离上单位长度内像素点的个数。
S211,将该第一水平距离上单位长度内像素点的个数,确定为第二水平距离上单位长度内像素点的个数。
需要说明的是,该第二水平距离为该第二顶点与第四顶点在第二贴图中的水平距离,该第四顶点为该第一转角形变为该第二转角后与该第三顶点对应的顶点,该第二贴图为该第二网格模型对应的贴图;
S212,基于该第二水平距离上单位长度内像素点的个数,确定该第二顶点在该第二贴图中的U坐标。
需要说明的是,第二顶点在该第二贴图中的V坐标与第一顶点在该第一贴图中的V 坐标相同。
S213,对该第二顶点在该第二贴图中的UV坐标和该第二顶点的顶点坐标进行线性叠加处理处理,确定第二转角下的第二网格模型。
在本实施例提供的方案中,在重新计算第二转角下的顶点坐标时,通过基于第一向量和至少一个第一样条线之间的位置关系,确定第一转角下的第一目标值、第二目标值和第三目标值,一方面,能够保证在第一网格模型上的墙体有厚度和第二网格模型上的墙体厚度相同,以便在第二转角下,第二网格模型上的第二转角和墙体能够无缝衔接。另一方面,能够使第一转角形变为第二转角后,第二转角的高度不变,进而保证第二转角和墙体的衔接面与墙体仍垂直,即保证转角和衔接面之间不会出现断层。而且能够保证第二转角和墙体之间不会出现裂缝、穿插和重叠。
此外,在重新计算第二网格模型上各顶点对应的UV坐标时,通过将该第一水平距离上单位长度内像素点的个数,确定为第二水平距离上单位长度内像素点的个数,能够实现第一顶点所在层次中,第一顶点和第三顶点在第一贴图中的水平部分在第二贴图中不会被拉伸、断裂或错位,进而保证第二贴图中每个层级上的贴图不会被拉伸、断裂或错位。
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
上文对本申请实施例提供的方法进行了说明,下面对本申请实施例提供的装置进行说明。
图15是本申请实施例提供的网格模型处理装置300的示意性框图。
如图15所示,该网格模型处理装置300可包括:
获取单元310,用于获取第一网格模型,该第一网格模型包括第一转角和第一顶点;
第一确定单元320,用于响应于用户在显示界面上对用于控制该第一转角的第一控制点执行的操作,得到第二转角;
第二确定单元330,用于基于第一向量和至少一个第一样条线之间的位置关系,确定该第一转角对应的至少一个目标值,该第一向量为该第一控制点到该第一顶点的向量,该至少一个第一样条线为经过该第一控制点的且用于表征该第一网格模型的轮廓的线条;
第三确定单元340,用于将该第一转角对应的至少一个目标值,分别确定为该第二转角对应的至少一个目标值;
第四确定单元350,用于基于该第二转角对应的至少一个目标值,确定第二顶点的顶点坐标,该第二顶点为该第一转角形变为该第二转角后与该第一顶点对应的顶点;
第五确定单元360,用于基于该第二顶点的顶点坐标,确定该第二转角下的第二网格模型。
在本申请的一些实施例中,第二确定单元330具体用于:
基于第一向量和至少一个第一样条线之间的位置关系,将所述第一向量在第一水平面内的第一分量的模,确定为第一目标值;
其中,所述第一分量为垂直所述至少一个第一样条线中靠近所述第一顶点的样条线 的分量,该至少一个第一样条线为多个第一样条线,该第一水平面为该多个第一样条线形成的水平面,该第一转角对应的至少一个目标值包括该第一目标值。
在本申请的一些实施例中,第二确定单元330具体还用于:
基于第一向量和至少一个第一样条线之间的位置关系,将该第一向量垂直第一水平面的分量的模,确定为第二目标值;
其中,该至少一个第一样条线为多个第一样条线,该第一水平面为该多个第一样条线形成的水平面,该第一转角对应的至少一个目标值包括该第二目标值。
在本申请的一些实施例中,第二确定单元330具体还用于:
基于第一向量和至少一个第一样条线之间的位置关系,将所述第一向量在第一方向的分量的模与第一余切值的比值,确定为第三目标值;
其中,所述第一方向为所述至少一个第一样条线中靠近所述第一顶点的样条线方向,该至少一个第一样条线为两个样条线,该第一余切值为该两个样条线的最小夹角的半角的余切值,所述第一转角对应的至少一个目标值包括所述第三目标值。
在本申请的一些实施例中,该第二转角对应的至少一个目标值基于第二向量和至少一个第二样条线之间的位置关系确定,该第二向量为用于控制该第二转角的第二控制点到该第二顶点的向量;该至少一个第二样条线为经过该第二控制点的且用于表征该第二网格模型的轮廓的线条;
基于此,第四确定单元350具体用于:
基于该至少一个第二样条线的位置、该第二控制点的位置和该第二转角对应的至少一个目标值,计算该第二顶点的顶点坐标。
在本申请的一些实施例中,第五确定单元360具体用于:
基于该第一网格模型上多个顶点的几何高度,将该第一网格模型划分为多个层级;
确定该第一顶点与第三顶点在第一贴图中的第一水平距离,该第一贴图为该第一网格模型对应的贴图;该多个顶点包括该第三顶点、且该第三顶点与该第一顶点在该多个层级中的同一层级;
基于该第一水平距离,确定该第一水平距离上单位长度内像素点的个数;
将该第一水平距离上单位长度内像素点的个数,确定为第二水平距离上单位长度内像素点的个数,该第二水平距离为该第二顶点与第四顶点在第二贴图中的水平距离,该第四顶点为该第一转角形变为该第二转角后与该第三顶点对应的顶点,该第二贴图为该第二网格模型对应的贴图;
基于该第二水平距离上单位长度内像素点的个数,确定该第二顶点在该第二贴图中的U坐标;
基于该第二顶点在该第二贴图中的U坐标和该第二顶点的顶点坐标,确定该第二转角下的第二网格模型。
在本申请的一些实施例中,第五确定单元360具体还用于:
确定该第一顶点到该第三顶点的向量在该至少一个第一样条线中靠近该第一顶点的样条线上的第一投影;
将该第一水平距离与该第一投影的比值,确定为该第一水平距离上单位长度内像素点的个数。
在本申请的一些实施例中,第五确定单元360具体还用于:
确定该第二顶点到该第四顶点的向量在至少一个第二样条线中靠近该第二顶点的样条线上的第二投影;该至少一个第二样条线为经过用于控制该第二转角的第二控制点的且用于表征该第二网格模型的轮廓的线条;
将该第二投影与该第二水平距离上单位长度内像素点的个数的乘积,确定为该第二顶点与该第四顶点在该第二贴图中的第二水平距离;
基于该第二水平距离和该第四顶点在该第二贴图中的U坐标,计算该第二顶点在该 第二贴图中的U坐标。
在本申请的一些实施例中,第五确定单元360具体还用于:
将该第一顶点在该第一贴图中的V坐标,确定为该第二顶点在该第二贴图中的V坐标;
对该第二顶点在该第二贴图中的UV坐标与该第二顶点的顶点坐标进行线性叠加处理,确定该第二网格模型。
在本申请的一些实施例中,该第三顶点为该第一顶点所在层级中、且在该至少一个第一样条线中靠近该第一顶点的样条线方向上距离该第一控制点最远的顶点,该第三顶点在该第一贴图中对应的U坐标与该第四顶点在该第二贴图中对应的U坐标相同。
在本申请的一些实施例中,第五确定单元360具体还用于:
基于该第一转角的角平分线将该第一网格模型划分为两个第三网格模型;
将该第三网格模型中相邻几何高度的顶点划分为同一层级,得到该多个层级。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,网格模型处理装置300可以对应于执行本申请实施例的方法100或方法200中的相应主体,并且网格模型处理装置300中的各个单元分别为了实现方法100或方法200中的相应流程,为了简洁,在此不再赘述。
还应当理解,本申请实施例涉及的网格模型处理装置300中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,该网格模型处理装置300也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。根据本申请的另一个实施例,可以通过在包括例如中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的通用计算机的通用计算设备上运行能够执行相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造本申请实施例涉及的网格模型处理装置300,以及来实现本申请实施例的网格模型处理方法。计算机程序可以记载于例如计算机可读存储介质上,并通过计算机可读存储介质装载于电子设备中,并在其中运行,来实现本申请实施例提供的相应方法。
换言之,上文涉及的单元可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过软硬件结合的形式实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件组合执行完成。可选地,软件可以位于随机存储器,闪存、只读存储器、可编程只读存储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。
图16是本申请实施例提供的电子设备400的示意结构图。
如图16所示,该电子设备400至少包括处理器410以及计算机可读存储介质420。其中,处理器410以及计算机可读存储介质420可通过总线或者其它方式连接。计算机可读存储介质420用于存储计算机程序421,计算机程序421包括计算机指令,处理器410用于执行计算机可读存储介质420存储的计算机指令。处理器410是电子设备400的计算核心以及控制核心,其适于实现一条或多条计算机指令,具体适于加载并执行一条或多条计算机指令从而实现相应方法流程或相应功能。
作为示例,处理器410也可称为中央处理器(Central Processing Unit,CPU)。处理器410可以包括但不限于:通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵 列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等等。
作为示例,计算机可读存储介质420可以是高速RAM存储器,也可以是非不稳定的存储器(Non-Volatile Memory),例如至少一个磁盘存储器;可选的,还可以是至少一个位于远离前述处理器410的计算机可读存储介质。具体而言,计算机可读存储介质420包括但不限于:易失性存储器和/或非易失性存储器。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。
在一种实现方式中,该电子设备400可以是图15所示的网格模型处理装置300;该计算机可读存储介质420中存储有计算机指令;由处理器410加载并执行计算机可读存储介质420中存放的计算机指令,以实现方法实施例中的相应步骤;具体实现中,计算机可读存储介质420中的计算机指令由处理器410加载并执行相应步骤,为避免重复,此处不再赘述。
根据本申请的另一方面,本申请实施例还提供了一种计算机可读存储介质(Memory),计算机可读存储介质是电子设备400中的记忆设备,用于存放程序和数据。例如,计算机可读存储介质420。可以理解的是,此处的计算机可读存储介质420既可以包括电子设备400中的内置存储介质,当然也可以包括电子设备400所支持的扩展存储介质。计算机可读存储介质提供存储空间,该存储空间存储了电子设备400的操作系统。并且,在该存储空间中还存放了适于被处理器410加载并执行的一条或多条的计算机指令,这些计算机指令可以是一个或多个的计算机程序421(包括程序代码)。
该电子设备400还可包括:收发器430,该收发器430可连接至该处理器410或计算机可读存储介质420。
其中,计算机可读存储介质420可以控制该收发器430与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。收发器430可以包括发射机和接收机。收发器430还可以进一步包括天线,天线的数量可以为一个或多个。
根据本申请的另一方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。例如,计算机程序421。此时,电子设备400可以是计算机,处理器410从计算机可读存储介质420读取该计算机指令,处理器410执行该计算机指令,使得该计算机执行上述各种可选方式中提供的网格模型处理方法。
换言之,当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地运行本申请实施例的流程或实现本申请实施例的功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质进行传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例 如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元以及流程步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
最后需要说明的是,以上实施例仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。

Claims (15)

  1. 一种网格模型处理方法,其特征在于,包括:
    获取第一网格模型,所述第一网格模型包括第一转角和第一顶点;
    响应于用户在显示界面上对用于控制所述第一转角的第一控制点执行的操作,得到第二转角;
    基于第一向量和至少一个第一样条线之间的位置关系,确定所述第一转角对应的至少一个目标值;所述第一向量为所述第一控制点到所述第一顶点的向量,所述至少一个第一样条线为经过所述第一控制点的且用于表征所述第一网格模型的轮廓的线条;
    将所述第一转角对应的至少一个目标值,分别确定为所述第二转角对应的至少一个目标值;
    基于所述第二转角对应的至少一个目标值,确定第二顶点的顶点坐标;所述第二顶点为所述第一转角形变为所述第二转角后与所述第一顶点对应的顶点;
    基于所述第二顶点的顶点坐标,确定所述第二转角下的第二网格模型。
  2. 根据权利要求1所述的方法,其特征在于,所述基于第一向量和至少一个第一样条线之间的位置关系,确定所述第一转角对应的至少一个目标值,包括:
    基于所述第一向量和所述至少一个第一样条线之间的位置关系,将所述第一向量在第一水平面内的第一分量的模,确定为第一目标值;
    其中,所述第一分量为垂直所述至少一个第一样条线中靠近所述第一顶点的样条线的分量,所述至少一个第一样条线为多个第一样条线,所述第一水平面为所述多个第一样条线形成的水平面,所述第一转角对应的至少一个目标值包括所述第一目标值。
  3. 根据权利要求1所述的方法,其特征在于,所述基于第一向量和至少一个第一样条线之间的位置关系,确定所述第一转角对应的至少一个目标值,包括:
    基于所述第一向量和所述至少一个第一样条线之间的位置关系,将所述第一向量垂直第一水平面的分量的模,确定为第二目标值;
    其中,所述至少一个第一样条线为多个第一样条线,所述第一水平面为所述多个第一样条线形成的水平面,所述第一转角对应的至少一个目标值包括所述第二目标值。
  4. 根据权利要求1所述的方法,其特征在于,所述基于第一向量和至少一个第一样条线之间的位置关系,确定所述第一转角对应的至少一个目标值,包括:
    基于所述第一向量和所述至少一个第一样条线之间的位置关系,将所述第一向量在第一方向的分量的模与第一余切值的比值,确定为第三目标值;
    其中,所述第一方向为所述至少一个第一样条线中靠近所述第一顶点的样条线方向,所述至少一个第一样条线为两个样条线,所述第一余切值为所述两个样条线的最小夹角的半角的余切值,所述第一转角对应的至少一个目标值包括所述第三目标值。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述第二转角对应的至少一个目标值基于第二向量和至少一个第二样条线之间的位置关系确定,所述第二向量为用于控制所述第二转角的第二控制点到所述第二顶点的向量;所述至少一个第二样条线为经过所述第二控制点的且用于表征所述第二网格模型的轮廓的线条;
    其中,所述基于所述第二转角对应的至少一个目标值,确定第二顶点的顶点坐标,包括:
    基于所述至少一个第二样条线的位置、所述第二控制点的位置和所述第二转角对应的至少一个目标值,计算所述第二顶点的顶点坐标。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述基于所述第二顶点的顶点坐标,确定所述第二转角下的第二网格模型,包括:
    基于所述第一网格模型上多个顶点的几何高度,将所述第一网格模型划分为多个层 级;
    确定所述第一顶点与第三顶点在第一贴图中的第一水平距离,所述第一贴图为所述第一网格模型对应的贴图;所述多个顶点包括所述第三顶点、且所述第三顶点与所述第一顶点在所述多个层级中的同一层级;
    基于所述第一水平距离,确定所述第一水平距离上单位长度内像素点的个数;
    将所述第一水平距离上单位长度内像素点的个数,确定为第二水平距离上单位长度内像素点的个数,所述第二水平距离为所述第二顶点与第四顶点在第二贴图中的水平距离,所述第四顶点为所述第一转角形变为所述第二转角后与所述第三顶点对应的顶点,所述第二贴图为所述第二网格模型对应的贴图;
    基于所述第二水平距离上单位长度内像素点的个数,确定所述第二顶点在所述第二贴图中的U坐标;
    基于所述第二顶点在所述第二贴图中的U坐标和所述第二顶点的顶点坐标,确定所述第二转角下的第二网格模型。
  7. 根据权利要求6所述的方法,其特征在于,所述基于所述第一水平距离,确定所述第一水平距离上单位长度内像素点的个数,包括:
    确定所述第一顶点到所述第三顶点的向量在所述至少一个第一样条线中靠近所述第一顶点的样条线上的第一投影;
    将所述第一水平距离与所述第一投影的比值,确定为所述第一水平距离上单位长度内像素点的个数。
  8. 根据权利要求6或7所述的方法,其特征在于,所述基于所述第二水平距离上单位长度内像素点的个数,确定所述第二顶点在所述第二贴图中的U坐标,包括:
    确定所述第二顶点到所述第四顶点的向量在至少一个第二样条线中靠近所述第二顶点的样条线上的第二投影;所述至少一个第二样条线为经过用于控制所述第二转角的第二控制点的且用于表征所述第二网格模型的轮廓的线条;
    将所述第二投影与所述第二水平距离上单位长度内像素点的个数的乘积,确定为所述第二顶点与所述第四顶点在所述第二贴图中的第二水平距离;
    基于所述第二水平距离和所述第四顶点在所述第二贴图中的U坐标,计算所述第二顶点在所述第二贴图中的U坐标。
  9. 根据权利要求6至8中任一项所述的方法,其特征在于,所述基于所述第二顶点在所述第二贴图中的U坐标和所述第二顶点的顶点坐标,确定所述第二转角下的第二网格模型,包括:
    将所述第一顶点在所述第一贴图中的V坐标,确定为所述第二顶点在所述第二贴图中的V坐标;
    对所述第二顶点在所述第二贴图中的UV坐标与所述第二顶点的顶点坐标进行线性叠加处理,确定所述第二网格模型。
  10. 根据权利要求6至9中任一项所述的方法,其特征在于,所述第三顶点为所述第一顶点所在层级中、且在所述至少一个第一样条线中靠近所述第一顶点的样条线方向上距离所述第一控制点最远的顶点,所述第三顶点在所述第一贴图中对应的U坐标与所述第四顶点在所述第二贴图中对应的U坐标相同。
  11. 根据权利要求6至10中任一项所述的方法,其特征在于,所述基于所述第一网格模型上多个顶点的几何高度,将所述第一网格模型划分为多个层级,包括:
    基于所述第一转角的角平分线将所述第一网格模型划分为两个第三网格模型;
    将所述第三网格模型中相邻几何高度的顶点划分为同一层级,得到所述多个层级。
  12. 一种网格模型处理装置,其特征在于,包括:
    获取单元,用于获取第一网格模型,所述第一网格模型包括第一转角和第一顶点;
    第一确定单元,用于响应于用户在显示界面上对用于控制所述第一转角的第一控制 点执行的操作,得到第二转角;
    第二确定单元,用于基于第一向量和至少一个第一样条线之间的位置关系,确定所述第一转角对应的至少一个目标值,所述第一向量为所述第一控制点到所述第一顶点的向量,所述至少一个第一样条线为经过所述第一控制点的且用于表征所述第一网格模型的轮廓的线条;
    第三确定单元,用于将所述第一转角对应的至少一个目标值,分别确定为所述第二转角对应的至少一个目标值;
    第四确定单元,用于基于所述第二转角对应的至少一个目标值,确定第二顶点的顶点坐标,所述第二顶点为所述第一转角形变为所述第二转角后与所述第一顶点对应的顶点;
    第五确定单元,用于基于所述第二顶点的顶点坐标,确定所述第二转角下的第二网格模型。
  13. 一种电子设备,其特征在于,包括:
    处理器,适于执行计算机程序;
    计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序被所述处理器执行时,实现如权利要求1至11中任一项所述的方法。
  14. 一种计算机可读存储介质,其特征在于,用于存储计算机程序,所述计算机程序使得计算机执行如权利要求1至11中任一项所述的方法。
  15. 一种计算机程序产品,包括计算机程序和/或指令,其特征在于,所述计算机程序和/或指令被处理器执行时实现如权利要求1至11中任一项所述的方法。
PCT/CN2023/073411 2022-03-28 2023-01-20 网格模型处理方法、装置、设备以及存储介质 WO2023185228A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/383,250 US20240054728A1 (en) 2022-03-28 2023-10-24 Mesh Model Transformation

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210316824.4 2022-03-28
CN202210316824.4A CN116863100A (zh) 2022-03-28 2022-03-28 网格模型处理方法、装置、设备以及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/383,250 Continuation US20240054728A1 (en) 2022-03-28 2023-10-24 Mesh Model Transformation

Publications (1)

Publication Number Publication Date
WO2023185228A1 true WO2023185228A1 (zh) 2023-10-05

Family

ID=88199035

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/073411 WO2023185228A1 (zh) 2022-03-28 2023-01-20 网格模型处理方法、装置、设备以及存储介质

Country Status (3)

Country Link
US (1) US20240054728A1 (zh)
CN (1) CN116863100A (zh)
WO (1) WO2023185228A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130215115A1 (en) * 2010-06-30 2013-08-22 Barry Lynn Jenkins Delivering and controlling streaming interactive media comprising rendered geometric, texture and lighting data
US20160005222A1 (en) * 2013-03-12 2016-01-07 Mitsubishi Electric Corporation Three-dimensional information processing device
US10878610B1 (en) * 2019-09-27 2020-12-29 Big Fish Games, Inc. Generating an animation feature from line deformations
WO2021238188A1 (zh) * 2020-05-25 2021-12-02 北京达佳互联信息技术有限公司 图像配准方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130215115A1 (en) * 2010-06-30 2013-08-22 Barry Lynn Jenkins Delivering and controlling streaming interactive media comprising rendered geometric, texture and lighting data
US20160005222A1 (en) * 2013-03-12 2016-01-07 Mitsubishi Electric Corporation Three-dimensional information processing device
US10878610B1 (en) * 2019-09-27 2020-12-29 Big Fish Games, Inc. Generating an animation feature from line deformations
WO2021238188A1 (zh) * 2020-05-25 2021-12-02 北京达佳互联信息技术有限公司 图像配准方法及装置

Also Published As

Publication number Publication date
CN116863100A (zh) 2023-10-10
US20240054728A1 (en) 2024-02-15

Similar Documents

Publication Publication Date Title
US11538229B2 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
WO2021120810A1 (zh) 三维人脸模型的生成方法、装置、设备及介质
WO2022057526A1 (zh) 三维模型重建方法、三维重建模型的训练方法和装置
WO2023241097A1 (zh) 一种语义实例重建方法、装置、设备及介质
CN112836064A (zh) 知识图谱补全方法、装置、存储介质及电子设备
CN112733820B (zh) 障碍物信息生成方法、装置、电子设备和计算机可读介质
CN109754464B (zh) 用于生成信息的方法和装置
CN112598780A (zh) 实例对象模型构建方法及装置、可读介质和电子设备
CN115018992A (zh) 发型模型的生成方法、装置、电子设备及存储介质
CN114998433A (zh) 位姿计算方法、装置、存储介质以及电子设备
WO2023185228A1 (zh) 网格模型处理方法、装置、设备以及存储介质
CN117252959A (zh) 特效动画的生成方法、装置、电子设备及存储介质
CN109816791B (zh) 用于生成信息的方法和装置
CN109087250B (zh) 基于规则边界约束的图像拼接方法
CN116385667A (zh) 三维模型的重建方法、纹理重构模型的训练方法以及装置
CN116188742A (zh) 虚拟对象的控制方法、装置、设备及存储介质
WO2022236802A1 (zh) 一种物体模型的重建方法、装置、终端设备和存储介质
CN115375836A (zh) 基于多元置信度滤波的点云融合三维重建方法和系统
CN113487713A (zh) 一种点云特征提取方法、装置及电子设备
CN113592990A (zh) 针对二维图像的三维效果生成方法、装置、设备及介质
CN116433852B (zh) 数据处理方法、装置、设备及存储介质
CN117557699B (zh) 动画数据生成方法、装置、计算机设备和存储介质
US20240203030A1 (en) 3d model rendering method and apparatus, electronic device, and storage medium
Zhang et al. A Hybrid framework for mobile augmented reality
WO2024087137A1 (zh) 一种渲染方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23777607

Country of ref document: EP

Kind code of ref document: A1