CN115272432A - Model information processing method, device, storage medium and computer equipment - Google Patents

Model information processing method, device, storage medium and computer equipment Download PDF

Info

Publication number
CN115272432A
CN115272432A CN202210931523.2A CN202210931523A CN115272432A CN 115272432 A CN115272432 A CN 115272432A CN 202210931523 A CN202210931523 A CN 202210931523A CN 115272432 A CN115272432 A CN 115272432A
Authority
CN
China
Prior art keywords
auxiliary
sphere
target model
target
vertex
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
CN202210931523.2A
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210931523.2A priority Critical patent/CN115272432A/en
Publication of CN115272432A publication Critical patent/CN115272432A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/02Non-photorealistic rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Graphics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application discloses a model information processing method, a model information processing device, a storage medium and computer equipment. The method comprises the following steps: the method comprises the steps of obtaining a target model to be processed and auxiliary spheres corresponding to the target model, wherein the target model comprises a plurality of vertexes, the auxiliary spheres comprise at least one vertex, the auxiliary spheres are predetermined according to the outline of the target model, the target auxiliary spheres matched with the vertexes are determined from the auxiliary spheres for each vertex of the target model, and ambient light shielding information corresponding to the vertexes of the target model is determined according to the radius of the target auxiliary spheres and the distance between the vertexes and the sphere center of the target auxiliary spheres. The embodiment of the application provides a new scheme for determining the ambient light shielding information of the target model, the ambient light shielding information of the target model does not need to be determined based on the form of the surface of the target model, and the ambient light shielding effect of the target model is improved.

Description

Model information processing method, device, storage medium and computer equipment
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for processing model information, a computer-readable storage medium, and a computer device.
Background
At present, in most Digital Content Creation (DCC) tools, when a virtual scene includes an Ambient light shading (AO) effect of a virtual model, ambient light is usually added to the virtual model for simulation, and then Ambient light shading information similar to reality is calculated by combining information on the surface of the virtual model, such as curvature, normal line, and the like, and is assigned to a vertex color of a vertex at a close position.
That is, the determination of the ambient light shielding effect of the virtual model is based on the shape of the surface of the virtual model, and when the details of the virtual model are very simplified, the current ambient light shielding effect does not meet the target expectation and cannot achieve the desired effect.
Disclosure of Invention
The embodiment of the application provides a model information processing method and device, a computer readable storage medium and computer equipment, and provides a new scheme for determining the ambient light shielding information of a target model, the ambient light shielding information of the target model does not need to be determined based on the form of the surface of the target model, and the ambient light shielding effect of the target model is improved.
The embodiment of the application provides a model information processing method, which comprises the following steps:
acquiring a target model to be processed, wherein the target model comprises a plurality of vertexes;
acquiring auxiliary spheres corresponding to the target model, wherein the auxiliary spheres comprise at least one auxiliary sphere which is predetermined according to the contour of the target model;
for each vertex of the target model, determining a target auxiliary sphere from the auxiliary spheres that matches the vertex;
and determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere.
An embodiment of the present application further provides a model information processing apparatus, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target model to be processed and an auxiliary sphere corresponding to the target model, the target model comprises a plurality of vertexes, the auxiliary sphere comprises at least one vertex, and the auxiliary sphere is predetermined according to the outline of the target model;
a first determining module, configured to determine, for each vertex of the target model, a target auxiliary sphere matching the vertex from the auxiliary spheres;
and the second determining module is used for determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere.
Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, where the computer program is suitable for being loaded by a processor to execute steps in the model information processing method according to any one of the above embodiments.
An embodiment of the present application further provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and the processor executes the steps in the model information processing method according to any one of the above embodiments by calling the computer program stored in the memory.
The model information processing method, the model information processing device, the computer readable storage medium and the computer device provided by the embodiments of the present application, by obtaining a target model to be processed and an auxiliary sphere corresponding to the target model, the auxiliary sphere being predetermined according to a contour of the target model, and determining the auxiliary sphere according to the contour of the target model, the determination of the auxiliary sphere is in accordance with an expectation, and for each vertex of the target model, determining a target auxiliary sphere matching the vertex from the auxiliary spheres, and determining ambient light shielding information corresponding to the vertex of the target model according to a radius of the target auxiliary sphere and a distance between the vertex and a center of the target auxiliary sphere, i.e., the embodiments of the present application provide a new way of determining ambient light shielding information, and without determining the ambient light shielding information of the target model based on a state of a surface of the target model, such as a curvature, a normal, and the like, and without determining the ambient light shielding information of the target model according to a form of a surface of the model, and therefore, no matter how simplified or abstract the state is, a better ambient light shielding effect can be achieved, and the range of the ambient light shielding information can be determined according to the expected radius of the target auxiliary sphere and the vertex of the target auxiliary sphere and the ambient light shielding information, and the auxiliary sphere can be generated, and the range of the environmental light shielding information of the environmental light shielding effect of the target model can be increased.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a model information processing method according to an embodiment of the present application.
Fig. 2 is a schematic diagram of an object model provided in an embodiment of the present application.
Fig. 3 is a schematic diagram of an auxiliary sphere of a target model according to an embodiment of the present application.
Fig. 4 is a schematic sub-flow diagram of a model information processing method according to an embodiment of the present application.
Fig. 5 is a schematic sub-flow diagram of a model information processing method according to an embodiment of the present application.
Fig. 6 is another schematic flow chart diagram of a model information processing method according to an embodiment of the present application.
Fig. 7 is a schematic diagram of an interactive interface provided in the embodiment of the present application.
Fig. 8 is a schematic diagram illustrating a comparison between an ambient light shielding effect in the present embodiment and an ambient light shielding effect in the prior art provided in the present embodiment.
Fig. 9 is a schematic structural diagram of a model information processing apparatus according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a model information processing method and device, a computer readable storage medium and computer equipment. Specifically, the model information processing method according to the embodiment of the present application may be executed by a computer device, where the computer device may be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game console, a Personal Computer (PC), a Personal Digital Assistant (PDA), and a robot. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform.
For example, when the model information processing method is operated on a terminal, the terminal is used to implement the model information processing method in the embodiment of the present application, so as to implement the ambient light shielding effect of the target model. Alternatively, when the model information processing method is executed in a terminal, the terminal stores a digital content creation tool or a digital content creation application, such as maya, 3dsmax, softimage, houdini, cinema4D blend, modo, lightwave, and the like, and in the embodiment of the present application, the digital content creation tool or the digital content creation application is exemplified as 3dsmax. The digital content creation tool or the digital content creation application is used for presenting a scene picture of the object model, an interactive picture of loading the object model, an interactive picture of adjusting an auxiliary sphere of the object model, and the like, and the model information processing method in the application can be realized in the digital content creation tool or the digital content creation application. The terminal is used for interacting with a user through a graphical user interface. The manner in which the terminal provides the graphical user interface to the user may include a variety of ways, for example, the graphical user interface may be rendered for display on a display screen of the terminal or presented by holographic projection.
For example, when the model information processing method is run on a server, cloud production may be performed, such as online generation of ambient light shielding information, online rendering of a target model, and the like. In the cloud production operation mode, the operation body and the production screen presentation body of the digital content production tool or the digital content production application program are separated, and the storage and the operation of the model information processing method are completed on the cloud server. And the production screen presentation is finished at the cloud production client. When cloud manufacturing is carried out, a user operates a client to send an operation instruction corresponding to operation to a cloud server, the cloud server operates according to the operation instruction, data such as a manufactured picture and a display effect are coded and compressed, the data is returned to the client through a network, and finally the data is decoded through the client and the manufactured picture, the display effect and the like are output. Therefore, the consumption of computing resources of the terminal is reduced, and the picture quality of the picture displayed by the terminal is improved.
Hereinafter, a method, an apparatus, a computer-readable storage medium, and a computer device for processing model information provided by embodiments of the present application will be described in detail respectively. The numbers in the following examples are not intended to limit the order of preference of the examples. The ambient light shielding (AO) in the embodiment of the present application describes an effect of shielding ambient light when an object intersects or approaches the object, and may be used to control the intensity of indirect illumination received by the model surface.
Fig. 1 is a schematic flowchart of a model information processing method provided in an embodiment of the present application, where the model information processing method includes the following steps.
101, obtaining an object model to be processed, wherein the object model comprises a plurality of vertexes.
The object model to be processed may be any model for which it is desirable to generate ambient light mask information.
For example, the object model may be a tree crown model or a shrub-like model, or the object model may be a model made by grid-plugging. In order to achieve a better ambient light shielding effect and also consider the problems of efficiency and accuracy, the target model can be a tree crown, shrub and other models made by grid insert, and even a tree crown, shrub and other models made by grid insert which only need to add a small amount of macroscopic ambient light shielding effect.
FIG. 2 is a schematic diagram of a tree crown model made by grid plugging sheets.
The tree crown, shrub and other models manufactured by the grid insert sheet can meet requirements without a large number of auxiliary spheres (described later), the calculation efficiency is improved by fewer auxiliary spheres, and the adjustment efficiency of the auxiliary spheres is improved by fewer auxiliary spheres without more adjustment; in addition, in the application, the calculated intensity value of the ambient light shielding needs to be stored in the vertex color of the model, so that more vertexes are needed to ensure the accuracy of the ambient light shielding, and the number of vertexes of the tree crown-shaped model, the shrub-shaped model and other models manufactured by the grid insert sheet can well meet the requirements.
The target model can be stored by using model variables, the target model comprises a vertex list, the vertex list comprises a plurality of vertexes, each vertex has a corresponding vertex color attribute, and the target model is stored by using the model variables so as to modify the vertex colors of the vertexes subsequently. And determining whether the target model is acquired or not through the model variable, if the model variable is empty, indicating that the target model is not acquired, and prompting, otherwise, indicating that the target model is acquired. The vertex color is an attribute of a vertex of the target model, and can be obtained in a corresponding material when the target model is rendered in a game and used for calculating the vertex color in a user-defined mode.
In an embodiment, the target model may be set in advance, so as to directly obtain the set target model, or the target model may be obtained by other means.
And 102, acquiring auxiliary spheres corresponding to the target model, wherein the auxiliary spheres comprise at least one auxiliary sphere which is predetermined according to the outline of the target model.
The auxiliary sphere is a sphere model provided to assist in determining the ambient light shielding information of the target model, and the auxiliary sphere corresponding to the target model includes at least one, such as one or more. The auxiliary sphere determines information such as distribution, central point and range of the ambient light shielding information of the target model. For example, the distribution of the ambient light shielding information of the target model can be determined according to the distribution of the auxiliary spheres, the center points of the ambient light shielding information of the target model can be determined according to the centers of the auxiliary spheres, wherein one center corresponds to one center point, and the range of the ambient light shielding information of the target model can be determined according to the radius of the auxiliary spheres.
The auxiliary sphere of the target model may be predetermined, for example, according to the contour of the target model. The determination may be automatic or manual according to the user's requirement, and will be described in detail below. And storing the determined auxiliary sphere into a list variable of an auxiliary sphere list, wherein if the list variable is empty, the auxiliary sphere of which the target model is not determined is represented, and if the list variable is not empty, the auxiliary sphere of which the target model is determined is represented.
Wherein the contour of the object model comprises an overall contour and/or a partial contour. Correspondingly, one auxiliary sphere is preset for the overall contour of the target model, i.e. one auxiliary sphere is corresponding to the overall contour, and/or one auxiliary sphere is preset for each partial contour, i.e. one auxiliary sphere is corresponding to each partial contour. The corresponding auxiliary sphere will include/wrap the outline corresponding to the predetermined scale.
For example, when the target model is a crown-shaped model or a shrub-shaped model, the contour of the target model includes an overall contour and/or at least one branch and leaf cluster contour, and one or more branch and leaf cluster contours may be included in one target model. The auxiliary sphere of the target model comprises an auxiliary sphere corresponding to the overall outline and/or an auxiliary sphere corresponding to each branch and leaf cluster outline, the auxiliary sphere corresponding to the overall outline at least comprises/wraps the overall outline at a first preset proportion, and the branch and leaf cluster outline at least comprises/wraps the branch and leaf cluster outline at a second preset proportion. The first preset proportion and the second preset proportion may be the same or different, for example, the first preset proportion is 90%, and the second preset proportion is 85%.
The auxiliary sphere corresponding to the overall contour can be used to determine the overall ambient light shielding effect of the target model, and the auxiliary sphere corresponding to the partial contour can be used to determine the ambient light shielding effect on the internal details of the model.
Fig. 3 is a schematic diagram of an auxiliary sphere provided in the embodiment of the present application. The auxiliary spheres in fig. 3 correspond to the auxiliary spheres corresponding to the crown-shaped model shown in fig. 2, wherein the number of the auxiliary spheres corresponding to the crown-shaped model is three, and the three auxiliary spheres are respectively the auxiliary Sphere corresponding to the overall contour and the two auxiliary spheres corresponding to the contours of the two branch and leaf clusters, as shown in the lower right corner, and correspond to Sphere001, sphere002 and Sphere003.
For each vertex of the target model, a target auxiliary sphere matching the vertex is determined from the auxiliary spheres 103.
Traversing all vertexes of the target model, acquiring information such as world space coordinates of the vertexes, and sphere center coordinates (the sphere center coordinates are world coordinates) and radiuses corresponding to the auxiliary spheres and the like for each vertex of all vertexes, and determining a target auxiliary sphere matched with the vertex from the auxiliary spheres according to the world space coordinates, the sphere center coordinates and the radiuses of the vertexes. And one vertex matched target auxiliary sphere corresponds to one vertex matched target auxiliary sphere.
In one embodiment, as shown in FIG. 4, step 103 includes steps 201 through 202.
Candidate auxiliary spheres are determined 201 from the auxiliary spheres according to the bounding box of the target model.
The bounding box of the target model refers to a cube or a two-dimensional rectangle capable of containing the target model, and is one kind of bounding volume, the target model in this embodiment is a three-dimensional model as an example, therefore, the bounding box of the target model refers to a cube capable of containing the target model, for example, the bounding box is an axis-aligned bounding box, and in other embodiments, other matching bounding boxes may be selected.
Wherein an Axis aligned bounding box (AABB bounding box) is defined as the smallest hexahedron containing the object model with sides parallel to the coordinate axes. In one embodiment, the bounding box is a cuboid shaped, axis aligned bounding box. The axis alignment bounding box of the cuboid shape is simple in structure, only six scalars are needed for describing the axis alignment bounding box of the cuboid shape, and the storage space is small.
In an embodiment, the step of determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model specifically includes: acquiring a bounding box of a target model; and determining auxiliary spheres with the sphere centers of the auxiliary spheres within the bounding box of the target model as candidate auxiliary spheres.
The bounding box of the target model is determined by the maximum value and the minimum value of the coordinates of the three coordinate axes in the local coordinate system corresponding to the target model. Wherein the bounding box of the object model is retrievable via an interface, such as the interface provided by MaxScript.
After the bounding box of the target model is obtained, converting the world coordinates of the center of the auxiliary sphere into local coordinates in a local coordinate system of the target model, comparing the local coordinates of the center of the auxiliary sphere with coordinates corresponding to the bounding box, if the local coordinates of the center of the auxiliary sphere are compared with the maximum value and the minimum value of the axial coordinates of the three coordinates, if the local coordinates of the center of the auxiliary sphere are all between the maximum value and the minimum value, determining that the center of the auxiliary sphere is in the bounding box of the target model, and otherwise, determining that the center of the auxiliary sphere is not in the bounding box of the target model, skipping the auxiliary sphere, thus obtaining the candidate auxiliary spheres in all the auxiliary spheres.
The candidate auxiliary sphere can also be represented by a candidate auxiliary sphere list, if the candidate auxiliary sphere list is empty, it means that the sphere centers of all the auxiliary spheres are no longer in the bounding box of the target model, and then prompt is performed without performing subsequent steps.
In the step, the bounding box of the target model is used for determining the candidate auxiliary ball body so as to remove the auxiliary ball body which is not in the bounding box of the target model, avoid the influence of the auxiliary ball body which is not in the bounding box of the target model on the ambient light shielding effect, and improve the rationality and the accuracy of the ambient light shielding effect.
And 202, determining a target auxiliary sphere matched with the vertex from the candidate auxiliary spheres according to the position relation between the vertex and the candidate auxiliary spheres.
After the candidate auxiliary spheres are determined, for each vertex of the target model, a target auxiliary sphere matched with the vertex is determined from the candidate auxiliary spheres according to the position relation between the vertex and the candidate auxiliary sphere. The position relation comprises that the vertex is positioned inside the candidate auxiliary sphere, the vertex is positioned outside the candidate auxiliary sphere and the like.
In one embodiment, the step 202 includes: when the vertex is in at least one candidate auxiliary sphere, determining a first distance between the vertex and the sphere center of the candidate auxiliary sphere, and taking the candidate auxiliary sphere with the minimum first distance as a target auxiliary sphere matched with the vertex; when the vertex is outside all the candidate auxiliary spheres, determining second distances between the vertex and the surfaces of all the candidate auxiliary spheres, and taking the candidate auxiliary sphere with the smallest second distance as a target auxiliary sphere matched with the vertex.
When the vertex is inside at least one candidate auxiliary sphere, the smaller the first distance between the vertex and the sphere center of the candidate auxiliary sphere is, the larger the influence of the candidate auxiliary sphere on the ambient light shielding information of the vertex is, the candidate auxiliary sphere with the smallest first distance is taken as the target auxiliary sphere of the vertex, and when the vertex is outside all the candidate auxiliary spheres, the smaller the second distance between the vertex and the surfaces of all the candidate auxiliary spheres is, the larger the influence of the candidate auxiliary sphere on the ambient light shielding information of the vertex is, and the candidate auxiliary sphere with the smallest second distance is determined as the target auxiliary sphere of the vertex.
In one embodiment, the vertex is inside the candidate auxiliary sphere and can be represented by the distance between the vertex and the sphere center of the candidate auxiliary sphere being smaller than the radius of the sphere, and correspondingly, the vertex is outside the candidate auxiliary sphere and can be represented by the distance between the vertex and the sphere center of the candidate auxiliary sphere being larger than the radius of the sphere, wherein the vertex on the surface of the candidate auxiliary sphere can be listed as the vertex inside the candidate auxiliary sphere or the vertex outside the candidate auxiliary sphere.
Correspondingly, as shown in fig. 5, the step 202 includes the following steps 301 to 310.
301, a first candidate auxiliary sphere is obtained from the candidate auxiliary sphere list as a temporary target sphere.
302, whether there are any more candidate auxiliary spheres in the candidate auxiliary sphere list that have not been acquired.
If there is no candidate helper sphere that has not been acquired, i.e. all candidate helper spheres in the list of candidate helper spheres have been acquired, step 303 is executed, otherwise, there is a candidate helper sphere that has not been acquired, step 304 is executed.
And 303, taking the temporary target sphere as a target auxiliary sphere matched with the vertex.
And when all the candidate auxiliary spheres in the candidate auxiliary sphere list are acquired, taking the temporary target sphere as the target auxiliary sphere matched with the vertex.
And 304, acquiring the next candidate auxiliary sphere from the candidate auxiliary sphere list as the current sphere.
305, the distance between the vertex and the center of the temporary target sphere?
I.e. whether the distance between the vertex and the sphere center of the temporary target sphere is smaller than or equal to the radius of the temporary target sphere, if yes, it means that the vertex is inside the temporary target sphere, step 306 is executed, otherwise, step 308 is executed.
306, the distance between the vertex and the center of the current sphere, < = current sphere radius?
That is, whether the distance between the vertex and the sphere center of the current sphere is smaller than or equal to the radius of the current sphere, if so, the vertex is inside the current sphere, that is, the vertex is both inside the temporary target sphere and the current sphere, and step 307 is executed; otherwise, i.e. the vertex is inside the temporary target sphere and outside the current sphere, then step 302 is performed.
And 307, taking the candidate auxiliary sphere with smaller distance between the vertex and the sphere center of the current sphere and the distance between the vertex and the sphere center of the temporary target sphere as the temporary target sphere. Step 302 is then performed.
308, the distance between the vertex and the center of the current sphere < = current sphere radius?
I.e. whether the distance between the vertex and the sphere center of the current sphere is smaller than or equal to the radius of the current sphere, if so, it means that the vertex is inside the current sphere, i.e. the vertex is outside the temporary target sphere, and inside the current sphere, step 309 is executed; otherwise, i.e. the vertex is outside the temporary target sphere and also outside the current sphere, step 310 is performed.
Although step 306 is the same as step 308, after step 305 is combined, step 306 is different from step 308 in the purpose to be achieved.
309, the current sphere is taken as the temporary target sphere. Step 302 is then performed.
And 310, taking the candidate auxiliary sphere with smaller distance between the vertex and the surface of the temporary target sphere and the distance between the vertex and the surface of the current sphere as the temporary target sphere. Step 302 is then performed.
Through the above steps 301 to 310, it is realized that the target auxiliary sphere matching the vertex is determined from the candidate auxiliary spheres according to the position relationship between the vertex and the candidate auxiliary sphere.
In an embodiment, instead of determining candidate auxiliary spheres separately, each auxiliary sphere may be obtained from the auxiliary sphere list, and then determine whether the center of the auxiliary sphere is within the bounding box of the target model, if not, obtain the next auxiliary sphere from the auxiliary sphere list, if the auxiliary sphere is within the bounding box of the target model, then use the auxiliary sphere as a temporary target sphere, and if there is an unacquired candidate auxiliary sphere in the auxiliary sphere list, obtain the next auxiliary sphere from the auxiliary sphere list, determine whether the center of the auxiliary sphere is within the bounding box of the target model, and if the auxiliary sphere is within the bounding box of the target model, then use the auxiliary sphere as a current sphere, and then perform the corresponding steps between 305 and 310 until each auxiliary sphere in the auxiliary sphere list has been obtained. It is understood that, in this embodiment, after obtaining the auxiliary spheres from the auxiliary sphere list, it is determined whether the centers of the auxiliary spheres are within the bounding box of the target model, and if so, other determinations are performed, as compared to determining candidate auxiliary spheres from the auxiliary sphere list in advance and then determining the target auxiliary sphere from the candidate auxiliary sphere list, and the latter (i.e., determining candidate auxiliary spheres from the auxiliary sphere list in advance and then determining the target auxiliary sphere from the candidate auxiliary sphere list) is more efficient and faster.
Step 103 above realizes determining the target auxiliary sphere matching with the vertex from the auxiliary spheres.
And 104, determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere.
After the target auxiliary sphere is determined, the ambient light shielding information corresponding to the vertex of the target model is determined according to the distance between the vertex and the target auxiliary sphere. For example, the radius of the target auxiliary sphere is obtained; and determining the distance between the vertex and the sphere center of the target auxiliary sphere, and determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the sphere center of the target auxiliary sphere.
The method comprises the steps of determining the distance between a vertex and the center of a target auxiliary sphere according to the world coordinates of the vertex and the world coordinates of the center of the target auxiliary sphere, determining the distance between the vertex and the center of the target auxiliary sphere, and determining the ratio of the distance to the radius as the ambient light shielding information corresponding to the vertex of a target model after the radius of the target auxiliary sphere is obtained. The ambient light mask information includes an ambient light mask intensity value, for example, a ratio of a distance to a radius is directly determined as an ambient light mask intensity value corresponding to a vertex of the target model. Wherein, in one view, the radius of the target auxiliary sphere can be understood to be used to normalize the distance.
When the ratio of the distance to the radius is larger than the preset ratio, the preset ratio is determined as the ambient light shielding strength value corresponding to the vertex of the target model. The preset ratio may be set to 1, or other reasonable values, such as 0.9. It is understood that the distance to radius ratio is truncated to a preset ratio, such as 1.
Therefore, the intensity value of the shielding of the ambient light from the center of the target auxiliary sphere to the spherical surface is uniformly increased from 0 to 1, a gradual change ambient light shielding effect can be generated, meanwhile, the central point of the ambient light shielding effect is determined according to the center of the target auxiliary sphere, and the range of the ambient light shielding effect is determined according to the radius of the target auxiliary sphere; and if the vertex is positioned outside the target auxiliary sphere, the influence on the ambient light shielding intensity value is not generated.
The smaller the ambient light shielding intensity value is, the lower the degree of the surface near the corresponding vertex receiving ambient light is, the darker the surface of the target model is under the condition of unchanged degree of receiving direct light, and when the ambient light shielding intensity value is 0, the condition that the position corresponding to the vertex does not receive the ambient light is indicated; the larger the ambient light shielding intensity value is, the higher the degree of ambient light received by the surface near the vertex is, and the brighter the target model surface is under the condition of unchanged direct light irradiation degree, and when the ambient light shielding intensity value is 1, it is indicated that the position corresponding to the vertex receives the ambient light of full intensity and is not influenced by ambient light shielding.
In the embodiment of the application, the ambient light shielding information of the target model is not required to be determined according to the form of the surface of the model, such as curvature, normal and the like, so that a better ambient light shielding effect can be achieved no matter how the state is simplified or abstracted, and the ambient light shielding information is determined according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere, so that the determined ambient light shielding information is related to the distance between the vertex and the spherical center of the target auxiliary sphere, a soft gradually-changed ambient light shielding effect can be generated, and meanwhile, the central point and the range of the gradually-changed ambient light shielding effect are respectively determined according to the spherical center and the radius of the target auxiliary sphere, and the ambient light shielding effect of the target model is improved.
The solution in the embodiment of the present application can be integrated into a model information processing tool (such as a vertex color automatic rendering tool) based on a digital content production tool or a digital content production application, such as 3dsmax. It is understood that the model information processing means in the embodiment of the present application, in which the model information processing method in the embodiment of the present application is integrated, may be developed/integrated in 3dsmax, or that the model information processing method in the embodiment of the present application is executed by the model information processing means.
Fig. 6 is another schematic flow chart of a model information processing method provided in an embodiment of the present application, where the model information processing method includes the following steps.
401, an object model to be processed is set, the object model comprising a plurality of vertices.
The model information processing tool provides an interactive interface that assists the user in customizing the graduated ambient light shading effect. The method comprises the steps of displaying an interactive interface through a graphical user interface of the computer device, and loading/setting/acquiring a target model to be processed, adding an auxiliary sphere to the target model, setting a visible state or an invisible state of the auxiliary sphere and the like through the interactive interface. The target model comprises a plurality of vertexes.
Fig. 7 is a schematic diagram of an interactive interface provided in the embodiment of the present application, where the interactive interface is an interactive interface newly added to implement the solution in the embodiment of the present application. A plurality of controls are displayed on the interactive interface, such as a SELECT TREE control, an AO Visible control, an AO Spheres control, an ADD control, a PAINT → AO control and the like, and corresponding functions are realized through corresponding controls, which are correspondingly introduced later.
The step of setting the target model to be processed comprises the following steps: and displaying an interactive interface through a graphical user interface, and setting a target model to be processed through a model selection control on the interactive interface. Wherein the model selection control is a SELECT TREE control in fig. 7.
Further, the step of setting the target model to be processed includes: displaying an interactive interface through a graphical user interface, wherein a model selection control is displayed on the interactive interface; responding to the trigger operation aiming at the model selection control, and displaying a model selection interface; and determining a selected target model based on the model selection interface, taking the selected target model as a target model to be processed, and further displaying the target model to be processed through a graphical user interface.
The trigger operation may be a click operation, a double click operation, a right click operation, a touch operation, and the like for a model selection control, such as the SELECT TREE control in fig. 7, or may also be other trigger operations, such as a voice trigger operation, and the like, for example, when a voice including "SELECT a model" is detected, it is determined that the model selection control is triggered. The triggering operations of other controls in the following text are similar to this, and will not be described in detail again.
In response to a trigger operation for the model selection control, a model selection interface is displayed, through which a target model to be processed can be selected/set from the computer device, as in fig. 7, the currently selected target model to be processed is a model with a model name SM _ Tyro _ Tree _ 13.
The model variable Tree may be added to the MaxScript code, the target model is loaded and stored in the model variable Tree, and the target model is rendered and then displayed through a graphical user interface, such as the target model shown in fig. 2.
In the embodiment, the target model to be processed can be conveniently selected through the model selection control, so that the existing target model can be conveniently processed.
Auxiliary spheres are added 402 to the object model, the auxiliary spheres comprising at least one, the auxiliary sphere being determined from the contour of the object model.
Wherein, the step of adding an auxiliary sphere to the target model comprises: and displaying an interactive interface through a graphical user interface, and adding an auxiliary sphere for the target model through an adding control on the interactive interface. Wherein the ADD control is an ADD control in fig. 7.
Further, the step of adding an auxiliary sphere to the target model includes: and displaying an interactive interface through a graphical user interface, displaying an adding control of the auxiliary sphere on the interactive interface, and responding to a trigger operation aiming at the adding control to add the auxiliary sphere for the target model. That is, in response to a triggering operation on the ADD control, an auxiliary sphere is added to the target model. Further, the auxiliary sphere is displayed through the graphical user interface when the auxiliary sphere is in a visible state.
The adding of the auxiliary sphere to the target model is specifically to add the auxiliary sphere to the target model according to the contour of the target model. I.e. the determination of the auxiliary sphere is related to the contour of the target model, the determined auxiliary sphere is as expected since the auxiliary sphere is determined according to the contour of the target model.
In one case, the step of adding an auxiliary sphere to the target model according to the contour of the target model includes: and adding an initial sphere for the target model, and adjusting the initial sphere according to the contour of the target model to obtain an adjusted auxiliary sphere. Understandably, after the ADD control is triggered, an initial sphere is automatically added to the target model, and then the initial sphere is adjusted according to the contour to obtain an adjusted auxiliary sphere.
The initial sphere is also a sphere model like the auxiliary sphere, and the initial sphere is automatically generated in the scene. In one case, the initial sphere would be generated at a default generation position with a default radius, e.g., the default generation position being the origin of the world coordinate system, and the default radius being in units of length of 3dsmax, e.g., 100, and the generated initial sphere would be displayed via the graphical user interface. In one case, the generation position and the radius of the initial sphere may also be set.
After the initial sphere is generated, the initial sphere is adjusted according to the contour of the target model. For example, the initial sphere may be adjusted by the panel of attributes of the auxiliary sphere according to the contour of the target model. For example, the radius of the initial sphere is adjusted on the property panel of the auxiliary sphere, and the position of the initial sphere (including the center point of the initial sphere) is adjusted according to the contour of the target model. Adjustments may be made in conjunction with pivot or coordinate parameter values of the target model. Correspondingly, the selected initial sphere is obtained, for example, the initial sphere to be adjusted is selected through the AO Spheres control, the radius, the position and the like set on the property panel of the auxiliary sphere are received, the initial sphere is adjusted according to the set radius and position, and the radius and the position of the initial sphere are adjusted to the set radius and position.
The initial sphere to be adjusted can be selected by selecting the initial sphere, for example, by using an AO Spheres control, and the initial sphere is moved or the radius is enlarged/reduced to achieve the purpose of corresponding adjustment.
And finally, enabling the first auxiliary sphere of the adjusted target model to at least comprise the overall contour of the target model in the first preset proportion, and/or enabling the second auxiliary sphere of the target model to at least comprise the partial contour of the target model in the second preset proportion, for example, the second auxiliary sphere at least comprises the contour of a branch and leaf cluster in the second preset proportion, one contour of the branch and leaf cluster corresponds to one second auxiliary sphere, and the auxiliary sphere of the target model comprises the first auxiliary sphere and/or the second auxiliary sphere.
In this case, an initial sphere is generated first, and then the initial sphere is adjusted according to the contour of the target model to obtain an auxiliary sphere.
In one case, the contour of the target model includes an overall contour and/or at least one branch-leaf cluster contour, and the step of adding an auxiliary sphere to the target model according to the contour of the target model includes: adding a first auxiliary sphere to the target model according to the overall contour of the target model, wherein the first auxiliary sphere at least wraps the overall contour of a first preset proportion; and/or adding second auxiliary spheres corresponding to the number of the branches and leaves to the target model according to the contour of the branches and leaves of the target model, wherein the second auxiliary spheres at least wrap the contour of the branches and leaves at a second preset proportion; and taking the first auxiliary sphere and/or the second auxiliary sphere as the auxiliary sphere of the target model. Further, the auxiliary sphere of the target model may be adjusted to obtain a final auxiliary sphere. When the adjustment is carried out, the auxiliary sphere needing to be adjusted is selected through the AO Spheres control, and after the auxiliary sphere is selected, the adjustment can be carried out on the attribute panel of the auxiliary sphere, or the initial sphere is moved or the radius is enlarged/reduced so as to achieve the purpose of corresponding adjustment.
In this case, the auxiliary sphere may be added according to the contour of the target model, and then the added auxiliary sphere may be adjusted.
The auxiliary sphere after the target model adjustment can be as shown in fig. 3.
In an embodiment, the added auxiliary sphere may also be deleted, for example, a certain auxiliary sphere is selected, and the auxiliary sphere is deleted in response to a deletion instruction for the auxiliary sphere. The delete command may be generated by selecting the auxiliary sphere and clicking the right button.
The number of the auxiliary spheres of the target model is at least one, and when the number of the auxiliary spheres is multiple, the auxiliary spheres can be inserted, contained and separated, namely, the position relation among the auxiliary spheres is not limited and is only related to the outline of the target model.
List variables are added into the MaxScript code, the added auxiliary spheres of the target model are added into the list variables of the auxiliary sphere list, currently, three auxiliary spheres are added to the target model, and correspondingly, the list variables comprise the three auxiliary spheres. As shown in fig. 7 and 2, the names of the three auxiliary spheres are Sphere001, sphere002 and Sphere003, respectively.
In the above scheme, the radius, the central point, the number of the auxiliary spheres and the like of the auxiliary spheres can be changed by adjusting the auxiliary spheres, so that the distribution, the gradually changing central point, the gradually changing range and the like of the ambient light shielding information can be adjusted by adjusting the number, the central point and the radius of the auxiliary spheres, and the distribution effect and the optional gradually changing effect of the ambient light shielding can be realized.
In the embodiment of the application, the distribution effect of the ambient light shielding on the target model is set autonomously by controlling the number and/or the position of the auxiliary spheres, and the gradual change effect of the ambient light shielding can be controlled by adjusting the radius of the auxiliary model, so that the ambient light shielding effect is generated independent of the form of the target model.
It should be noted that, in the current ambient light shielding effect obtained according to the form of the target model, such as curvature, normal line, etc., only one type of similar ambient light shielding effect is generated for one target model, and the distribution of the ambient light shielding effect cannot be adjusted.
In an embodiment, the displaying and hiding of the auxiliary sphere can also be set, for example, the displaying and hiding of the auxiliary sphere is controlled according to a display and hiding control element of the auxiliary sphere. Wherein, the explicit and implicit controls are AO Visible controls in fig. 7. Correspondingly, an interactive interface is displayed on the graphical user interface, a display and hidden control of the auxiliary sphere is displayed on the interactive interface, and the display and/or the hiding of the auxiliary sphere are controlled in response to the triggering operation aiming at the display and hidden control. If the auxiliary sphere is displayed on the current graphical user interface, after the AO visual control is triggered, setting the state of the auxiliary sphere to be an invisible state, and hiding the auxiliary sphere; if the auxiliary sphere is not displayed on the current graphical user interface, after the AO Visible control is triggered, the state of the auxiliary sphere is set to be a Visible state, so that the auxiliary sphere is displayed, and the display effect is shown in fig. 3. The display and the hiding of the auxiliary sphere are controlled to avoid influencing other operations.
And 403, when the vertex color drawing instruction is detected, acquiring the target model and the auxiliary sphere corresponding to the target model.
Wherein, a drawing control on the interactive interface, such as PAINT → AO control in fig. 7, is triggered to generate a vertex color drawing instruction. For example, clicking the PAINT → AO control to trigger the control, generating a vertex color drawing instruction, and acquiring the target model and an auxiliary sphere corresponding to the target model when the vertex color drawing instruction is detected.
For example, a model variable may be obtained, if the model variable is empty, it means that there is no target model, and a prompt is performed, otherwise, it means that a target model is obtained; and acquiring a list variable, wherein if the list variable is empty, the auxiliary sphere is set for the target model, and if the list variable is not empty, an auxiliary sphere list in the list variable is acquired.
For each vertex of the target model, a target auxiliary sphere matching the vertex is determined from the auxiliary spheres 404.
And 405, determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere.
In an embodiment, as shown in fig. 6, the model information processing method further includes the following steps 406 to 407.
And 406, storing the ambient light shielding information into the vertex color of the target model.
For example, the calculated ambient light mask intensity values are saved to the vertex color corresponding to each vertex of the object model.
And 407, rendering the target model according to the vertex color to obtain the ambient light shielding effect of the target model.
When the target model is rendered according to the vertex color, the color value of the corresponding vertex can be obtained in the corresponding material, and the final color value of the vertex is determined according to the color value and the vertex color, for example, the color value of the vertex is multiplied by the vertex color (if the vertex color is, the multiplication is multiplied by 0.2) to obtain the final color value of the vertex. If other pixels are also corresponding to the pixels corresponding to the two adjacent vertexes, the two adjacent vertexes are interpolated to obtain the final color values corresponding to the other pixels. And rendering and displaying after the final color value is obtained.
Fig. 8 is a graph showing a comparison between the ambient light shielding effect obtained by the tool or method in the embodiment of the present application and the ambient light shielding effect obtained in the prior art, wherein the target model used is the model shown in fig. 2. The left side in fig. 8 is an ambient light shading effect graph obtained by using the prior art, such as the ambient light baking calculation (which needs to be calculated according to the model state, such as curvature and normal) in 3dsmax, and the right side is an ambient light shading effect graph obtained by using the tool or method in the embodiment of the present application, where the ambient light shading effect is obtained by rendering the vertex color through the material in the non-area Engine 4.
As can be seen from fig. 8, since the patch arrangement of the model manufactured by the grid insert sheet is disordered, the ambient light shielding effect calculated according to the model form such as curvature, normal line and the like in the prior art is disordered and is not in accordance with the real situation, and the ambient light shielding effect obtained by using the method or the tool in the application is softer and more regular, is in accordance with the real situation, and meets the requirement.
The embodiment of the application can be used for customizing the gradual change ambient light shading effect by a protocol user, and conveniently and quickly appointing the ambient light shading intensity value to the vertex color of the target model.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
In order to better implement the model information processing method according to the embodiment of the present application, an embodiment of the present application further provides a model information processing apparatus. Referring to fig. 9, fig. 9 is a schematic structural diagram of a model information processing apparatus according to an embodiment of the present application. The model information processing apparatus 500 may include an acquisition module 501, a first determination module 502, and a second determination module 503.
An obtaining module 501, configured to obtain a target model to be processed and an auxiliary sphere corresponding to the target model, where the target model includes a plurality of vertices, the auxiliary sphere includes at least one vertex, and the auxiliary sphere is predetermined according to a contour of the target model.
A first determining module 502, configured to determine, for each vertex of the target model, a target auxiliary sphere matching the vertex from the auxiliary spheres.
A second determining module 503, configured to determine, according to the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere, ambient light shielding information corresponding to the vertex of the target model.
The first determining module 502, when performing the step of determining the target auxiliary sphere matching the vertex from the auxiliary spheres, specifically performs: determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model; and determining a target auxiliary sphere matched with the vertex from the candidate auxiliary spheres according to the position relation between the vertex and the candidate auxiliary spheres.
When the step of determining, according to the position relationship between the vertex and the candidate auxiliary spheres, a target auxiliary sphere matching the vertex from the candidate auxiliary spheres is executed, the first determining module 502 specifically executes: when the vertex is inside at least one candidate auxiliary sphere, determining a first distance between the vertex and the sphere center of the candidate auxiliary sphere, and taking the candidate auxiliary sphere with the smallest first distance as a target auxiliary sphere matched with the vertex; when the vertex is outside all candidate auxiliary spheres, determining second distances between the vertex and the surfaces of all candidate auxiliary spheres, and taking the candidate auxiliary sphere with the smallest second distance as a target auxiliary sphere matched with the vertex.
When the step of determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model is executed, the first determining module 502 specifically executes: acquiring a bounding box of the target model; and determining the auxiliary sphere with the sphere center of the auxiliary sphere in the bounding box of the target model as a candidate auxiliary sphere.
The second determining module 503 is specifically configured to obtain a radius of the target auxiliary sphere, and determine a distance between the vertex and a spherical center of the target auxiliary sphere; and determining the ambient light shielding information corresponding to the vertex of the target model according to the ratio of the distance to the radius.
The second determining module 503 is configured to, when the step of determining the ambient light shielding information corresponding to the vertex of the target model according to the ratio of the distance to the radius is executed, specifically execute: when the ratio of the distance to the radius is smaller than or equal to a preset ratio, directly determining the ratio as an ambient light shielding intensity value corresponding to the vertex of the target model; and when the ratio of the distance to the radius is larger than a preset ratio, determining the preset ratio as an ambient light shielding intensity value corresponding to the vertex of the target model.
As shown in fig. 9, the model information processing apparatus 500 may further include a display module 504, where the display module 504 is configured to display an interactive interface through a graphical user interface, where the interactive interface displays a model selection control and/or an addition control of an auxiliary sphere, and the display module 504 is further configured to display the target model through the graphical user interface, and when the auxiliary sphere is in a visible state, display the auxiliary sphere, and display an ambient light shielding effect of the target model.
As shown in fig. 9, the model information processing apparatus 500 may further include a model setting module 505. And a model setting module 505 for setting a target model to be processed. Specifically, the model setting module 505 is configured to set the target model to be processed through a model selection control on the interactive interface.
The model setting module 505 is specifically configured to display a model selection interface in response to a trigger operation for the model selection control; and determining the selected target model based on the model selection interface, and taking the selected target model as the target model to be processed.
As shown in fig. 9, the model information processing apparatus 500 may further include a sphere setting module 506. A sphere setting module 506, configured to add an auxiliary sphere to the target model in response to a trigger operation for the add control. Specifically, according to the contour of the target model, an auxiliary sphere is added to the target model.
The sphere setting module 506, when executing the step of adding an auxiliary sphere to the target model according to the contour of the target model, specifically executes: adding an initial sphere to the target model; and adjusting the initial sphere according to the contour of the target model to obtain an adjusted auxiliary sphere.
The target model is a crown-shaped model or a shrub-shaped model, the contour of the target model includes an overall contour and/or at least one contour of a branch and leaf cluster, and the sphere setting module 506 specifically executes the following steps when executing the step of adding an auxiliary sphere to the target model according to the contour of the target model: adding a first auxiliary sphere to the target model according to the overall contour of the target model, wherein the first auxiliary sphere at least wraps the overall contour in a first preset proportion; and/or adding second auxiliary spheres corresponding to the number of the branches and leaves to the target model according to the contour of the branches and leaves of the target model, wherein the second auxiliary spheres at least wrap the contour of the branches and leaves in a second preset proportion; and taking the first auxiliary sphere and/or the second auxiliary sphere as the auxiliary sphere of the target model. The sphere setting module 506 is also used for adjusting the auxiliary sphere.
As shown in fig. 9, the model information processing apparatus 500 may further include a saving module 507 and a rendering module 508. The saving module 507 is configured to save the ambient light shielding information into a vertex color of the target model. And a rendering module 508, configured to render the target model according to the vertex color to obtain an ambient light shielding effect of the target model.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
Correspondingly, the embodiment of the application further provides a computer device, and the computer device can be a terminal or a server. As shown in fig. 10, fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer apparatus 600 includes a processor 601 having one or more processing cores, a memory 602 having one or more computer-readable storage media, and a computer program stored on the memory 602 and executable on the processor. The processor 601 is electrically connected to the memory 602. Those skilled in the art will appreciate that the computer device configurations illustrated in the figures are not meant to be limiting of computer devices and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The processor 601 is a control center of the computer apparatus 600, connects various parts of the entire computer apparatus 600 using various interfaces and lines, performs various functions of the computer apparatus 600 and processes data by running or loading software programs (computer programs) and/or modules stored in the memory 602, and calling data stored in the memory 602, thereby monitoring the computer apparatus 600 as a whole.
In the embodiment of the present application, the processor 601 in the computer device 600 loads instructions corresponding to processes of one or more applications into the memory 602, and the processor 601 executes the applications stored in the memory 602 according to the following steps, so as to implement various functions:
obtaining a target model to be processed, wherein the target model comprises a plurality of vertexes; acquiring auxiliary spheres corresponding to the target model, wherein the auxiliary spheres comprise at least one auxiliary sphere, and the auxiliary spheres are predetermined according to the contour of the target model; for each vertex of the target model, determining a target auxiliary sphere matching the vertex from the auxiliary spheres; and determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere.
When the processor 601 executes the step of determining the target auxiliary sphere matching the vertex from the auxiliary spheres, specifically: determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model; and determining a target auxiliary sphere matched with the vertex from the candidate auxiliary spheres according to the position relation between the vertex and the candidate auxiliary spheres.
When the step of determining, according to the position relationship between the vertex and the candidate auxiliary spheres, a target auxiliary sphere matching the vertex from the candidate auxiliary spheres is executed by the processor 601, specifically: when the vertex is inside at least one candidate auxiliary sphere, determining a first distance between the vertex and the sphere center of the candidate auxiliary sphere, and taking the candidate auxiliary sphere with the smallest first distance as a target auxiliary sphere matched with the vertex; when the vertex is outside all candidate auxiliary spheres, determining second distances between the vertex and the surfaces of all candidate auxiliary spheres, and taking the candidate auxiliary sphere with the smallest second distance as a target auxiliary sphere matched with the vertex.
When the step of determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model is executed, the processor 601 specifically executes: acquiring a bounding box of the target model; and determining auxiliary spheres with the sphere centers of the auxiliary spheres within the bounding box of the target model as candidate auxiliary spheres.
When the step of determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere is executed, the processor 601 specifically executes: acquiring the radius of the target auxiliary sphere, and determining the distance between the vertex and the spherical center of the target auxiliary sphere; and determining the ambient light shielding information corresponding to the vertex of the target model according to the ratio of the distance to the radius.
Wherein the ambient light shielding information includes an ambient light shielding intensity value, and when the step of determining the ambient light shielding information corresponding to the vertex of the target model according to the ratio of the distance to the radius is executed by the processor 601, the following steps are specifically executed: when the ratio of the distance to the radius is smaller than or equal to a preset ratio, directly determining the ratio as an ambient light shielding intensity value corresponding to the vertex of the target model; and when the ratio of the distance to the radius is greater than a preset ratio, determining the preset ratio as an ambient light shielding intensity value corresponding to the vertex of the target model.
Wherein, the processor 601 further executes displaying an interactive interface through a graphical user interface, and a model selection control is displayed on the interactive interface; displaying a model selection interface in response to a triggering operation for the model selection control; and determining the selected target model based on the model selection interface, and taking the selected target model as the target model to be processed.
The processor 601 further executes an interactive interface displayed through a graphical user interface, and an adding control of the auxiliary sphere is displayed on the interactive interface; adding an auxiliary sphere for the target model in response to a triggering operation for the adding control; displaying the auxiliary sphere through the graphical user interface when the auxiliary sphere is in a visible state.
When the processor 601 executes the step of adding the auxiliary sphere to the target model, it specifically executes: and adding an auxiliary sphere for the target model according to the contour of the target model.
When the processor 601 adds the auxiliary sphere to the target model according to the contour of the target model, specifically: adding an initial sphere to the target model; and adjusting the initial sphere according to the contour of the target model to obtain an adjusted auxiliary sphere.
The target model is a crown-shaped model or a shrub-shaped model, the contour of the target model includes an overall contour and/or at least one branch and leaf cluster contour, and the processor 601 specifically executes, when adding an auxiliary sphere to the target model according to the contour of the target model, the following steps: adding a first auxiliary sphere to the target model according to the overall contour of the target model, wherein the first auxiliary sphere at least wraps the overall contour in a first preset proportion; and/or adding second auxiliary spheres corresponding to the number of the branches and leaves to the target model according to the branch and leaf cluster contours of the target model, wherein the second auxiliary spheres at least wrap the branch and leaf cluster contours in a second preset proportion; and taking the first auxiliary sphere and/or the second auxiliary sphere as the auxiliary sphere of the target model.
Wherein the processor 601 further performs saving the ambient light masking information into the vertex color of the target model; and rendering the target model according to the vertex color to obtain the ambient light shielding effect of the target model.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 10, the computer device 600 further includes: touch display screen 603, radio frequency circuit 604, audio circuit 605, input unit 606, and power supply 607. The processor 601 is electrically connected to the touch display screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607. Those skilled in the art will appreciate that the computer device architecture illustrated in FIG. 10 is not intended to be limiting of computer devices and may include more or less components than those illustrated, or combinations of certain components, or different arrangements of components.
The touch display screen 603 can be used for displaying a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface. The touch display screen 603 may include a display panel and a touch panel. Among other things, the display panel may be used to display information input by or provided to a user as well as various graphical user interfaces of the computer device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 601 to determine the type of the touch event, and then the processor 601 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 603 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display screen 603 can also be used as a part of the input unit 606 to implement an input function.
In the embodiment of the present application, the touch display screen 603 is used for presenting a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface.
The rf circuit 604 may be used for transceiving rf signals to establish wireless communication with a network device or other computer device via wireless communication, and for transceiving signals with the network device or other computer device.
The audio circuit 605 may be used to provide an audio interface between a user and a computer device through speakers and microphones. The audio circuit 605 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 605 and converted into audio data, and the audio data is processed by the audio data output processor 601, and then sent to another computer device through the rf circuit 604, or output to the memory 602 for further processing. The audio circuit 605 may also include an earbud jack to provide communication of peripheral headphones with the computer device.
The input unit 606 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 607 is used to power the various components of the computer device 600. Optionally, the power supply 607 may be logically connected to the processor 601 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 607 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 10, the computer device 600 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which will not be described herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any one of the model information processing methods provided by the embodiments of the present application. For example, the computer program may perform the steps of:
obtaining a target model to be processed, wherein the target model comprises a plurality of vertexes; acquiring auxiliary spheres corresponding to the target model, wherein the auxiliary spheres comprise at least one auxiliary sphere which is predetermined according to the contour of the target model; for each vertex of the target model, determining a target auxiliary sphere matching the vertex from the auxiliary spheres; and determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere.
Wherein, when executing the step of determining the target auxiliary sphere matching the vertex from the auxiliary spheres, the processor specifically executes: determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model; and determining a target auxiliary sphere matched with the vertex from the candidate auxiliary spheres according to the position relation between the vertex and the candidate auxiliary spheres.
When the step of determining the target auxiliary sphere matching the vertex from the candidate auxiliary spheres according to the position relationship between the vertex and the candidate auxiliary spheres is executed, the processor specifically executes: when the vertex is inside at least one candidate auxiliary sphere, determining a first distance between the vertex and the sphere center of the candidate auxiliary sphere, and taking the candidate auxiliary sphere with the smallest first distance as a target auxiliary sphere matched with the vertex; when the vertex is outside all the candidate auxiliary spheres, determining second distances between the vertex and the surfaces of all the candidate auxiliary spheres, and taking the candidate auxiliary sphere with the smallest second distance as a target auxiliary sphere matched with the vertex.
Wherein, when executing the step of determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model, the processor specifically executes: acquiring a bounding box of the target model; and determining auxiliary spheres with the sphere centers of the auxiliary spheres within the bounding box of the target model as candidate auxiliary spheres.
When the step of determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere is executed, the processor specifically executes: acquiring the radius of the target auxiliary sphere, and determining the distance between the vertex and the sphere center of the target auxiliary sphere; and determining the ambient light shielding information corresponding to the vertex of the target model according to the ratio of the distance to the radius.
Wherein the ambient light shielding information includes an ambient light shielding intensity value, and the processor specifically executes, when executing the step of determining the ambient light shielding information corresponding to the vertex of the target model according to the ratio of the distance to the radius: when the ratio of the distance to the radius is smaller than or equal to a preset ratio, directly determining the ratio as an ambient light shielding intensity value corresponding to the vertex of the target model; and when the ratio of the distance to the radius is larger than a preset ratio, determining the preset ratio as an ambient light shielding intensity value corresponding to the vertex of the target model.
Wherein the processor further executes displaying an interactive interface through the graphical user interface, the interactive interface displaying a model selection control; displaying a model selection interface in response to a triggering operation for the model selection control; and determining the selected target model based on the model selection interface, and taking the selected target model as the target model to be processed.
The processor further executes an interactive interface displayed through a graphical user interface, and an adding control of the auxiliary sphere is displayed on the interactive interface; adding an auxiliary sphere for the target model in response to a triggering operation for the adding control; displaying the auxiliary sphere through the graphical user interface when the auxiliary sphere is in a visible state.
Wherein, when executing the step of adding an auxiliary sphere to the target model, the processor specifically executes: and adding an auxiliary sphere for the target model according to the outline of the target model.
When the processor adds the auxiliary sphere to the target model according to the contour of the target model, the processor specifically executes: adding an initial sphere to the target model; and adjusting the initial sphere according to the contour of the target model to obtain an adjusted auxiliary sphere.
The target model is a crown-shaped model or a shrub-shaped model, the outline of the target model comprises an overall outline and/or at least one branch and leaf cluster outline, and when the processor adds an auxiliary sphere to the target model according to the outline of the target model, the processor specifically executes: adding a first auxiliary sphere to the target model according to the overall contour of the target model, wherein the first auxiliary sphere at least wraps the overall contour in a first preset proportion; and/or adding second auxiliary spheres corresponding to the number of the branches and leaves to the target model according to the contour of the branches and leaves of the target model, wherein the second auxiliary spheres at least wrap the contour of the branches and leaves in a second preset proportion; and taking the first auxiliary sphere and/or the second auxiliary sphere as the auxiliary sphere of the target model.
Wherein the processor further performs saving the ambient light mask information into vertex colors of the target model; and rendering the target model according to the vertex color to obtain the ambient light shielding effect of the target model.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any model information processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any model information processing method provided in the embodiments of the present application can be achieved, and detailed descriptions are omitted here for the details, see the foregoing embodiments.
The above detailed description is given of a model information processing method, a model information processing apparatus, a storage medium, and a computer device provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principles and embodiments of the present application, and the description of the above embodiments is only used to help understanding the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (15)

1. A model information processing method, characterized by comprising:
obtaining a target model to be processed, wherein the target model comprises a plurality of vertexes;
acquiring auxiliary spheres corresponding to the target model, wherein the auxiliary spheres comprise at least one auxiliary sphere which is predetermined according to the contour of the target model;
for each vertex of the target model, determining a target auxiliary sphere matching the vertex from the auxiliary spheres;
and determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere.
2. The method according to claim 1, wherein the step of determining a target auxiliary sphere from the auxiliary spheres that matches the vertex comprises:
determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model;
and determining a target auxiliary sphere matched with the vertex from the candidate auxiliary spheres according to the position relation between the vertex and the candidate auxiliary spheres.
3. The method according to claim 2, wherein the step of determining a target auxiliary sphere matching the vertex from the candidate auxiliary spheres according to the position relationship between the vertex and the candidate auxiliary spheres comprises:
when the vertex is inside at least one candidate auxiliary sphere, determining a first distance between the vertex and the sphere center of the candidate auxiliary sphere, and taking the candidate auxiliary sphere with the smallest first distance as a target auxiliary sphere matched with the vertex;
when the vertex is outside all the candidate auxiliary spheres, determining second distances between the vertex and the surfaces of all the candidate auxiliary spheres, and taking the candidate auxiliary sphere with the smallest second distance as a target auxiliary sphere matched with the vertex.
4. The method of claim 2, wherein the step of determining candidate auxiliary spheres from the auxiliary spheres according to the bounding box of the target model comprises:
acquiring a bounding box of the target model;
and determining the auxiliary sphere with the sphere center of the auxiliary sphere in the bounding box of the target model as a candidate auxiliary sphere.
5. The method according to claim 1, wherein the step of determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the center of the target auxiliary sphere comprises:
acquiring the radius of the target auxiliary sphere, and determining the distance between the vertex and the sphere center of the target auxiliary sphere;
and determining the ambient light shielding information corresponding to the vertex of the target model according to the ratio of the distance to the radius.
6. The method of claim 5, wherein the ambient light mask information comprises an ambient light mask intensity value, and wherein the step of determining the ambient light mask information corresponding to the vertex of the target model according to the ratio of the distance to the radius comprises:
when the ratio of the distance to the radius is smaller than or equal to a preset ratio, directly determining the ratio as an ambient light shielding intensity value corresponding to the vertex of the target model;
and when the ratio of the distance to the radius is larger than a preset ratio, determining the preset ratio as an ambient light shielding intensity value corresponding to the vertex of the target model.
7. The method of any one of claims 1-6, further comprising:
displaying an interactive interface through a graphical user interface, wherein a model selection control is displayed on the interactive interface;
responding to the triggering operation aiming at the model selection control, and displaying a model selection interface;
and determining the selected target model based on the model selection interface, and taking the selected target model as the target model to be processed.
8. The method of any one of claims 1-6, further comprising:
displaying an interactive interface through a graphical user interface, wherein an adding control of an auxiliary sphere is displayed on the interactive interface;
adding an auxiliary sphere for the target model in response to a triggering operation for the adding control;
displaying the auxiliary sphere through the graphical user interface when the auxiliary sphere is in a visible state.
9. The method of claim 8, wherein the step of adding an auxiliary sphere to the target model comprises: and adding an auxiliary sphere for the target model according to the contour of the target model.
10. The method of claim 9, wherein the step of adding an auxiliary sphere to the target model according to the contour of the target model comprises:
adding an initial sphere to the target model;
and adjusting the initial sphere according to the contour of the target model to obtain an adjusted auxiliary sphere.
11. The method according to claim 9, wherein the target model is a crown-like model or a shrub-like model, the contour of the target model comprises an overall contour and/or at least one branch and leaf cluster contour, and the step of adding an auxiliary sphere to the target model according to the contour of the target model comprises:
adding a first auxiliary sphere to the target model according to the overall contour of the target model, wherein the first auxiliary sphere at least wraps the overall contour in a first preset proportion; and/or
Adding second auxiliary spheres corresponding to the number of the branches and leaves to the target model according to the contours of the branches and leaves of the target model, wherein the second auxiliary spheres at least wrap the contours of the branches and leaves in a second preset proportion;
and taking the first auxiliary sphere and/or the second auxiliary sphere as the auxiliary sphere of the target model.
12. The method according to any one of claims 1-6 or 9-11, further comprising, after determining the ambient light mask information corresponding to the vertex:
saving the ambient light shielding information to the vertex color of the target model;
and rendering the target model according to the vertex color to obtain the ambient light shielding effect of the target model.
13. A model information processing apparatus characterized by comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target model to be processed and an auxiliary sphere corresponding to the target model, the target model comprises a plurality of vertexes, the auxiliary sphere comprises at least one vertex, and the auxiliary sphere is predetermined according to the outline of the target model;
a first determining module, configured to determine, for each vertex of the target model, a target auxiliary sphere matching the vertex from the auxiliary spheres;
and the second determining module is used for determining the ambient light shielding information corresponding to the vertex of the target model according to the radius of the target auxiliary sphere and the distance between the vertex and the spherical center of the target auxiliary sphere.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program adapted to be loaded by a processor to perform the steps in the model information processing method according to any one of claims 1 to 12.
15. A computer device characterized by comprising a memory in which a computer program is stored and a processor that executes the steps in the model information processing method according to any one of claims 1 to 12 by calling the computer program stored in the memory.
CN202210931523.2A 2022-08-04 2022-08-04 Model information processing method, device, storage medium and computer equipment Pending CN115272432A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210931523.2A CN115272432A (en) 2022-08-04 2022-08-04 Model information processing method, device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210931523.2A CN115272432A (en) 2022-08-04 2022-08-04 Model information processing method, device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN115272432A true CN115272432A (en) 2022-11-01

Family

ID=83749402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210931523.2A Pending CN115272432A (en) 2022-08-04 2022-08-04 Model information processing method, device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN115272432A (en)

Similar Documents

Publication Publication Date Title
CN113052947B (en) Rendering method, rendering device, electronic equipment and storage medium
CN112233211B (en) Animation production method, device, storage medium and computer equipment
CN112370783B (en) Virtual object rendering method, device, computer equipment and storage medium
CN112802172B (en) Texture mapping method and device for three-dimensional model, storage medium and computer equipment
CN112465945B (en) Model generation method and device, storage medium and computer equipment
CN112053423A (en) Model rendering method and device, storage medium and computer equipment
CN113546411B (en) Game model rendering method, device, terminal and storage medium
CN112206517A (en) Rendering method, device, storage medium and computer equipment
CN112489179B (en) Target model processing method and device, storage medium and computer equipment
CN113516742A (en) Model special effect manufacturing method and device, storage medium and electronic equipment
CN118015194A (en) Model processing method, device and computer readable storage medium
CN112206519B (en) Method, device, storage medium and computer equipment for realizing game scene environment change
CN112950753B (en) Virtual plant display method, device, equipment and storage medium
CN113362435B (en) Virtual component change method, device, equipment and medium of virtual object model
CN115645921A (en) Game indicator generating method and device, computer equipment and storage medium
CN115880402A (en) Flow animation generation method and device, electronic equipment and readable storage medium
CN113350792B (en) Contour processing method and device for virtual model, computer equipment and storage medium
CN115272432A (en) Model information processing method, device, storage medium and computer equipment
CN113345059B (en) Animation generation method and device, storage medium and electronic equipment
CN114266849A (en) Model automatic generation method and device, computer equipment and storage medium
CN115861519A (en) Rendering method and device of hair model, computer equipment and storage medium
CN115731339A (en) Virtual model rendering method and device, computer equipment and storage medium
CN114404953A (en) Virtual model processing method and device, computer equipment and storage medium
CN117274474A (en) Method and device for generating ambient light mask, electronic equipment and storage medium
CN117893668A (en) Virtual scene processing method and device, computer equipment and storage medium

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