CN112132935A - Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium - Google Patents

Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium Download PDF

Info

Publication number
CN112132935A
CN112132935A CN202011001968.8A CN202011001968A CN112132935A CN 112132935 A CN112132935 A CN 112132935A CN 202011001968 A CN202011001968 A CN 202011001968A CN 112132935 A CN112132935 A CN 112132935A
Authority
CN
China
Prior art keywords
vertex
coordinates
deformation
model element
target
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202011001968.8A
Other languages
Chinese (zh)
Inventor
陈逸飏
周昊楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mihoyo Tianming Technology Co Ltd
Original Assignee
Shanghai Mihoyo Tianming Technology Co Ltd
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 Shanghai Mihoyo Tianming Technology Co Ltd filed Critical Shanghai Mihoyo Tianming Technology Co Ltd
Priority to CN202011001968.8A priority Critical patent/CN112132935A/en
Publication of CN112132935A publication Critical patent/CN112132935A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/403D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/603D [Three Dimensional] animation of natural phenomena, e.g. rain, snow, water or plants
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • A63F2300/663Methods for processing data by generating or executing the game program for rendering three dimensional images for simulating liquid objects, e.g. water, gas, fog, snow, clouds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/24Fluid dynamics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/44Morphing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention discloses a method, a device, equipment and a medium for deformation processing and picture rendering of model elements. The deformation processing method of the model element comprises the following steps: extracting vertex data of the model elements, the vertex data comprising: information of vertex coordinates of each vertex and a center point of the model element; and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain the vertex deformation coordinates of each vertex. According to the technical scheme of the embodiment of the invention, when the model elements in the interactive scene are subjected to deformation processing, the deformation processing of the vertexes of the model elements around the center points of the model elements is controlled, so that the new model elements obtained after rendering are closer to the actual interactive stress effect.

Description

Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium
Technical Field
The embodiment of the invention relates to an image processing technology, in particular to a game image engine technology, and specifically relates to a method, a device, equipment and a medium for deformation processing and picture rendering of model elements.
Background
In the world of gaming, it is often necessary to lay down a large number of small objects under a scene or in a large area within a scene to add detail, complement the scene, and characterize the area. For example, a large amount of flowers and plants, small vegetation, or the like are laid on a lawn.
In order to achieve perfect fusion of the laid small objects and the scene, the game picture is generally required to be capable of fitting the interaction effect of the small objects extruded all around when the small objects pass by dynamic objects (such as characters, weapons held by the characters or launched skills), so as to create a simulation scene in which the small objects deform in the interaction process. However, no effective processing technology for performing interactive deformation on small objects is available in the prior art.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for deformation processing and picture rendering of model elements, and aims to provide a new mode for carrying out interactive deformation processing on the model elements and improve the interactive display effect of the model elements.
In a first aspect, an embodiment of the present invention provides a method for deformation processing of a model element, including:
extracting vertex data for the model elements, the vertex data comprising: information of vertex coordinates of each vertex and a center point of the model element;
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain the vertex deformation coordinates of each vertex.
In a second aspect, an embodiment of the present invention further provides a screen rendering method, including:
when the interactive wind action display condition of a target picture is detected, at least one interactive wind field matched with the target picture is acquired;
according to each interactive wind field, at least one target model element to be processed by interactive wind and interactive wind parameters respectively corresponding to each target model element are obtained in the target picture;
obtaining vertex deformation coordinates of each vertex in each target model element by adopting the deformation processing method of the model element according to any one of the embodiments of the invention;
and rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element.
In a third aspect, an embodiment of the present invention further provides a device for processing deformation of a model element, including:
a vertex data extraction module for extracting vertex data of the model elements, the vertex data comprising: information of vertex coordinates of each vertex and a center point of the model element;
and the vertex coordinate adjusting module is used for adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain the vertex deformation coordinates of each vertex.
In a fourth aspect, an embodiment of the present invention further provides a screen rendering apparatus, including:
the interactive wind field acquisition module is used for acquiring at least one interactive wind field matched with the target picture when the interactive wind action display condition of the target picture is detected;
an operation parameter obtaining module, configured to obtain, in the target picture, at least one target model element to be processed by the interactive wind and an interactive wind parameter corresponding to each target model element according to each interactive wind field;
a vertex deformation coordinate obtaining module, configured to obtain vertex deformation coordinates of each vertex in each target model element by using the model element deformation processing method according to any one of the embodiments of the present invention;
and the picture rendering module is used for rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element.
In a fifth aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements a deformation processing method for a model element according to any one of the embodiments of the present invention when executing the program, or implements a picture rendering method according to any one of the embodiments of the present invention.
In a sixth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for deformation processing of a model element according to any one of the embodiments of the present invention, or implements a method for rendering a picture according to any one of the embodiments of the present invention.
The technical scheme of the embodiment of the invention extracts the vertex data of the model elements; according to the current interactive wind parameter and the information of the central point, the vertex coordinates of each vertex are adjusted to obtain vertex deformation coordinates of each vertex, and when the model elements in the interactive scene are subjected to deformation processing, each vertex of the model elements is controlled to deform around the central point of the model elements, so that the new model elements obtained after rendering are closer to the actual interactive stress effect.
Drawings
FIG. 1a is a flowchart of an implementation of a method for deformation processing of model elements according to a first embodiment of the present invention;
FIG. 1b is a schematic diagram of a vector relationship between a vertex and a center point according to an embodiment of the present invention;
FIG. 1c is a schematic view of another exemplary embodiment of a vector relationship between a vertex and a center point;
FIG. 2 is a flowchart of an implementation of a method for deformation processing of model elements according to a second embodiment of the present invention;
FIG. 3 is a flowchart of an implementation of a method for deformation processing of model elements according to a third embodiment of the present invention;
fig. 4a is a flowchart of an implementation of a picture rendering method according to a fourth embodiment of the present invention;
FIG. 4b is an exemplary diagram of an interactive wind farm to which embodiments of the present invention are applicable;
fig. 5 is a flowchart of an implementation of a picture rendering method according to a fifth embodiment of the present invention;
FIG. 6 is a block diagram of a device for processing a deformation of a model element according to a sixth embodiment of the present invention;
fig. 7 is a structural diagram of a screen rendering apparatus according to a seventh embodiment of the present invention;
fig. 8 is a block diagram of a computer device in the eighth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1a is a flowchart of a deformation processing method for a model element according to an embodiment of the present invention, where this embodiment is applicable to a case of performing deformation processing on a small object in a virtual interactive scene (a situation that the small object is squeezed all around when passing through by a dynamic object), and the method may be executed by a deformation processing apparatus for the model element, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in a terminal or a server (typically, a game server), and the method of this embodiment specifically includes the following steps:
s110, extracting vertex data of the model elements, wherein the vertex data comprises: vertex coordinates of each vertex and information of a center point of the model element.
In this embodiment, the model element refers to a specific individual element of a large number of small objects laid on a screen to be rendered and displayed. For example, the model element may be a flower in a flower sea, a grass in a grass cluster on a lawn, or a leaf on a tree, etc.
In the present embodiment, each model element has a preset number of vertices (generally, a plurality of vertices), where for each model element, vertex data corresponding to the model element needs to be pre-stored. The vertex data includes: vertex coordinates of each vertex and information of a center point of the model element.
And connecting the vertex coordinates of all the vertexes in sequence to obtain the contour shape of the model element.
In general, a model element may include one or more center points that are generally located at the root of the model element proximate the ground. After the central point is set, the root can be guaranteed not to swing interactively when the model elements are subjected to interactive deformation, so that the interactive deformation processing result is closer to the real situation.
Wherein the information of the central point is information for indicating the position of the central point in the model element, such as: the coordinates of the center point may be used, or vectors between the coordinates of each vertex and the corresponding coordinates of the center point may be used.
In one specific example, assume that a cluster of grass models includes multiple model elements. Each model element is a grass. The model element contains 5 vertices (A, B, C, D and E).
In an alternative embodiment of this embodiment, as shown in fig. 1b, the vertex diagram of a grass is shown, wherein the F point is taken as the only central point in the grass in the model element, and then the vectors AF, BF, CF, DF, and EF are the vectors from each vertex to the central point F.
In another alternative embodiment of this example, in FIG. 1c, a grass comprises 3 center points, specifically D, E and F. The vector from each vertex to the center point includes AF, BD, CE, DD, and EE. That is, in FIG. 1c, there is more than one center point, and each vertex can point to any one of the center points. In fig. 1b and 1c, the solid lines with arrows indicate the vectors from the respective vertices to the central point, and the dashed lines indicate the overall outline of a grass. In addition, the small circles in fig. 1c enclose D and E, which means that the vectors from D and E to the central point are both vectors pointing to themselves.
The vertex data may be stored in the UV data, vertex color data, instantiated array, tangent line, normal line or sub-tangent line data, and the like, which is not limited in this embodiment. Where a vertex may contain multiple sets of UV data, the center point data may be stored in a given set of UV data, i.e., UVn, where n represents the nth set of UV. The vertex color data includes R, G, B and a (brightness) four channels. An instantiated array is indexed by vertex ID or other int type variable associated with the vertex.
And S120, adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain the vertex deformation coordinates of each vertex.
Wherein the interactive wind parameter refers to a wind parameter that other objects act on the model element in an interactive (contact or indirect contact) manner, and the interactive wind parameter may include: wind force and wind direction.
In this embodiment, in order to simulate the interaction between different objects, an interactive wind field may be constructed. For example, if a game character moves in a lawn, a force is theoretically applied to a surrounding set area around the game character, and the lawn in the area is squeezed. Based on the method, an interactive wind field can be generated by taking the game character as a center, and the interactive wind field can generate one or more interactive wind vectors for each point in the wind field, wherein the interactive wind vectors correspond to matched interactive wind parameters (wind power and wind direction). Correspondingly, the model elements which are also positioned in the area can carry out matched interactive wind deformation processing according to the received interactive wind parameters.
In this embodiment, the model elements are subjected to the wind exposure processing of the interactive wind on each vertex according to the information of the center point of the model element. The advantages of such an arrangement are: can make the model element when receiving mutual wind to produce deformation, build one kind and carry out the effect that receives the wind crooked around the central point, and can not be in disorder move everywhere, can guarantee the authenticity of model element when receiving mutual wind to take place deformation.
Optionally, the vertex coordinates of each vertex are adjusted according to the current interactive wind parameter and the information of the central point, and a manner of obtaining the vertex deformation coordinates of each vertex may be as follows:
aiming at each vertex, obtaining a vector between each vertex coordinate and the corresponding central point coordinate, and generating a wind vector corresponding to each vertex coordinate according to the interactive wind parameter; the vertex deformation coordinates corresponding to each vertex are calculated by the vector operation (vector addition or vector subtraction) of the two vectors.
Or, according to the wind power and the wind direction in the interactive wind parameter and a preset relational mapping table, a bending angle and a bending direction corresponding to each vertex are calculated, so that the vector between each vertex coordinate and the corresponding central point coordinate can be rotated according to the bending angle and the bending direction, and vertex deformation coordinates corresponding to each vertex are determined according to a new vector obtained after rotation.
Alternatively, an interactive wind bending function may be preset, where the interactive wind bending function takes the interactive wind parameter and the information of the center point as independent variables, and takes the vertex offset (in the XZ direction) as dependent variables. Based on the interactive wind bending function, vertex offset corresponding to each vertex can be calculated, and then vertex deformation coordinates of each vertex are calculated according to the vertex coordinates of each vertex and the vertex offset.
The technical scheme of the embodiment of the invention extracts the vertex data of the model elements; according to the current interactive wind parameter and the information of the central point, the vertex coordinates of each vertex are adjusted to obtain vertex deformation coordinates of each vertex, and when the model elements in the interactive scene are subjected to deformation processing, each vertex of the model elements is controlled to deform around the central point of the model elements, so that the new model elements obtained after rendering are closer to the actual interactive stress effect.
On the basis of the foregoing embodiments, the vertex data may further include: a softness factor for each vertex, the softness factor being associated with a location of the vertex in the model element;
correspondingly, adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain vertex deformation coordinates of each vertex, which may include:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point and the softness factor of each vertex to obtain the vertex deformation coordinates of each vertex.
In this embodiment, different softness factors may be further stored for different vertices, and based on the softness factors, different portions of a single model element may have different deformation amplitudes. Typically, in a real scene that is subject to interactive deformation, the amplitude of deformation of the grass tip is the largest, and the amplitude of deformation is smaller when going downwards, so that the grass root is not deformed in general. In order to simulate the real scene in the game picture, the inventor creatively adds a softness factor (also called a wind influence factor) corresponding to each vertex in the vertex data.
The value range of the softness factor can be set to be [0, 1], and the larger the softness factor of a vertex is, the larger the deformation of the vertex after the vertex is subjected to the interactive wind is; the smaller the softness factor of a vertex is, the smaller the deformation of the vertex after being subjected to the interactive wind is, and when the softness factor of the vertex is 0, the vertex does not generate any deformation after being subjected to the interactive wind.
In a specific example, as shown in fig. 1B, the softness factor of vertex a may be set to 0.9, the softness factors of vertices B and C may be set to 0.5, and the softness factors of vertices D and E may be set to 0. At this time, even if only one center point F is set, the vertexes D and E of the grass root do not undergo any swing (deformation) after being subjected to the alternating wind because of the introduction of the softness factor.
The advantages of such an arrangement are: when each model element in the picture to be rendered is influenced by the interaction wind, the swinging (or deformation) amplitudes of different positions of the model element are different, and further the interaction deformation effect of the model element is closer to the real situation.
In an optional implementation manner of this embodiment, the vertex coordinates of each vertex are adjusted according to the current interactive wind parameter, the information of the central point, and the softness factor of each vertex, and a manner of obtaining the vertex deformation coordinates of each vertex is similar to the foregoing manner, for example, when a bending angle is calculated or an interactive wind bending function is constructed, the softness factor may be added as a new calculation reference item to ensure that the calculated vertex deformation coordinates of each vertex match the characteristics of the added calculated softness factor.
In the above optional implementation manner of this embodiment, the vertex data may further include: individual feature data for distinguishing the model element from other model elements of the same type.
Correspondingly, adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain vertex deformation coordinates of each vertex, which may include:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point and the individual characteristic data to obtain the vertex deformation coordinates of each vertex.
The individual feature data may be a randomly generated random number, a number generated by calculation according to a certain rule, or a number set according to the characteristics of the object, and the same or different individual feature data may be set for each vertex of the same model element.
In the optional implementation manner of this embodiment, different individual feature data are set for different model elements, so that when a picture to be rendered includes a plurality of model elements of the same type (for example, a cluster of grass formed by a plurality of grass), the deformation of each model element after the interaction of the interaction wind is not completely the same, a relatively stiff display effect that each grass in the picture bends to the same angle in a certain direction after the interaction of the interaction wind is avoided, the interaction wind deformation of each model element can have a slight difference, and the picture is more natural without a sense of repetition.
In the above optional implementation manner of this embodiment, the vertex coordinates of each vertex are adjusted according to the current interactive wind parameter, the information of the central point, and the individual feature data, and the manner of obtaining the vertex deformation coordinates of each vertex is similar to the foregoing manner, for example, when a bending angle is calculated or an interactive wind bending function is constructed, the individual feature data may be added as a new calculation reference item to ensure that the vertex deformation coordinates of each vertex of different model elements obtained through calculation have a certain slight difference, so that the rendering picture presented finally is more actual in a real scene.
In an optional implementation manner of this embodiment, the vertex data may further include: softness factors and individual characteristic data of each vertex;
correspondingly, adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain vertex deformation coordinates of each vertex, which may include:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point, the softness factor of each vertex and the individual characteristic data to obtain the vertex deformation coordinates of each vertex.
In the above optional implementation manner of this embodiment, the softness factor and the individual characteristic data of each vertex are added at the same time to calculate the vertex deformation coordinates of each vertex after the model elements are subjected to the interaction wind, which not only ensures that when each model element in the picture to be rendered generates the interaction deformation, the deformation amplitudes of different positions of the model element are different, but also ensures that the vertex deformation coordinates of each vertex of different model elements have certain slight differences, further improves the display effect of the model element under the interaction wind, makes each model element in the picture to be rendered closer to the real interaction deformation effect, and improves the reality and interactivity of the picture.
Example two
Fig. 2 is a flowchart of a method for processing deformation of a model element in an embodiment of the present invention, which is refined based on the above embodiment, in this embodiment, vertex coordinates of each vertex are adjusted according to a current interactive wind parameter, information of the central point, a softness factor of each vertex, and the individual feature data, so as to obtain vertex deformation coordinates of each vertex, and the method is embodied as: calculating to obtain deformation offset corresponding to each vertex by taking the current interactive wind parameter, the information of the central point, the softness factor of each vertex and the individual characteristic data as weights; and obtaining the vertex deformation coordinate of each vertex according to the vertex coordinate of each vertex and the deformation offset corresponding to each vertex. Correspondingly, the method of the embodiment of the invention comprises the following steps:
and S210, extracting vertex data of the model elements.
Wherein the vertex data comprises: vertex coordinates of each vertex, information of a center point of the model element, softness factors of each vertex, and individual feature data.
S220, calculating to obtain deformation offset corresponding to each vertex by taking the current interactive wind parameter, the information of the central point, the softness factor of each vertex and the individual characteristic data as weights.
In this embodiment, an interactive wind bending function may be preset, where the interactive wind bending function takes an interactive wind parameter, information of a central point, a softness factor of a vertex, and the individual characteristic data as independent variables, and takes a vertex offset (in two XZ directions) as a dependent variable. Based on the interactive wind bending function, vertex offsets corresponding to each vertex can be calculated.
In one specific example, the interactive wind bending function may be set as:
Figure BDA0002694647350000081
wherein, X0、Z0The center point coordinate is determined according to the center point information, S is a softness factor of a vertex, Rand is individual characteristic data, and XFAnd ZFInteraction wind interaction coordinates determined according to the interaction wind parameters; specifically, the interactive wind vector may be determined with a set point (e.g., an origin of coordinates) as a starting point according to the wind force and the wind direction value in the interactive wind parameter, and coordinates of an end point of the interactive wind vector may be used as the interactive wind interaction coordinates.
By substituting the above items of information into the calculation for each vertex of the model element, vertex offsets corresponding to each vertex can be obtained, that is: Δ x and Δ z.
Of course, it can be understood that other interactive wind bending functions may be set according to actual conditions, as long as the set interactive wind bending functions can ensure that each parameter can play a role in the interactive wind bending functions according to the physical meaning thereof, and the embodiment of the present invention does not limit the specific form of the interactive wind bending functions.
And S230, obtaining vertex deformation coordinates of each vertex according to the vertex coordinates of each vertex and deformation offset corresponding to each vertex.
After the deformation offset of each vertex is obtained, the deformation offset and the corresponding vertex coordinate may be superimposed to obtain the vertex deformation coordinate of each vertex.
In one specific example, the following may be expressed in terms of the formula:
Figure BDA0002694647350000091
and calculating vertex deformation coordinates of each vertex.
Wherein (X, Z) is the vertex coordinate of each vertex, (X)T,ZT) The coordinates are deformed for each vertex's vertex.
In the above optional implementation manner of this embodiment, the softness factor and the individual characteristic data of each vertex are added at the same time to calculate the vertex deformation coordinates of each vertex after the model elements are subjected to the interaction wind, which not only ensures that when each model element in the picture to be rendered generates the interaction deformation, the deformation amplitudes of different positions of the model element are different, but also ensures that the vertex deformation coordinates of each vertex of different model elements have certain slight differences, further improves the display effect of the model element under the interaction wind, makes each model element in the picture to be rendered closer to the real interaction deformation effect, and improves the reality and interactivity of the picture.
EXAMPLE III
Fig. 3 is a flowchart of a method for processing deformation of a model element in a third embodiment of the present invention, which is refined based on the above embodiments, in this embodiment, vertex coordinates of each vertex are adjusted according to a current interactive wind parameter, information of the central point, a softness factor of each vertex, and the individual feature data, so as to obtain vertex deformation coordinates of each vertex, and the method is embodied as: calculating the bending angle and the bending direction of the target vertex relative to the central point according to the current interactive wind parameters, the softness factor of the target vertex currently processed in the model elements and the individual characteristic data; and acquiring a central point coordinate according to the information of the central point, and rotating the vertex coordinate of the target vertex by the bending angle along the bending direction by taking the central point coordinate as a rotating center to obtain a vertex deformation coordinate corresponding to the target vertex. Correspondingly, the method of the embodiment of the invention comprises the following steps:
and S310, extracting vertex data of the model elements.
Wherein the vertex data comprises: vertex coordinates of each vertex, information of a center point of the model element, softness factors of each vertex, and individual feature data.
S320, determining a currently processed target vertex in the model element, and acquiring softness factors of the target vertex and the individual characteristic data.
In this embodiment, for each vertex in the model element, a corresponding vertex deformation coordinate may be calculated.
S330, calculating the bending angle and the bending direction of the target vertex relative to the central point according to the current interactive wind parameters, the softness factor and the individual characteristic data.
In this embodiment, the matched interactive wind vector may be obtained according to the interactive wind parameters (wind speed and wind direction), and then the original bending angle and the original bending direction of the target vertex relative to the central point may be obtained by querying a preset mapping relationship table.
The mapping relationship among the wind vectors, the original bending angles and the original bending directions can be preset in the mapping relationship table, and after a specific interactive wind vector is obtained, the original bending angles and the original bending directions of the vertexes relative to the central point can be obtained by inquiring the mapping relationship table.
After obtaining the original bending angle and the original bending direction, the original bending angle and the original bending direction may be fine-tuned by using the softness factor and the individual characteristic data of the target vertex as weighting coefficients, so as to obtain the bending angle and the bending direction of the target vertex relative to the central point.
Alternatively, the bending angle and the bending direction of the target vertex relative to the central point may be obtained by multiplying only the original bending angle by the softness factor and the individual characteristic data of the target vertex, or by multiplying the original bending angle by the softness factor and the individual characteristic data of the target vertex, respectively, and the present embodiment is not limited thereto.
S340, obtaining a central point coordinate according to the information of the central point, and rotating the vertex coordinate of the target vertex by the bending angle along the bending direction by taking the central point coordinate as a rotation center to obtain a vertex deformation coordinate corresponding to the target vertex.
In this embodiment, after obtaining the bending angle and the bending direction of the target vertex relative to the central point, the vertex coordinates of the target vertex are controlled, the central point coordinates are used as the rotation center, the bending angle is rotated in the bending direction, and new vertex coordinates obtained through rotation are used as vertex deformation coordinates corresponding to the target vertex.
S350, judging whether the processing of all the vertexes in the model element is finished or not: if yes, ending the process; otherwise, return to execute S320.
In the above optional implementation manner of this embodiment, the softness factor and the individual characteristic data of each vertex are added at the same time to calculate the vertex deformation coordinates of each vertex after the model elements are subjected to the interaction wind, which not only ensures that when each model element in the picture to be rendered generates the interaction deformation, the deformation amplitudes of different positions of the model element are different, but also ensures that the vertex deformation coordinates of each vertex of different model elements have certain slight differences, further improves the display effect of the model element under the interaction wind, makes each model element in the picture to be rendered closer to the real interaction deformation effect, and improves the reality and interactivity of the picture.
Example four
Fig. 4a is a flowchart of a picture rendering method according to a fourth embodiment of the present invention, where this embodiment is applicable to a case of rendering and displaying a picture including model elements after interaction of wind, and the method may be executed by a picture rendering device, where the device may be implemented by software and/or hardware, and may be generally integrated in a terminal or a game server, and the method of this embodiment specifically includes the following steps:
and S410, acquiring at least one interactive wind field matched with the target picture when the interactive wind action display condition of the target picture is detected.
In this embodiment, in order to realize the display of the screen, it is necessary to first lay down various objects in a canvas using an object laying tool to form the screen under an environment of screen production (such as a game engine, digital content production software, and the like).
The object placement tool may be a brush tool, similar to a stamp of the shape of the object to be placed, where the placement of the object will stamp where. Specifically, when the mouse is in the screen creation environment and the object placement tool is activated, the screen creator may select a model of the object to be placed, and then the mouse may display the selected model on the screen creation interface in the shape of the selected model, and when the screen creator drags the mouse and clicks or performs other types of selection operations at a certain position in the target screen, the selected model is placed at the position. For example, a lot of grass is laid on a lawn to finally form the lawn, and generally, for the sake of picture making efficiency, the grass is laid in units of a cluster of grass models, and a cluster of grass is composed of a certain number of grass.
And when the picture is manufactured or previewed in the manufacturing process, the picture can be rendered and displayed, a shader is required to be called in the process, the display parameters of each model element in each laid object model are read through the shader, the picture is rendered according to the read display parameters, and the rendered picture is finally formed and displayed.
In this embodiment, if the display effect after the interaction of the interactive wind needs to be displayed in the current picture to be rendered, it is determined that the picture is a target picture meeting the display condition of the interaction of the interactive wind, and before the target picture is rendered and displayed by using the shader, at least one interactive wind field acting on the target picture needs to be acquired first.
It is understood that the target frame may include one or more dynamic objects, each dynamic object may generate an interactive wind field within a set range (e.g., a circular range, a rectangular range, or the like) centered on the dynamic object, and the interactive wind fields generated by different dynamic objects may not overlap with each other or have a certain overlapping area.
Wherein one or more interactive wind vectors are included in each interactive wind farm. The different interactive wind vectors correspond to different interactive wind parameters, and specifically, the interactive wind parameters may include a wind speed and a wind direction. Each interactive wind vector corresponds to a set region range in the interactive wind field.
Fig. 4b is an exemplary view of an interactive wind field to which the embodiment of the present invention is applicable, and as shown in fig. 4b, a dynamic object is located at a center position of the interactive wind field, the interactive wind field generated by the dynamic object acts in a rectangular area, and each area range in the rectangular area corresponds to an interactive wind vector.
And S420, acquiring at least one target model element to be processed by interactive wind and interactive wind parameters corresponding to the target model elements in the target picture according to the interactive wind fields.
As described above, only the model elements included in the action region of the interactive wind field may be subjected to interactive deformation, and therefore, the model elements in the operation region in the target screen need to be first acquired as the candidate model elements according to the action region of each interactive wind field.
Meanwhile, since the objects laid in each screen to be rendered and displayed are known and not all the objects need to be subjected to the interactive wind deformation processing, for example, when a screen includes trees, grass, stones and houses, it is obvious that each grass in the leaves and grass of trees needs to be subjected to the interactive wind deformation processing, and the stones and houses do not need to be subjected to the interactive wind deformation processing.
Correspondingly, after the candidate model elements are obtained, at least one target model element needing interactive wind processing can be determined according to the type of each candidate model element.
After obtaining each target model element, the interactive wind vectors of one or more interactive wind fields acting on the target model element may be further determined, for example, if two interactive wind fields act on one target model element at the same time, a first interactive wind vector and a second interactive wind vector corresponding to the target model element may be obtained respectively, and the first interactive wind vector and the second interactive wind vector may be superimposed to obtain an interactive wind parameter corresponding to the target model element.
S430, obtaining vertex deformation coordinates of each vertex in each target model element by adopting the deformation processing method of the model elements according to any embodiment of the invention.
After obtaining each target model element in the target picture, the model element deformation processing method according to any embodiment of the present invention may obtain a new vertex deformation coordinate formed by each target model element after the interactive wind processing according to the vertex data of each target model element and the current interactive wind parameter.
S440, rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element.
And finally, rendering the target picture by the shader according to the new vertex deformation coordinates of each target model element, and finally displaying the rendering result on a screen.
The technical scheme of the embodiment of the invention obtains at least one interactive wind field matched with the target picture when the interactive wind action display condition of the target picture is detected; according to each interactive wind field, at least one target model element to be processed by interactive wind and interactive wind parameters respectively corresponding to each target model element are obtained in the target picture; obtaining vertex deformation coordinates of each vertex in each target model element by adopting a model element deformation processing method; according to the technical scheme of rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element, when the model element to be rendered and displayed is subjected to deformation processing, each vertex of the model element is controlled to carry out deformation processing around the central point of the model element, so that a new model element obtained after rendering is closer to an actual interactive deformation effect.
EXAMPLE five
Fig. 5 is a flowchart of a picture rendering method in a fifth embodiment of the present invention, which is refined based on the above embodiment, in this embodiment, the operation of obtaining, according to each interactive wind field, at least one target model element to be processed by interactive wind and an interactive wind parameter respectively corresponding to each target model element in the target picture is specifically as follows: acquiring at least one target model element to be processed by interactive wind in the target picture according to the action area of each interactive wind field; sequentially acquiring a target model element as a current processing element; acquiring at least one target interactive wind field of which the action area covers the current processing element, and respectively sampling interactive wind vectors corresponding to the current processing element in each target interactive wind field; and obtaining interactive wind parameters corresponding to the current processing element according to the interactive wind vectors obtained by sampling, and returning to execute the processing of sequentially obtaining one target model element as the current processing element until the processing of all the target model elements is completed. Correspondingly, the method of the embodiment of the invention comprises the following steps:
and S510, acquiring at least one interactive wind field matched with the target picture when the interactive wind action display condition of the target picture is detected.
S520, acquiring at least one target model element to be processed by the interactive wind in the target picture according to the action area of each interactive wind field.
As described above, each interactive wind field corresponds to an action region with a set shape (a circle or a matrix, etc.), and at least one target model element that needs to be processed by the interactive wind may be determined in the target screen according to the action region of each interactive wind field and the type of each model element in the target screen (for whether the interactive deformation occurs).
S530, sequentially acquiring a target model element as a current processing element.
And S540, acquiring at least one target interactive wind field of which the action area covers the current processing element, and sampling interactive wind vectors corresponding to the current processing element in each target interactive wind field respectively.
After each current processing element is obtained, one or more target interactive wind fields with action areas covering the current processing element can be determined according to the position coordinates of the current processing element in a target picture.
Each interactive wind field comprises one or more interactive wind vectors, each interactive wind vector corresponds to a set area in the interactive wind field, and the matched interactive wind vectors can be obtained by sampling at the corresponding position of the target interactive wind field by acquiring the position coordinates of the current processing element in the target picture.
And S550, obtaining interactive wind parameters corresponding to the current processing element according to the interactive wind vectors obtained by sampling.
Specifically, if the interactive wind vectors corresponding to the same current processing element include a plurality of interactive wind vectors, vector operation (typically, vector summation) may be performed on the plurality of interactive wind vectors to obtain a final interactive wind vector, and the interactive wind parameters (wind power and wind direction) corresponding to the current processing element are determined based on the value of the interactive wind vector.
S560, judging whether the processing of all the target model elements is finished: if yes, go to S570; otherwise, return to execute S530.
S570, obtaining vertex deformation coordinates of each vertex in each target model element by adopting the deformation processing method of the model element according to any embodiment of the invention.
And S580, rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element.
The technical scheme of the embodiment of the invention obtains at least one interactive wind field matched with the target picture when the interactive wind action display condition of the target picture is detected; according to each interactive wind field, at least one target model element to be processed by interactive wind and interactive wind parameters respectively corresponding to each target model element are obtained in the target picture; obtaining vertex deformation coordinates of each vertex in each target model element by adopting a model element deformation processing method; according to the technical scheme of rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element, when the model element to be rendered and displayed is subjected to deformation processing, each vertex of the model element is controlled to carry out deformation processing around the central point of the model element, so that a new model element obtained after rendering is closer to an actual interactive deformation effect.
EXAMPLE six
Fig. 6 is a structural diagram of a deformation processing apparatus for model elements according to a sixth embodiment of the present invention. The deformation processing device of the model element comprises: a vertex data extraction module 610 and a vertex coordinates adjustment module 620, wherein:
a vertex data extraction module 610, configured to extract vertex data of the model elements, where the vertex data includes: information of vertex coordinates of each vertex and a center point of the model element;
and the vertex coordinate adjusting module 620 is configured to adjust the vertex coordinates of each vertex according to the current interactive wind parameter and the information of the central point, so as to obtain vertex deformation coordinates of each vertex.
The technical scheme of the embodiment of the invention extracts the vertex data of the model elements; according to the current interactive wind parameter and the information of the central point, the vertex coordinates of each vertex are adjusted to obtain vertex deformation coordinates of each vertex, and when the model elements in the interactive scene are subjected to deformation processing, each vertex of the model elements is controlled to deform around the central point of the model elements, so that the new model elements obtained after rendering are closer to the actual interactive stress effect.
On the basis of the foregoing embodiments, the vertex data may further include: a softness factor for each vertex, the softness factor being associated with a location of the vertex in the model element;
accordingly, vertex coordinates adjustment module 620 may be configured to:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point and the softness factor of each vertex to obtain the vertex deformation coordinates of each vertex.
On the basis of the foregoing embodiments, the vertex data may further include: individual feature data for distinguishing the model elements from other model elements of the same type;
accordingly, vertex coordinates adjustment module 620 may be configured to:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point and the individual characteristic data to obtain the vertex deformation coordinates of each vertex.
On the basis of the foregoing embodiments, the vertex data may further include: softness factors and individual characteristic data of each vertex;
accordingly, vertex coordinates adjustment module 620 may be configured to:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point, the softness factor of each vertex and the individual characteristic data to obtain the vertex deformation coordinates of each vertex.
On the basis of the foregoing embodiments, the vertex coordinate adjusting module 620 may be specifically configured to:
calculating to obtain deformation offset corresponding to each vertex by taking the current interactive wind parameter, the information of the central point, the softness factor of each vertex and the individual characteristic data as weights;
and obtaining the vertex deformation coordinate of each vertex according to the vertex coordinate of each vertex and the deformation offset corresponding to each vertex.
On the basis of the foregoing embodiments, the vertex coordinate adjusting module 620 may be specifically configured to:
calculating the bending angle and the bending direction of the target vertex relative to the central point according to the current interactive wind parameters, the softness factor of the target vertex currently processed in the model elements and the individual characteristic data;
and acquiring a central point coordinate according to the information of the central point, and rotating the vertex coordinate of the target vertex by the bending angle along the bending direction by taking the central point coordinate as a rotating center to obtain a vertex deformation coordinate corresponding to the target vertex.
The model element deformation processing device provided by the embodiment of the invention can execute the model element deformation processing method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE seven
Fig. 7 is a structural diagram of a screen rendering apparatus according to a seventh embodiment of the present invention. The screen rendering apparatus includes: an interactive wind field obtaining module 710, an operation parameter obtaining module 720, a vertex deformation coordinate obtaining module 730 and a picture rendering module 740, wherein:
an interactive wind field acquisition module 710, configured to acquire at least one interactive wind field matched with a target picture whenever an interactive wind effect display condition of the target picture is detected;
an operation parameter obtaining module 720, configured to obtain, according to each interactive wind field, at least one target model element to be processed by interactive wind in the target picture, and interactive wind parameters corresponding to each target model element;
a vertex deformation coordinate obtaining module 730, configured to obtain vertex deformation coordinates of each vertex in each target model element by using the model element deformation processing method according to any one of the embodiments of the present invention;
and the picture rendering module 740 is configured to render and display each of the target model elements according to the vertex deformation coordinates of each vertex in each of the target model elements.
The technical scheme of the embodiment of the invention obtains at least one interactive wind field matched with the target picture when the interactive wind action display condition of the target picture is detected; according to each interactive wind field, at least one target model element to be processed by interactive wind and interactive wind parameters respectively corresponding to each target model element are obtained in the target picture; obtaining vertex deformation coordinates of each vertex in each target model element by adopting a model element deformation processing method; according to the technical scheme of rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element, when the model element to be rendered and displayed is subjected to deformation processing, each vertex of the model element is controlled to carry out deformation processing around the central point of the model element, so that a new model element obtained after rendering is closer to an actual interactive deformation effect.
On the basis of the foregoing embodiments, the operation parameter obtaining module 720 may be specifically configured to:
acquiring at least one target model element to be processed by interactive wind in the target picture according to the action area of each interactive wind field;
sequentially acquiring a target model element as a current processing element;
acquiring at least one target interactive wind field of which the action area covers the current processing element, and respectively sampling interactive wind vectors corresponding to the current processing element in each target interactive wind field;
and obtaining interactive wind parameters corresponding to the current processing element according to the interactive wind vectors obtained by sampling, and returning to execute the processing of sequentially obtaining one target model element as the current processing element until the processing of all the target model elements is completed.
The picture rendering device provided by the embodiment of the invention can execute the picture rendering method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example eight
Fig. 8 is a schematic structural diagram of a computer device in an eighth embodiment of the present invention. FIG. 8 illustrates a block diagram of an exemplary computer device 412 suitable for use in implementing embodiments of the present invention. The computer device 412 shown in FIG. 8 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 8, computer device 412 is in the form of a general purpose computing device. Components of computer device 412 may include, but are not limited to: one or more processors or processing units 416, a system memory 428, and a bus 418 that couples the various system components including the system memory 428 and the processing unit 416.
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 412 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 428 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)430 and/or cache memory 432. The computer device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, and commonly referred to as a "hard drive"). Although not shown in FIG. 8, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Memory 428 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 440 having a set (at least one) of program modules 442 may be stored, for instance, in memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 442 generally perform the functions and/or methodologies of the described embodiments of the invention.
The computer device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), with one or more devices that enable a user to interact with the computer device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, computer device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) through network adapter 420. As shown, network adapter 420 communicates with the other modules of computer device 412 over bus 418. It should be appreciated that although not shown in FIG. 8, other hardware and/or software modules may be used in conjunction with the computer device 412, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 416 executes various functional applications and data processing by running programs stored in the system memory 428, for example, implementing a method for shape transformation of model elements provided by the embodiment of the present invention, including:
extracting vertex data for the model elements, the vertex data comprising: information of vertex coordinates of each vertex and a center point of the model element;
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain the vertex deformation coordinates of each vertex.
Or, implementing a picture rendering method provided by the embodiment of the present invention includes:
when the interactive wind action display condition of a target picture is detected, at least one interactive wind field matched with the target picture is acquired;
according to each interactive wind field, at least one target model element to be processed by interactive wind and interactive wind parameters respectively corresponding to each target model element are obtained in the target picture;
obtaining vertex deformation coordinates of each vertex in each target model element by adopting the deformation processing method of the model element according to any one of the embodiments of the invention;
and rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element.
Example nine
The ninth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for processing a deformation of a model element according to the embodiment of the present invention, where the method includes:
extracting vertex data for the model elements, the vertex data comprising: information of vertex coordinates of each vertex and a center point of the model element;
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain the vertex deformation coordinates of each vertex.
Or, when executed by a processor, the program implements a screen rendering method according to an embodiment of the present invention, including:
when the interactive wind action display condition of a target picture is detected, at least one interactive wind field matched with the target picture is acquired;
according to each interactive wind field, at least one target model element to be processed by interactive wind and interactive wind parameters respectively corresponding to each target model element are obtained in the target picture;
obtaining vertex deformation coordinates of each vertex in each target model element by adopting the deformation processing method of the model element according to any one of the embodiments of the invention;
and rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A method for deformation processing of model elements, comprising:
extracting vertex data for the model elements, the vertex data comprising: information of vertex coordinates of each vertex and a center point of the model element;
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain the vertex deformation coordinates of each vertex.
2. The method of claim 1, wherein the vertex data further comprises: a softness factor for each vertex, the softness factor being associated with a location of the vertex in the model element;
adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain vertex deformation coordinates of each vertex, wherein the method comprises the following steps:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point and the softness factor of each vertex to obtain the vertex deformation coordinates of each vertex.
3. The method of claim 1, wherein the vertex data further comprises: individual feature data for distinguishing the model elements from other model elements of the same type;
adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain vertex deformation coordinates of each vertex, wherein the method comprises the following steps:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point and the individual characteristic data to obtain the vertex deformation coordinates of each vertex.
4. The method of claim 1, wherein the vertex data further comprises: softness factors and individual characteristic data of each vertex;
adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain vertex deformation coordinates of each vertex, wherein the method comprises the following steps:
and adjusting the vertex coordinates of each vertex according to the current interactive wind parameters, the information of the central point, the softness factor of each vertex and the individual characteristic data to obtain the vertex deformation coordinates of each vertex.
5. The method according to claim 4, wherein adjusting the vertex coordinates of each vertex according to the current interactive wind parameter, the information of the central point, the softness factor of each vertex, and the individual feature data to obtain vertex deformation coordinates of each vertex comprises:
calculating to obtain deformation offset corresponding to each vertex by taking the current interactive wind parameter, the information of the central point, the softness factor of each vertex and the individual characteristic data as weights;
and obtaining the vertex deformation coordinate of each vertex according to the vertex coordinate of each vertex and the deformation offset corresponding to each vertex.
6. The method according to claim 4, wherein adjusting the vertex coordinates of each vertex according to the current interactive wind parameter, the information of the central point, the softness factor of each vertex, and the individual feature data to obtain vertex deformation coordinates of each vertex comprises:
calculating the bending angle and the bending direction of the target vertex relative to the central point according to the current interactive wind parameters, the softness factor of the target vertex currently processed in the model elements and the individual characteristic data;
and acquiring a central point coordinate according to the information of the central point, and rotating the vertex coordinate of the target vertex by the bending angle along the bending direction by taking the central point coordinate as a rotating center to obtain a vertex deformation coordinate corresponding to the target vertex.
7. A screen rendering method, comprising:
when the interactive wind action display condition of a target picture is detected, at least one interactive wind field matched with the target picture is acquired;
according to each interactive wind field, at least one target model element to be processed by interactive wind and interactive wind parameters respectively corresponding to each target model element are obtained in the target picture;
obtaining vertex deformation coordinates of each vertex in each target model element by using the method according to any one of claims 1 to 6;
and rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element.
8. The method according to claim 7, wherein obtaining, according to each of the interactive wind fields, at least one target model element to be processed by interactive wind and an interactive wind parameter corresponding to each of the target model elements in the target screen comprises:
acquiring at least one target model element to be processed by interactive wind in the target picture according to the action area of each interactive wind field;
sequentially acquiring a target model element as a current processing element;
acquiring at least one target interactive wind field of which the action area covers the current processing element, and respectively sampling interactive wind vectors corresponding to the current processing element in each target interactive wind field;
and obtaining interactive wind parameters corresponding to the current processing element according to the interactive wind vectors obtained by sampling, and returning to execute the processing of sequentially obtaining one target model element as the current processing element until the processing of all the target model elements is completed.
9. A deformation processing apparatus for model elements, comprising:
a vertex data extraction module for extracting vertex data of the model elements, the vertex data comprising: information of vertex coordinates of each vertex and a center point of the model element;
and the vertex coordinate adjusting module is used for adjusting the vertex coordinates of each vertex according to the current interactive wind parameters and the information of the central point to obtain the vertex deformation coordinates of each vertex.
10. A screen rendering apparatus, comprising:
the interactive wind field acquisition module is used for acquiring at least one interactive wind field matched with the target picture when the interactive wind action display condition of the target picture is detected;
an operation parameter obtaining module, configured to obtain, in the target picture, at least one target model element to be processed by the interactive wind and an interactive wind parameter corresponding to each target model element according to each interactive wind field;
a vertex deformation coordinate obtaining module, configured to obtain vertex deformation coordinates of each vertex in each target model element by using the method according to any one of claims 1 to 6;
and the picture rendering module is used for rendering and displaying each target model element according to the vertex deformation coordinates of each vertex in each target model element.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements a method of deformation processing of a model element according to any one of claims 1-6 or a method of picture rendering according to any one of claims 7-8 when executing the program.
12. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing a method of deformation processing of a model element according to any one of claims 1 to 6 or a method of rendering a picture according to any one of claims 7 to 8.
CN202011001968.8A 2020-09-22 2020-09-22 Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium Pending CN112132935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011001968.8A CN112132935A (en) 2020-09-22 2020-09-22 Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011001968.8A CN112132935A (en) 2020-09-22 2020-09-22 Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium

Publications (1)

Publication Number Publication Date
CN112132935A true CN112132935A (en) 2020-12-25

Family

ID=73842329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011001968.8A Pending CN112132935A (en) 2020-09-22 2020-09-22 Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium

Country Status (1)

Country Link
CN (1) CN112132935A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112668066A (en) * 2020-12-29 2021-04-16 上海设序科技有限公司 Abstract model construction method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103021011A (en) * 2012-12-01 2013-04-03 王爽 Efficient vegetation cartoon
US20140198108A1 (en) * 2013-01-16 2014-07-17 Disney Enterprises, Inc. Multi-linear dynamic hair or clothing model with efficient collision handling
CN108717723A (en) * 2018-04-19 2018-10-30 浙江大学 A kind of tree deformation animation method for realizing that shape is kept based on sketch
CN109559366A (en) * 2018-12-18 2019-04-02 珠海格力电器股份有限公司 Display methods, device, storage medium and the equipment of potted plant growth course
CN110838162A (en) * 2019-11-26 2020-02-25 网易(杭州)网络有限公司 Vegetation rendering method and device, storage medium and electronic equipment
CN110930486A (en) * 2019-11-28 2020-03-27 网易(杭州)网络有限公司 Rendering method and device of virtual grass in game and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103021011A (en) * 2012-12-01 2013-04-03 王爽 Efficient vegetation cartoon
US20140198108A1 (en) * 2013-01-16 2014-07-17 Disney Enterprises, Inc. Multi-linear dynamic hair or clothing model with efficient collision handling
CN108717723A (en) * 2018-04-19 2018-10-30 浙江大学 A kind of tree deformation animation method for realizing that shape is kept based on sketch
CN109559366A (en) * 2018-12-18 2019-04-02 珠海格力电器股份有限公司 Display methods, device, storage medium and the equipment of potted plant growth course
CN110838162A (en) * 2019-11-26 2020-02-25 网易(杭州)网络有限公司 Vegetation rendering method and device, storage medium and electronic equipment
CN110930486A (en) * 2019-11-28 2020-03-27 网易(杭州)网络有限公司 Rendering method and device of virtual grass in game and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
任庆东等: ""风场作用下大规模真实感草地模拟"", 《计算机技术与发展》, vol. 23, no. 04, 30 April 2013 (2013-04-30), pages 198 - 201 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112668066A (en) * 2020-12-29 2021-04-16 上海设序科技有限公司 Abstract model construction method and device and electronic equipment
CN112668066B (en) * 2020-12-29 2024-04-12 上海设序科技有限公司 Method and device for constructing abstract model and electronic equipment

Similar Documents

Publication Publication Date Title
CN112132936B (en) Picture rendering method and device, computer equipment and storage medium
CN103873741A (en) Method and device for substituting area of interest in video
CN103400119A (en) Face recognition technology-based mixed reality spectacle interactive display method
WO2020029467A1 (en) Video frame processing method and apparatus
CN110930486A (en) Rendering method and device of virtual grass in game and electronic equipment
CN106898040A (en) Virtual resource object rendering intent and device
CN113538706B (en) Digital sand table-based house scene display method, device, equipment and storage medium
CN111882632A (en) Rendering method, device and equipment of ground surface details and storage medium
CN112085835A (en) Three-dimensional cartoon face generation method and device, electronic equipment and storage medium
CN115861498A (en) Redirection method and device for motion capture
CN112132935A (en) Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium
CN112132938B (en) Model element deformation processing and picture rendering method, device, equipment and medium
CN112206535A (en) Rendering display method and device of virtual object, terminal and storage medium
CN113129420B (en) Ray tracing rendering method based on depth buffer acceleration
CN114092670A (en) Virtual reality display method, equipment and storage medium
CN113962979A (en) Cloth collision simulation enhancement presentation method and device based on depth image
CN112132934A (en) Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium
CN112580213A (en) Method and apparatus for generating display image of electric field lines, and storage medium
CN107274468B (en) Wind-catching processing method and system applied to three-dimensional game
CN113298923B (en) Method, device, equipment and storage medium for generating simulated electronic picture
CN112132937A (en) Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium
CN111882637B (en) Picture rendering method, device, equipment and medium
CN113599818B (en) Vegetation rendering method and device, electronic equipment and readable storage medium
CN111882639B (en) Picture rendering method, device, equipment and medium
Liu et al. A study of digital exhibition visual design led by digital twin and VR technology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination