CN109903384A - A kind of method and device, calculating equipment and the storage medium of model setting - Google Patents

A kind of method and device, calculating equipment and the storage medium of model setting Download PDF

Info

Publication number
CN109903384A
CN109903384A CN201910305736.2A CN201910305736A CN109903384A CN 109903384 A CN109903384 A CN 109903384A CN 201910305736 A CN201910305736 A CN 201910305736A CN 109903384 A CN109903384 A CN 109903384A
Authority
CN
China
Prior art keywords
grid
control
direction ray
model
ray
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.)
Granted
Application number
CN201910305736.2A
Other languages
Chinese (zh)
Other versions
CN109903384B (en
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.)
Zhuhai Xishan Mobile Game Technology Co Ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Original Assignee
Zhuhai Xishan Mobile Game Technology Co Ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Xishan Mobile Game Technology Co Ltd, Zhuhai Kingsoft Online Game Technology Co Ltd filed Critical Zhuhai Xishan Mobile Game Technology Co Ltd
Priority to CN201910305736.2A priority Critical patent/CN109903384B/en
Publication of CN109903384A publication Critical patent/CN109903384A/en
Application granted granted Critical
Publication of CN109903384B publication Critical patent/CN109903384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application provides a kind of method and device of model setting, calculates equipment and storage medium, wherein determines selected point the described method includes: instructing according to input, determines direction ray according to the selected point and virtual camera;The first intersection point for determining the direction ray and model, using the first intersection point as the central point for drawing control;According to the central point and the corresponding attribute value of the drafting control for drawing control, the model attributes value within the scope of the drafting control is determined, it is easy to operate efficient so as to carry out the setting of model attributes value by any position drawn in control Selection Model.

Description

A kind of method and device, calculating equipment and the storage medium of model setting
Technical field
This application involves animation design technique field, in particular to a kind of method and device of model setting calculates equipment And storage medium.
Background technique
Production for the threedimensional model in cartoon scene needs further after threedimensional model is drawn to three The attribute of dimension module is configured.By taking person model as an example, need to be configured the attribute of person model, such as threedimensional model Color, habilimented pliability, the flintiness etc. for dressing the armor.
In the prior art, threedimensional model attribute setting can only blockette choose, then each block is belonged to respectively Property setting.By taking coloring as an example, the coloring process of threedimensional model is that software-based tool is edited mostly in the prior art, this A little tools can only often realize complete object or object in blockette selection or Selection Model when carrying out model selection Some part, then color in the partial content of selection, cannot achieve and choose arbitrary size or position and carry out color volume Volume.
Therefore, the intricate operation of model setting in the prior art, inefficiency influence the production progress of threedimensional model.
Summary of the invention
In view of this, the embodiment of the present application provides a kind of method and device of model setting, calculates equipment and storage Jie Matter, to solve technological deficiency existing in the prior art.
The embodiment of the present application discloses a kind of method of model setting, in virtual scene, the virtual scene to be arranged There is virtual camera, which comprises
It is instructed according to input and determines selected point, direction ray is determined according to the selected point and virtual camera;
The first intersection point for determining the direction ray and model, using the first intersection point as the central point for drawing control;
According to the central point and the corresponding attribute value of the drafting control for drawing control, determines and be located at the drafting control model Enclose interior model attributes value.
Optionally, it is instructed according to input and determines selected point, comprising: instructed according to the input that mouse generates and determine selected point.
Optionally it is determined that the first intersection point of the direction ray and model, comprising:
It is multiple grids by the model partition, according to grid protocol multistage spatial cuboids, wherein i-stage space is vertical Cube includes at least two i+1 grade spatial cuboids, and i is the positive integer more than or equal to 1;
The direction ray and the spatial cuboids are carried out asking friendship step by step, determines and first intersects with the direction ray The smallest spatial cuboids of rank be object space cube;
Each grid in the object space cube is asked into friendship with the direction ray, obtains the first and target The grid of ray intersection;
Determine the intersection point of the direction ray Yu the grid.
Optionally, it carries out the direction ray and the spatial cuboids to ask friendship step by step, determines the first and target The smallest spatial cuboids of the rank of ray intersection are object space cube, comprising:
S1, the direction ray and i-stage spatial cuboids are carried out to ask friendship, determines the head intersected with the direction ray A i-stage spatial cuboids;Wherein, 1≤i≤n;
S2, direction ray i+1 grade spatial cuboids corresponding with the first i-stage spatial cuboids are carried out Friendship is asked, determines the first i+1 grade spatial cuboids intersected with the direction ray;
S3, judge whether i is less than n, if so, step S4 is executed, if it is not, executing step S5;
S4, i is increased 1 certainly, then executes step S2;
First n-th grade of spatial cuboids that S5, determination are intersected with the direction ray are object space cube.
Optionally it is determined that the intersection point of the direction ray and the grid, comprising:
The intersecting point coordinate of the direction ray Yu the grid is obtained by predefined function.
Optionally, it according to the central point and the corresponding attribute value of the drafting control for drawing control, determines and is located at described draw Model attributes value within the scope of control processed, comprising:
According to the central point for drawing control, determines and draw control range;
All grid vertexes of the model are traversed, determine the grid vertex for being located at and drawing within the scope of control;
It is located at the attribute value for drawing the grid vertex within the scope of control according to drawing the corresponding attribute value of control and determining;
According to the attribute value of grid vertex, the attribute value of the grid is determined.
Optionally, the grid vertex being located within the scope of the drafting control is determined according to the corresponding attribute value of drafting control Attribute value, comprising:
According to the corresponding attribute value of the drafting control, weight coefficient and the grid vertex and the drafting control The product of the distance of central point determines the attribute value of the grid vertex within the scope of the drafting control.
Optionally, the attribute value includes: one of color value, weight value, bone weighted value, hardness number or a variety of.
The embodiment of the present application discloses a kind of device of model setting, in virtual scene, the virtual scene to be arranged There is virtual camera, described device includes:
Ray determining module is configured as instructing determining selected point according to input, according to the selected point and virtual camera shooting Machine determines direction ray;
Central point determining module is configured to determine that the first intersection point of the direction ray and model, by the first friendship Point is as the central point for drawing control;
Model attributes value determining module is configured as according to the central point and the corresponding category of the drafting control for drawing control Property value, determine be located at it is described drafting control within the scope of model attributes value.
Optionally, the ray determining module is specifically configured to: being instructed according to the input that mouse generates and is determined selected point.
Optionally, the central point determining module is specifically configured to:
It is multiple grids by the model partition, according to grid protocol multistage spatial cuboids, wherein i-stage space is vertical Cube includes at least two i+1 grade spatial cuboids, and i is the positive integer more than or equal to 1;
The direction ray and the spatial cuboids are carried out asking friendship step by step, determines and first intersects with the direction ray The smallest spatial cuboids of rank be object space cube;
Each grid in the object space cube is asked into friendship with the direction ray, obtains the first and target The grid of ray intersection;
Determine the intersection point of the direction ray Yu the grid.
Optionally, the central point determining module is specifically configured to:
First seeks friendship module, is configured as carrying out the direction ray and i-stage spatial cuboids to ask friendship, determining and institute State the first i-stage spatial cuboids of direction ray intersection;Wherein, 1≤i≤n;
Second seeks friendship module, is configured as the direction ray and the first i-stage spatial cuboids corresponding i-th + 1 grade of spatial cuboids carries out asking friendship, determines the first i+1 grade spatial cuboids intersected with the direction ray;
Judgment module is configured as judging whether i is less than n, if so, executing from module is increased, if it is not, executing determining module;
From module is increased, it is configured as i then executing second from increasing 1 and seeking friendship module;
Determining module is configured to determine that the first n-th grade of spatial cuboids intersected with the direction ray are target empty Between cube.
Optionally, the central point determining module is specifically configured to: being obtained the target by predefined function and is penetrated The intersecting point coordinate of line and the grid.
Optionally, the central point determining module is specifically configured to:
According to the central point for drawing control, determines and draw control range;
All grid vertexes of the model are traversed, determine the grid vertex for being located at and drawing within the scope of control;
It is located at the attribute value for drawing the grid vertex within the scope of control according to drawing the corresponding attribute value of control and determining;
According to the attribute value of grid vertex, the attribute value of the grid is determined.
Optionally, the central point determining module is specifically configured to: according to the corresponding attribute value of the drafting control, power The product of weight coefficient and the grid vertex at a distance from the central point for drawing control, determines the drafting control range The attribute value of interior grid vertex.
Optionally, the attribute value includes: one of color value, weight value, bone weighted value, hardness number or a variety of.
The embodiment of the present application discloses a kind of calculating equipment, including memory, processor and storage are on a memory and can The computer instruction run on a processor, the processor realize the side of model setting as described above when executing described instruction The step of method.
The embodiment of the present application discloses a kind of computer readable storage medium, is stored with computer instruction, and feature exists In the method for model setting as described above is realized in, instruction when being executed by processor the step of.
The method and device of model setting provided by the present application, by determining that target is penetrated according to selected point and virtual camera Line, using the first intersection point of direction ray and model as the central point for drawing control, according to the central point and drafting for drawing control The corresponding attribute value of control determines the model attributes value for being located at and drawing within the scope of control, so as to be chosen by drawing control Any position in model carries out the setting of model attributes value, compared with prior art, easy to operate efficient.
Detailed description of the invention
Fig. 1 is the structural schematic diagram of the calculating equipment of the embodiment of the present application;
Fig. 2 is the flow diagram of the method for the model setting of one embodiment of the application;
Fig. 3 is the flow diagram of the method for the model setting of one embodiment of the application;
Fig. 4 is the binary tree schematic diagram of one embodiment of the application;
Fig. 5 is the flow diagram of the method for the model setting of one embodiment of the application;
Fig. 6 is the flow diagram of the method for the model setting of one embodiment of the application;
Fig. 7 is the flow diagram of the method for the model setting of another embodiment of the application;
Fig. 8 is the structural schematic diagram of the device of the model setting of the embodiment of the present application.
Specific embodiment
Many details are explained in the following description in order to fully understand the application.But the application can be with Much it is different from other way described herein to implement, those skilled in the art can be without prejudice to the application intension the case where Under do similar popularization, therefore the application is not limited by following public specific implementation.
The term used in this specification one or more embodiment be only merely for for the purpose of describing particular embodiments, It is not intended to be limiting this specification one or more embodiment.In this specification one or more embodiment and appended claims The "an" of singular used in book, " described " and "the" are also intended to including most forms, unless context is clearly Indicate other meanings.It is also understood that term "and/or" used in this specification one or more embodiment refers to and includes One or more associated any or all of project listed may combine.
It will be appreciated that though may be retouched using term first, second etc. in this specification one or more embodiment Various information are stated, but these information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other It opens.For example, first can also be referred to as second, class in the case where not departing from this specification one or more scope of embodiments As, second can also be referred to as first.Depending on context, word as used in this " if " can be construed to " ... when " or " when ... " or " in response to determination ".
In this application, it provides a kind of method and device of model setting, calculate equipment and storage medium, following It is described in detail one by one in embodiment.
Fig. 1 is to show the structural block diagram of the calculating equipment 100 according to one embodiment of this specification.The calculating equipment 100 Component include but is not limited to memory 110 and processor 120.Processor 120 is connected with memory 110 by bus 130, Database 150 is for saving data.
Calculating equipment 100 further includes access device 140, access device 140 enable calculate equipment 100 via one or Multiple networks 160 communicate.The example of these networks includes public switched telephone network (PSTN), local area network (LAN), wide area network (WAN), the combination of the communication network of personal area network (PAN) or such as internet.Access device 140 may include wired or wireless One or more of any kind of network interface (for example, network interface card (NIC)), such as IEEE802.11 wireless local area Net (WLAN) wireless interface, worldwide interoperability for microwave accesses (Wi-MAX) interface, Ethernet interface, universal serial bus (USB) connect Mouth, cellular network interface, blue tooth interface, near-field communication (NFC) interface, etc..
In one embodiment of this specification, other unshowned portions in the above-mentioned component and Fig. 1 of equipment 100 are calculated Part can also be connected to each other, such as pass through bus.It should be appreciated that calculating device structure block diagram shown in FIG. 1 merely for the sake of Exemplary purpose, rather than the limitation to this specification range.Those skilled in the art can according to need, and increases or replaces it His component.
Calculating equipment 100 can be any kind of static or mobile computing device, including mobile computer or mobile meter Calculate equipment (for example, tablet computer, personal digital assistant, laptop computer, notebook computer, net book etc.), movement Phone (for example, smart phone), wearable calculating equipment (for example, smartwatch, intelligent glasses etc.) or other kinds of shifting Dynamic equipment, or the static calculating equipment of such as desktop computer or PC.Calculating equipment 100 can also be mobile or state type Server.
Wherein, processor 120 can execute the step in method shown in Fig. 2.Fig. 2 is to show to be implemented according to the application one The schematic flow chart of the method for the model setting of example, including step 201 is to step 203.
201, it is instructed according to input and determines selected point, direction ray is determined according to the selected point and virtual camera.
It is to be understood that virtual camera is set in virtual scene, such as 3D scene, corresponding the 3D window is exactly to open up Show content captured by this virtual camera.Position where this video camera is that system is customized, as direction ray Starting point.This ray is exactly the ray emitted by starting point towards selected point.So each selected point only corresponds to a ray.
It wherein, there are many input instructions, such as can be the instruction of the inputs such as mouse, keyboard.
It by taking mouse inputs as an example, in this step, is instructed according to input and determines selected point, comprising: generated according to mouse defeated Enter to instruct and determines selected point.
Specifically, the input instruction that mouse generates can be movement, the click commands of mouse.Such as mouse is moved to one Point, is then clicked, that is, determines that the point is selected point.
202, the first intersection point for determining the direction ray and model, using the first intersection point as the center for drawing control Point.
Wherein, drafting control can be a variety of, for example, brush.
Specifically, referring to Fig. 3, the first intersection point of the direction ray and model is determined in this step, comprising:
It 301, is multiple grids by the model partition, according to grid protocol multistage spatial cuboids, wherein i-stage is empty Between cube include at least two i+1 grade spatial cuboids, and i is positive integer more than or equal to 1.
Optionally, grid can be a variety of, for example, triangular mesh.
Wherein, it according to grid protocol multistage spatial cuboids, specifically includes: multiple grids is arranged, formed multistage Then grid forms multistage spatial cuboids according to multilevel splitting.
For example, being multiple grids by model partition, then by 3 grades of grids of multiple grid protocols, wherein model includes at least Two the 1st grade of grids, each 1st grade of grid include at least two the 2nd grades of grids, and each 2nd grade of grid includes at least two the 3rd Grade grid.
According to 3 grades of grid protocols, 3 grades of spatial cuboids, wherein each 1st grade of spatial cuboids include at least two the 2nd Grade spatial cuboids, each 2nd grade of spatial cuboids include at least two 3rd level spatial cuboids.
Specifically, by multiple grids carry out arrangement formed multilevel splitting method can there are many, such as binary tree space Dividing method, quaternary tree space dividing method, Octree space dividing method etc..
Wherein, series i can be arranged according to actual needs, such as setting series i is 10,20 or 30.
302, it carries out the direction ray and the spatial cuboids to ask friendship step by step, determines the first and direction ray The smallest spatial cuboids of the rank of intersection are object space cube.
For example, being 3 grades of spatial cuboids by the model partition, wherein each 1st grade of spatial cuboids include at least two A 2nd grade of spatial cuboids, each 2nd grade of spatial cuboids include at least two 3rd level spatial cuboids.So, in step In 302, it is thus necessary to determine that the first 3rd level spatial cuboids intersected with direction ray are object space cube.
303, by the object space cube each grid and the direction ray ask friendship, obtain it is first with it is described The grid of direction ray intersection.
Specifically, in this step, all grids in object space cube are needed to be traversed for, by each grid respectively with mesh Mark ray asks friendship, then obtains the grid intersected with direction ray, finally judges the first grid intersected with direction ray.
304, the intersection point of the direction ray Yu the grid is determined.
Specifically, the intersecting point coordinate of the direction ray Yu the grid, such as system are obtained by predefined function The function that the Direct3D of bottom is directly provided.
Alternatively, it is also possible to be calculated by following method: the intersection point of plane where first calculating direction ray and grid, The intersection point is judged again whether inside grid, if it is, determining that the point is the intersection point of direction ray and grid.
Below with reference to Fig. 4, to binary tree space dividing method according to the method for multiple grid protocol multistage spatial cuboids It explains.
Each model is made of thousands of a grids.Referring to fig. 4, the corresponding all grids of model first can be divided into two It is a firstly, all grids of model are divided into two classes, form two 1 grade of spatial cuboids a41.Continue to classify, each 1 The corresponding grid of grade spatial cuboids continues to be divided into two classes, corresponding two 2 grades of spatial cuboids a42 is generated, by each 2 The corresponding grid of grade spatial cuboids continues to be divided into two classes, generates corresponding two 3 grades of spatial cuboids a43 ... successively Analogize, until generating the spatial cuboids of most final stage.
Finally, all grids of this 3D model will form a binary tree.Each grid has on this binary tree The node of oneself.When seeking the intersection point of ray and model, exactly calculated along this binary tree.The y-bend ultimately generated Tree is as shown in Figure 4.Wherein, which grid is the serial number in Fig. 4 in circle indicate.
Specifically, referring to Fig. 5, step 302 includes:
501, the direction ray and i-stage spatial cuboids are carried out asking friendship, what determination was intersected with the direction ray First i-stage spatial cuboids, wherein 1≤i≤n.
Wherein, the number of plies that n is as arranged, such as 20,30 etc..
502, by direction ray i+1 grade spatial cuboids corresponding with the first i-stage spatial cuboids into Row asks friendship, determines the first i+1 grade spatial cuboids intersected with the direction ray.
503, judge whether i is less than n, if so, step 504 is executed, if it is not, executing step 505.
504, then i is executed into step 502 from increasing 1.
505, determine that the first n-th grade of spatial cuboids intersected with the direction ray are object space cube.
By step 501~505, during carrying out asking friendship step by step by direction ray and spatial cuboids, not time Go through all spatial cuboids, but by by direction ray and first i-stage spatial cuboids corresponding i+1 grade space cube Body carries out asking friendship, determines the first i+1 grade spatial cuboids intersected with direction ray, it is vertical to finally obtain first n-th grade of space Cube is object space cube.By the method, direction ray hands over range to restrain step by step with n grades of asking for spatial cuboids, saves Computing cost is saved, arithmetic speed is improved.
203, according to the central point and the corresponding attribute value of the drafting control for drawing control, determine that being located at the drafting controls Model attributes value within the scope of part.
Specifically, referring to Fig. 6, step 203 includes:
601, it according to the central point for drawing control, determines and draws control range.
Specifically, it can determine according to the outer profile of draw control central point and drafting control and draw control range.
Wherein, by taking brush as an example, brush shape can be customized, such as can be spherical brush, square brush, cone Brush etc..
By taking spherical brush as an example, it is determined that the central point of brush, further according to the spherical radius of brush, so that it may determine brush Range.
By taking square brush as an example, it is determined that the central point of brush, further according to the side length of square, so that it may determine brush Range.
602, all grid vertexes of the model are traversed, determine the grid vertex for being located at and drawing within the scope of control.
By taking triangular mesh as an example, there are three grid vertexes for each grid tool.It, can be with by traversing all grids of model Obtain the grid vertex of model.Further according to control range is drawn, the grid top for being located at and drawing within the scope of control may thereby determine that Point.
By taking spherical brush as an example, if grid vertex is greater than the radius of spherical brush at a distance from the centre of sphere, ignore;If Distance is less than the radius of spherical brush, it is determined that the grid vertex is located within the scope of brush.
603, according to the category for drawing the determining grid vertex being located within the scope of the drafting control of the corresponding attribute value of control Property value.
Specifically, step 603 includes: according to the corresponding attribute value of the drafting control, weight coefficient and the grid Product of the vertex at a distance from the central point for drawing control determines the attribute of the grid vertex within the scope of the drafting control Value.
By this step, the central point that distance draws control is closer, and the attribute value of grid vertex is smaller.
By taking color attribute as an example, it can be set that attribute value is smaller, and color is deeper;Attribute value is bigger, and color is more shallow.In this way, Grid vertex is closer with a distance from the central point for drawing control, and color is deeper;Distance is remoter, and color is more shallow.
Certainly, the attribute value for drawing the grid vertex within the scope of control can also be arranged by other means, such as right The attribute value for drawing the grid vertex within the scope of control does not distinguish, and is uniformly set as an attribute value.
604, according to the attribute value of grid vertex, the attribute value of the grid is determined.
By taking triangular mesh as an example, the attribute value needs of the grid are determined according to the attribute value on three vertex.
It is moved at the next position drawing control, re-execute the steps 601~604, realized within the scope of drafting control Model attributes value setting.In this way, user, which only needs first to define, draws the corresponding attribute value of control, mouse control is then operated System draws control actions, it can neatly carries out setting for model attributes value by any position drawn in control Selection Model It sets, to operate freedom degree height, is conducive to quickly handle.
Wherein, attribute value can be a variety of, such as attribute value may include: color value, it is weight value, bone weighted value, hard One of angle value is a variety of.
By taking color value as an example, the method for the present embodiment can be used for the editor of model color;
By taking weight value as an example, in 3D cloth system, the attribute that cloth can be arranged with control is drawn, such as cloth are light Weight degree;
By taking bone weighted value as an example, in 3D animation system, the bone weight for drawing control setting animation can be used, such as The amplitude weight that grid vertex deviates in movement.
Furthermore it is also possible to by the drafting of the color value to grid vertex so that attribute value can by color value come into Row identification.By taking a person model as an example, silk is indicated with blue, and color is more blue, indicates that silk is more soft;Gold is indicated with red Belong to the armor, color is redder, indicates that the armor is harder.
It is then possible to indicate these speciality with color value on grid vertex by drawing control, but actually use When, the meaning that these color values just have other special, this is meant that can be by using the user for drawing control to make by oneself Justice.Such as: the hardness range that can define the armor is red=0 between 0~100, indicates that armor hardness is 0, red=255, table Show that armor hardness is 100.
The method of model setting provided by the present application will by determining direction ray according to selected point and virtual camera The first intersection point of direction ray and model according to the central point for drawing control and draws control pair as the central point for drawing control The attribute value answered determines the model attributes value for being located at and drawing within the scope of control, so as to by drawing in control Selection Model Any position carry out model attributes value setting, compared with prior art, it is easy to operate efficiently.
Below by taking the color attribute of model is configured as an example, the method for the model setting of the present embodiment is carried out schematic Explanation.Referring to Fig. 7, the embodiment of the present application also discloses a kind of method of model color setting, comprising:
701, it is instructed according to the input that mouse generates and determines selected point, mesh is determined according to the selected point and virtual camera Mark ray.
It 702, is multiple grids by the model partition, according to grid protocol multistage spatial cuboids, wherein i-stage is empty Between cube include at least two i+1 grade spatial cuboids, and i is positive integer more than or equal to 1;
703, the direction ray and i-stage spatial cuboids are carried out asking friendship, what determination was intersected with the direction ray First i-stage spatial cuboids;Wherein, 1≤i≤n.
704, by direction ray i+1 grade spatial cuboids corresponding with the first i-stage spatial cuboids into Row asks friendship, determines the first i+1 grade spatial cuboids intersected with the direction ray.
705, judge whether i is less than n, if so, step 706 is executed, if it is not, executing step 707.
706, then i is executed into step 704 from increasing 1.
707, determine that the first n-th grade of spatial cuboids intersected with direction ray are object space cube.
708, each grid in object space cube is asked into friendship with the direction ray, obtains the first and target The grid of ray intersection.
709, the intersection point for determining the direction ray Yu the grid, using the intersection point as the central point of brush.
710, according to the central point of brush, brush range is determined.
711, all grid vertexes of the model are traversed, determine the grid vertex being located within the scope of brush.
712, the color value for the grid vertex being located within the scope of the brush is determined according to the corresponding color value of brush.
713, according to the color value of grid vertex, the color value of the grid is determined.
It should be noted that each grid vertex has an initial value.For a grid, it is with triangular mesh Example, if only one grid vertex is located within the scope of brush and is changed color value, for the grid, needs root The color value of grid is determined according to the color value of three grid vertexes.
The color value of grid can be one, and solid color, such as red, blue etc. is presented in corresponding grid;
The color value of grid may be it is multiple, a kind of color of gradual change is presented in corresponding grid.The color of the gradual change by System renders generation according to the color value of grid vertex automatically.
The method of model color setting provided by the present application, by determining that target is penetrated according to selected point and virtual camera Line, using the first intersection point of direction ray and model as the central point of brush, according to the central point of brush and the corresponding face of brush Color value determines the model color being located within the scope of brush, so as to carry out mould by any position in brush Selection Model The setting of type color, it is compared with prior art, easy to operate efficient.
The device that the embodiment of the present application also discloses a kind of model setting is used in virtual scene, the void referring to Fig. 8 Quasi- scene setting has virtual camera, and described device includes:
Ray determining module 801, is configured as being instructed according to input and determines selected point, takes the photograph according to the selected point and virtually Camera determines direction ray;
Central point determining module 802 is configured to determine that the first intersection point of the direction ray and model, will be described first Intersection point is as the central point for drawing control;
Model attributes value determining module 803 is configured as corresponding according to the central point and the drafting control of drawing control Attribute value, determine be located at it is described drafting control within the scope of model attributes value.
Optionally, the ray determining module 801 is specifically configured to: the input instruction generated according to mouse, which determines, to be chosen Point.
Optionally, the central point determining module 802 is specifically configured to:
It is multiple grids by the model partition, according to grid protocol multistage spatial cuboids, wherein i-stage space is vertical Cube includes at least two i+1 grade spatial cuboids, and i is the positive integer more than or equal to 1;
The direction ray and the spatial cuboids are carried out asking friendship step by step, determines and first intersects with the direction ray The smallest spatial cuboids of rank be object space cube;
Each grid in the object space cube is asked into friendship with the direction ray, obtains the first and target The grid of ray intersection;
Determine the intersection point of the direction ray Yu the grid.
Optionally, the central point determining module 802 is specifically configured to:
First seeks friendship module, is configured as carrying out the direction ray and i-stage spatial cuboids to ask friendship, determining and institute State the first i-stage spatial cuboids of direction ray intersection;Wherein, 1≤i≤n;
Second seeks friendship module, is configured as the direction ray and the first i-stage spatial cuboids corresponding i-th + 1 grade of spatial cuboids carries out asking friendship, determines the first i+1 grade spatial cuboids intersected with the direction ray;
Judgment module is configured as judging whether i is less than n, if so, executing from module is increased, if it is not, executing determining module;
From module is increased, it is configured as i then executing second from increasing 1 and seeking friendship module;
Determining module is configured to determine that the first n-th grade of spatial cuboids intersected with the direction ray are target empty Between cube.
Optionally, the central point determining module 802 is specifically configured to: obtaining the target by predefined function The intersecting point coordinate of ray and the grid.
Optionally, central point determining module 802 is specifically configured to:
According to the central point for drawing control, determines and draw control range;
All grid vertexes of the model are traversed, determine the grid vertex for being located at and drawing within the scope of control;
It is located at the attribute value for drawing the grid vertex within the scope of control according to drawing the corresponding attribute value of control and determining;
According to the attribute value of grid vertex, the attribute value of the grid is determined.
Optionally, central point determining module 802 is specifically configured to: according to the corresponding attribute value of the drafting control, power The product of weight coefficient and the grid vertex at a distance from the central point for drawing control, determines the drafting control range The attribute value of interior grid vertex.
Wherein, attribute value includes: one of color value, weight value, bone weighted value, hardness number or a variety of.
The device of model setting provided by the present application will by determining direction ray according to selected point and virtual camera The first intersection point of direction ray and model according to the central point for drawing control and draws control pair as the central point for drawing control The attribute value answered determines the model attributes value for being located at and drawing within the scope of control, so as to by drawing in control Selection Model Any position carry out model attributes value setting, compared with prior art, it is easy to operate efficiently.
The exemplary scheme for the device that a kind of above-mentioned model for the present embodiment is arranged.It should be noted that the device The technical solution for the method that technical solution and above-mentioned model are arranged belongs to same design, and the technical solution of described device is not detailed The detail content of description may refer to the description of the technical solution of the method for above-mentioned model setting.
One embodiment of the application also provides a kind of computer readable storage medium, is stored with computer instruction, the instruction The step of method of model setting as previously described is realized when being executed by processor.
A kind of exemplary scheme of above-mentioned computer readable storage medium for the present embodiment.It should be noted that this is deposited The technical solution for the method that the technical solution of storage media and above-mentioned model are arranged belongs to same design, the technical side of storage medium The detail content that case is not described in detail may refer to the description of the technical solution of the method for above-mentioned model setting.
The computer instruction includes computer program code, the computer program code can for source code form, Object identification code form, executable file or certain intermediate forms etc..The computer-readable medium may include: that can carry institute State any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, the computer storage of computer program code Device, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), Electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the computer-readable medium include it is interior Increase and decrease appropriate can be carried out according to the requirement made laws in jurisdiction with patent practice by holding, such as in certain jurisdictions of courts Area does not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium.
It should be noted that for the various method embodiments described above, describing for simplicity, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because According to the application, certain steps can use other sequences or carry out simultaneously.Secondly, those skilled in the art should also know It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules might not all be this Shen It please be necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiments.
The application preferred embodiment disclosed above is only intended to help to illustrate the application.There is no detailed for alternative embodiment All details are described, are not limited the invention to the specific embodiments described.Obviously, according to the content of this specification, It can make many modifications and variations.These embodiments are chosen and specifically described to this specification, is in order to preferably explain the application Principle and practical application, so that skilled artisan be enable to better understand and utilize the application.The application is only It is limited by claims and its full scope and equivalent.

Claims (18)

1. a kind of method of model setting, which is characterized in that in virtual scene, the virtual scene to be provided with virtual camera shooting Machine, which comprises
It is instructed according to input and determines selected point, direction ray is determined according to the selected point and virtual camera;
The first intersection point for determining the direction ray and model, using the first intersection point as the central point for drawing control;
According to the central point and the corresponding attribute value of the drafting control for drawing control, determines and be located within the scope of the drafting control Model attributes value.
2. the method as described in claim 1, which is characterized in that instructed according to input and determine selected point, comprising: raw according to mouse At input instruct determine selected point.
3. the method as described in claim 1, which is characterized in that determine the first intersection point of the direction ray and model, comprising:
It is multiple grids by the model partition, according to grid protocol multistage spatial cuboids, wherein i-stage spatial cuboids Including at least two i+1 grade spatial cuboids, and i is the positive integer more than or equal to 1;
It carries out the direction ray and the spatial cuboids to ask friendship step by step, determines the first grade intersected with the direction ray Not the smallest spatial cuboids are object space cube;
Each grid in the object space cube is asked into friendship with the direction ray, obtains the first and direction ray The grid of intersection;
Determine the intersection point of the direction ray Yu the grid.
4. method as claimed in claim 3, which is characterized in that carry out the direction ray step by step with the spatial cuboids Friendship is asked, determines that the first the smallest spatial cuboids of the rank intersected with the direction ray are object space cube, comprising:
S1, the direction ray and i-stage spatial cuboids ask friendship, determine first the intersected with the direction ray I grades of spatial cuboids;Wherein, 1≤i≤n;
S2, direction ray i+1 grade spatial cuboids corresponding with the first i-stage spatial cuboids are asked It hands over, determines the first i+1 grade spatial cuboids intersected with the direction ray;
S3, judge whether i is less than n, if so, step S4 is executed, if it is not, executing step S5;
S4, i is increased 1 certainly, then executes step S2;
First n-th grade of spatial cuboids that S5, determination are intersected with the direction ray are object space cube.
5. method as claimed in claim 3, which is characterized in that determine the intersection point of the direction ray Yu the grid, comprising:
The intersecting point coordinate of the direction ray Yu the grid is obtained by predefined function.
6. method as claimed in claim 3, which is characterized in that corresponding according to the central point and the drafting control of drawing control Attribute value, determine be located at it is described drafting control within the scope of model attributes value, comprising:
According to the central point for drawing control, determines and draw control range;
All grid vertexes of the model are traversed, determine the grid vertex for being located at and drawing within the scope of control;
It is located at the attribute value for drawing the grid vertex within the scope of control according to drawing the corresponding attribute value of control and determining;
According to the attribute value of grid vertex, the attribute value of the grid is determined.
7. method as claimed in claim 6, which is characterized in that be located at described draw according to drawing the corresponding attribute value of control and determining The attribute value of grid vertex within the scope of control processed, comprising:
According to the corresponding attribute value of the drafting control, weight coefficient and the grid vertex and the center for drawing control The product of the distance of point determines the attribute value of the grid vertex within the scope of the drafting control.
8. the method as described in claim 1 or 6 or 7, which is characterized in that the attribute value includes: color value, weight value, bone One of bone weighted value, hardness number are a variety of.
9. a kind of device of model setting, which is characterized in that in virtual scene, the virtual scene to be provided with virtual camera shooting Machine, described device include:
Ray determining module is configured as instructing determining selected point according to input, true according to the selected point and virtual camera Set the goal ray;
Central point determining module is configured to determine that the first intersection point of the direction ray and model, and the first intersection point is made For the central point for drawing control;
Model attributes value determining module is configured as according to the central point and the corresponding attribute of the drafting control for drawing control Value determines the model attributes value being located within the scope of the drafting control.
10. device as claimed in claim 9, which is characterized in that the ray determining module is specifically configured to: according to mouse The input of generation, which instructs, determines selected point.
11. device as claimed in claim 9, which is characterized in that the central point determining module is specifically configured to:
It is multiple grids by the model partition, according to grid protocol multistage spatial cuboids, wherein i-stage spatial cuboids Including at least two i+1 grade spatial cuboids, and i is the positive integer more than or equal to 1;
It carries out the direction ray and the spatial cuboids to ask friendship step by step, determines the first grade intersected with the direction ray Not the smallest spatial cuboids are object space cube;
Each grid in the object space cube is asked into friendship with the direction ray, obtains the first and direction ray The grid of intersection;
Determine the intersection point of the direction ray Yu the grid.
12. device as claimed in claim 11, which is characterized in that the central point determining module is specifically configured to:
First seeks friendship module, is configured as carrying out the direction ray and i-stage spatial cuboids to ask friendship, the determining and mesh Mark the first i-stage spatial cuboids of ray intersection;Wherein, 1≤i≤n;
Second seeks friendship module, is configured as direction ray i+1 grade corresponding with the first i-stage spatial cuboids Spatial cuboids carry out asking friendship, determine the first i+1 grade spatial cuboids intersected with the direction ray;
Judgment module is configured as judging whether i is less than n, if so, executing from module is increased, if it is not, executing determining module;
From module is increased, it is configured as i then executing second from increasing 1 and seeking friendship module;
Determining module is configured to determine that the first n-th grade of spatial cuboids intersected with the direction ray are vertical for object space Cube.
13. device as claimed in claim 11, which is characterized in that the central point determining module is specifically configured to: being passed through Predefined function obtains the intersecting point coordinate of the direction ray Yu the grid.
14. device as claimed in claim 11, which is characterized in that the central point determining module is specifically configured to:
According to the central point for drawing control, determines and draw control range;
All grid vertexes of the model are traversed, determine the grid vertex for being located at and drawing within the scope of control;
It is located at the attribute value for drawing the grid vertex within the scope of control according to drawing the corresponding attribute value of control and determining;
According to the attribute value of grid vertex, the attribute value of the grid is determined.
15. device as claimed in claim 14, which is characterized in that the central point determining module is specifically configured to: according to The corresponding attribute value of control, weight coefficient and the grid vertex drawn is at a distance from the central point for drawing control Product, determine it is described drafting control within the scope of grid vertex attribute value.
16. the device as described in claim 9 or 14 or 15, which is characterized in that the attribute value include: color value, weight value, One of bone weighted value, hardness number are a variety of.
17. a kind of calculating equipment including memory, processor and stores the calculating that can be run on a memory and on a processor Machine instruction, which is characterized in that the processor realizes the step of claim 1-8 any one the method when executing described instruction Suddenly.
18. a kind of computer readable storage medium, is stored with computer instruction, which is characterized in that the instruction is held by processor The step of claim 1-8 any one the method is realized when row.
CN201910305736.2A 2019-04-16 2019-04-16 Model setting method and device, computing equipment and storage medium Active CN109903384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910305736.2A CN109903384B (en) 2019-04-16 2019-04-16 Model setting method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910305736.2A CN109903384B (en) 2019-04-16 2019-04-16 Model setting method and device, computing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109903384A true CN109903384A (en) 2019-06-18
CN109903384B CN109903384B (en) 2023-12-26

Family

ID=66955951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910305736.2A Active CN109903384B (en) 2019-04-16 2019-04-16 Model setting method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109903384B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113838164A (en) * 2021-08-18 2021-12-24 北京商询科技有限公司 Grid drawing method and device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030132934A1 (en) * 2001-12-12 2003-07-17 Technoguide As Three dimensional geological model construction
CN101789083A (en) * 2008-10-30 2010-07-28 奥多比公司 Actual real-time simulation of brush behaviour
CN103903293A (en) * 2012-12-27 2014-07-02 腾讯科技(深圳)有限公司 Generation method and device for brush-stroke-feel art image
CN104123747A (en) * 2014-07-17 2014-10-29 北京毛豆科技有限公司 Method and system for multimode touch three-dimensional modeling
CN107085862A (en) * 2017-05-19 2017-08-22 东华大学 A kind of stereo clipping method of three-dimensional virtual garment
CN107093200A (en) * 2017-03-29 2017-08-25 珠海金山网络游戏科技有限公司 A kind of method of Skeletal Skinned Animation surface mesh additional model

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030132934A1 (en) * 2001-12-12 2003-07-17 Technoguide As Three dimensional geological model construction
CN101789083A (en) * 2008-10-30 2010-07-28 奥多比公司 Actual real-time simulation of brush behaviour
CN103903293A (en) * 2012-12-27 2014-07-02 腾讯科技(深圳)有限公司 Generation method and device for brush-stroke-feel art image
CN104123747A (en) * 2014-07-17 2014-10-29 北京毛豆科技有限公司 Method and system for multimode touch three-dimensional modeling
CN107093200A (en) * 2017-03-29 2017-08-25 珠海金山网络游戏科技有限公司 A kind of method of Skeletal Skinned Animation surface mesh additional model
CN107085862A (en) * 2017-05-19 2017-08-22 东华大学 A kind of stereo clipping method of three-dimensional virtual garment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
潘德吉 等: "基于DEM栅格数据结构的三维空间点交互选取方法", 《测绘科学》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113838164A (en) * 2021-08-18 2021-12-24 北京商询科技有限公司 Grid drawing method and device and storage medium

Also Published As

Publication number Publication date
CN109903384B (en) 2023-12-26

Similar Documents

Publication Publication Date Title
CN101930627B (en) Three-dimensional dwelling size modeling method based on two-dimensional dwelling size diagram
Schreiner et al. High-quality extraction of isosurfaces from regular and irregular grids
CN108961369A (en) The method and apparatus for generating 3D animation
CN111369428B (en) Virtual head portrait generation method and device
CN107844800A (en) Determination system, the method and device of a kind of optimal sagittal plain of full vertebra
CN109429519A (en) System and method for verifying the authenticity of certificate photograph
CN109949693B (en) Map drawing method and device, computing equipment and storage medium
CN110097609A (en) A kind of fining embroidery texture moving method based on sample territory
CN108550107A (en) A kind of image processing method, picture processing unit and mobile terminal
CN112288665A (en) Image fusion method and device, storage medium and electronic equipment
CN115049799B (en) Method and device for generating 3D model and virtual image
CN111292427B (en) Bone displacement information acquisition method, device, equipment and storage medium
CN107392085A (en) The method for visualizing convolutional neural networks
CN107229966A (en) A kind of model data update method, apparatus and system
CN106156067B (en) For creating the method and system of data model for relation data
EP4277261A1 (en) Video generation method and apparatus, and device and readable storage medium
CN105574914A (en) Manufacturing device and manufacturing method of 3D dynamic scene
CN112619154A (en) Processing method and device of virtual model and electronic device
CN112221145A (en) Game face model generation method and device, storage medium and electronic equipment
CN109903384A (en) A kind of method and device, calculating equipment and the storage medium of model setting
CN108805095A (en) image processing method, device, mobile terminal and computer readable storage medium
CN110310357A (en) A kind of model interts processing method, device, calculates equipment and storage medium
CN110310352A (en) A kind of role action edit methods and device calculate equipment and storage medium
CN107103646B (en) Expression synthesis method and device
CN108932704A (en) Image processing method, picture processing unit and terminal device

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant after: Zhuhai Jinshan Digital Network Technology Co.,Ltd.

Applicant after: Zhuhai Xishanju Digital Technology Co.,Ltd.

Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

Applicant before: ZHUHAI SEASUN MOBILE GAME TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant