Summary of the invention
In view of this, this specification embodiment provides a kind of swing effect simulation system, method, calculates equipment and storageMedium, to solve technological deficiency existing in the prior art.
On the one hand, this specification embodiment discloses a kind of swing effect simulation system, comprising: the first editing machine, coloringDevice and the second editing machine;
First editing machine be configured as importing in destination virtual scene to simulation model, the mould to be simulated is setThe fulcrum of type;
The tinter is configured as obtaining the fulcrum coordinate of the fulcrum, determines the fulcrum according to the fulcrum coordinateWith the interaction angle to corresponding pixel points on simulation model, the top to simulation model is generated according to the interactive anglePoint animation;
First editing machine is additionally configured to swing parameter to simulation model described in setting, and the swing parameter is sentTo tinter;
The tinter is additionally configured to obtain the swing parameter and according to the swing parameter to the vertex animationSwing effect rendered, after being rendered to simulation model position of the fulcrum running parameter, rotation angle running parameterAnd amplitude of fluctuation running parameter, and the position of the fulcrum running parameter, rotation angle running parameter and amplitude of fluctuation variation are joinedNumber is sent to the second editing machine;
Second editing machine is configured as according to the position of the fulcrum running parameter, rotation angle running parameter and pendulumDynamic amplitude running parameter renders swing effect to simulation model for described.
It optionally, include simulation wind-force parameter or interaction parameter to the swing parameter of simulation model.
Optionally, simulation wind-force parameter includes:
Global wind factor, itself coefficient of disturbance, itself stiffness coefficient, the coefficient of disturbance for responding global wind-force, response are completeThe stiffness coefficient of office's wind disturbance, the coefficient of rotary for responding global wind-force, the amplitude of fluctuation coefficient of the global rotation of response and rotationAngle limit coefficient;
The overall situation wind factor includes: wind-force, wind direction, wind frequency.
Optionally, interaction parameter includes: the size and Orientation of stress when simulation model is touched.
Optionally, the first editing machine is also configured to
In response to user to described to model import operation performed by simulation model;To simulation model and general described in parsingIt is described to be divided at least two subregions to simulation model, obtain the material to each subregion of simulation model;According to it is described toThe material of each subregion of simulation model, selects corresponding material from the Materials Library pre-established;The corresponding material is addedIt is downloaded to described to simulation model to generate in each subregion of simulation model.
Optionally, the first editing machine is also configured to that fulcrum respectively is arranged to each subregion in simulation model.
On the other hand, this specification embodiment discloses a kind of swing effect simulation method, comprising:
Imported in the first editing machine in destination virtual scene to simulation model, the setting branch to simulation modelPoint;
The fulcrum coordinate that the fulcrum is obtained by tinter, according to the fulcrum coordinate determine the fulcrum and it is described toThe interaction angle of corresponding pixel points on simulation model generates the vertex animation to simulation model according to the interactive angle;
By the first editing machine setting swing parameter to simulation model, the swing parameter is sent to coloringDevice;
The swing parameter is obtained by the tinter and according to the swing for swinging parameter to the vertex animationEffect is rendered, the position of the fulcrum running parameter, rotation angle running parameter and swing to simulation model after being renderedAmplitude running parameter, and the position of the fulcrum running parameter, rotation angle running parameter and amplitude of fluctuation running parameter are sentTo the second editing machine;
Second editing machine changes according to the position of the fulcrum running parameter, rotation angle running parameter and amplitude of fluctuationParameter renders swing effect to simulation model for described.
It optionally, include simulation wind-force parameter or interaction parameter to the swing parameter of simulation model.
Optionally, simulation wind-force parameter includes:
Global wind factor, itself coefficient of disturbance, itself stiffness coefficient, the coefficient of disturbance for responding global wind-force, response are completeThe stiffness coefficient of office's wind disturbance, the coefficient of rotary for responding global wind-force, the amplitude of fluctuation coefficient of the global rotation of response and rotationAngle limit coefficient;
The overall situation wind factor includes: wind-force, wind direction, wind frequency.
Optionally, interaction parameter includes: the size and Orientation of stress when simulation model is touched.
Optionally, imported in the first editing machine in destination virtual scene to simulation model, the mould to be simulated is setThe fulcrum of type includes:
In response to user to described to model import operation performed by simulation model;
Parsing is described to be divided at least two subregions to simulation model to simulation model and by described, obtains described wait simulateThe material of each subregion of model;
According to the material to each subregion of simulation model, corresponding material is selected from the Materials Library pre-established;
The corresponding material is loaded into described to simulation model to generate in each subregion of simulation model.
Optionally, after generation is described to simulation model, further includes: be respectively to each subregion setting in simulation modelFulcrum.
On the other hand, this specification embodiment discloses a kind of calculating equipment, including memory, processor and is stored inOn reservoir and the computer instruction that can run on a processor, the processor is realized when executing described instruction swings effect simulationThe step of method.
On the other hand, this specification embodiment discloses a kind of computer readable storage medium, is stored with computer and refers toIt enables, which is executed by processor the step of swinging effect simulation method.
A kind of swing effect simulation system, method, calculating equipment and the storage medium that this specification provides, pass through tinterEffect is swung to the wind-engaging of object to be simulated with editing machine and interaction effect is simulated, so that object is with the wind in virtual sceneMovement effects and reciprocal motion effect are more life-like, more naturally, the game experiencing of player can be effectively improved.
Specific embodiment
Many details are explained in the following description in order to fully understand this specification.But this specification energyEnough to be implemented with being much different from other way described herein, those skilled in the art can be without prejudice to this specification intensionIn the case where do similar popularization, therefore this specification 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 claimsThe "an" of singular used in book, " described " and "the" are also intended to including most forms, unless context is clearlyIndicate other meanings.It is also understood that term "and/or" used in this specification one or more embodiment refers to and includesOne 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 embodimentVarious 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 otherIt 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 embodimentsAs, 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 the present specification, a kind of swing effect simulation system, method, a kind of calculating equipment and storage medium are provided,It is described in detail one by one in the following embodiments.
Fig. 1 shows a kind of swing effect simulation system structure diagram provided according to one embodiment of this specification, packetIt includes: the first editing machine 102, tinter 104 and the second editing machine 106.
First editing machine 102, be configured as importing in destination virtual scene to simulation model, the mould to be simulated is setThe fulcrum of type.
It include tree modelling, embossing die type and careless model to simulation model in one or more embodiment provided by the inventionDeng.
By taking tree-model as an example, the first editing machine is configured as responding user when user sends the request for importing tree-modelModel import operation, parse the tree-model, be classified as three branch, trunk and leaf subregions, then obtain three pointsThe material in area selects corresponding material from the Materials Library pre-established, and material is loaded into each corresponding subregion, generatesThe tree-model is that fulcrum is arranged in each subregion of tree-model, and fulcrum coordinate is inserted in corresponding model.
Tinter 104, is configured as obtaining the fulcrum coordinate of the fulcrum, determines the fulcrum according to the fulcrum coordinateWith the interaction angle to corresponding pixel points on simulation model, the top to simulation model is generated according to the interactive anglePoint animation.
In one or more embodiment provided by the invention, still by taking tree-model as an example, tinter is configured as obtaining tree mouldThe fulcrum coordinate of each fulcrum in type, pixel between fulcrum line segment 1 and tree-model root node to 2 shape of line segment between fulcrumAt angle be pixel interaction angle, interaction angle schematic diagram as shown in Fig. 2, tinter can wash with watercolours according to the interaction angleDye obtains the vertex animation of tree-model.
First editing machine 102 is additionally configured to swing parameter to simulation model described in setting, by the swing parameterIt is sent to tinter.
It is provided by the invention one or more embodiment in, model swing effect influence factor have simulation wind-force parameter andInteraction parameter, simulation wind-force parameter include: global wind factor, itself coefficient of disturbance, itself stiffness coefficient, respond global wind-forceCoefficient of disturbance, respond global wind disturbance stiffness coefficient, respond global wind-force coefficient of rotary, the global rotation of response pendulumDynamic range coefficient and/or rotation angle limit coefficient;Wherein global wind factor includes: wind-force, wind direction and/or wind frequency.InteractionParameter includes: the size and Orientation of stress when simulation model is touched.
In one or more embodiment provided by the invention, the value range of wind-force is [0,100], the value range of wind frequencyIt is gentle breeze state when wind-force value is [0,25], wind frequency value is [0,3] for [0,10];When wind-force value be [26,60],Wind frequency value is strong wind state when being [4,6];It is blast state when wind-force value is [61,85], wind frequency value is [7,9].
The tinter 104 is additionally configured to obtain the swing parameter and according to the swing parameter to the vertexThe swing effect of animation is rendered, the position of the fulcrum running parameter to simulation model, rotation angle change after being renderedParameter and amplitude of fluctuation running parameter, and the position of the fulcrum running parameter, rotation angle running parameter and amplitude of fluctuation are becomeChange parameter and is sent to the second editing machine.
In one or more embodiment provided by the invention, tinter is configured as treating simulation model according to swing parameterSwing effect rendered, swinging parameter is simulation wind-force parameter or interaction parameter.
Second editing machine 106 is configured as according to the position of the fulcrum running parameter, rotation angle running parameter and swingAmplitude running parameter renders swing effect to simulation model for described.
In practical application, the second editing machine can be Material Editor.
In one or more embodiment provided by the invention, by tinter and Material Editor to the pendulum of object to be simulatedDynamic effect carries out simulation rendering, so that the effect is more real and naturally, can effectively improve object for appreciation for the swing of object in scene of gameThe game experiencing of family.
Fig. 3 is to show the structural block diagram of the calculating equipment 300 according to one embodiment of this specification.The calculating equipment 300Component include but is not limited to memory 310 and processor 320.Processor 320 is connected with memory 310 by bus 330.
Calculating equipment 300 further includes access device 340, and access device 340 may include wired or wireless any typeOne or more of network interface (for example, network interface card (NIC)), such as IEEE802.11 WLAN (WLAN)Wireless interface, worldwide interoperability for microwave accesses (Wi-MAX) interface, Ethernet interface, universal serial bus (USB) interface, Cellular NetworksNetwork 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. 3 of equipment 300 are calculatedPart 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. 3 merely for the sake ofExemplary purpose, rather than the limitation to this specification range.Those skilled in the art can according to need, and increases or replaces itHis component.
Calculating equipment 300 can be any kind of static or mobile computing device, including mobile computer or mobile meterCalculate equipment (for example, tablet computer, personal digital assistant, laptop computer, notebook computer, net book etc.), movementPhone (for example, smart phone), wearable calculating equipment (for example, smartwatch, intelligent glasses etc.) or other kinds of shiftingDynamic equipment, or the static calculating equipment of such as desktop computer or PC.Calculating equipment 300 can also be mobile or state typeServer.
Wherein, processor 320 can execute the step in method shown in Fig. 4.Fig. 4 is shown to be implemented according to this specification oneA kind of swing effect simulation method flow diagram that example provides, including step 402 is to step 410.
Step 402, imported in the first editing machine in destination virtual scene to simulation model, the mould to be simulated is setThe fulcrum of type.
In one embodiment provided by the invention, step 402 can be realized by step as described in Figure 5, including step502 to step 506.
Step 502, in response to user to described to model import operation performed by simulation model.
At least two subregions are divided into simulation model to simulation model described in step 504, parsing and by described, obtain instituteState the material to each subregion of simulation model.
In one or more embodiments of the invention, to simulation model be tree modelling, flowers and plants model or flag model,By taking flag model as an example, flag model to be simulated can be divided into flagpole and two, flag face subregion, after determining subregion, obtain twoThe material of a subregion.
Step 506, the material according to each subregion of simulation model select to correspond to from the Materials Library pre-establishedMaterial.
The corresponding material is loaded into in each subregion of simulation model, generate the mould to be simulated by step 508Type.
In this specification one or more embodiment, the object that motion state can swing influence in scene of game have trees,The objects such as flowers and plants and/or flag, therefore need to firstly generate trees, flowers and plants and/or flag in the simulation process for swinging effectEqual objects, these objects are the models by creating the expression body form of linear first, and expression is then sticked on modelObject color, self-luminous, opaque etc. indicate what the material of real-world object surface characteristic was formed.
Therefore, object is created in the first editing machine, it is necessary first to generate the model for indicating body form and indicate trueThe material of real object surface characteristic.By the material in preset Materials Library in selection system, the material to simulation model is determined,To generate to simulation model.
Step 404, the fulcrum coordinate that the fulcrum is obtained by tinter determine the fulcrum according to the fulcrum coordinateWith the interaction angle to corresponding pixel points on simulation model, the top to simulation model is generated according to the interactive anglePoint animation.
In one or more embodiments of the invention, fulcrum is configured by user, fills out fulcrum coordinate after fulcrum is arrangedEnter in corresponding model, be still illustrated by taking flag model as an example, tinter obtain flag model a fulcrum coordinate (x,Y) after, using the line segment of the fulcrum coordinate to flag bottom node and fulcrum to the angle of the line segment formation between pixel as interactionAngle, and according to interaction angle pixel is rendered around the vertex animation that the fulcrum rotates, wherein pixel around fulcrum (x,Y) vertex animation rotated can be realized by following code:
V.vertex.x=povitWS.x*cos (angle)-povitWS.y*sin (angle)+povit.x;
V.vertex.y=povitWS.x*sin (angle)+povitWS.y*cos (angle)+povit.y;
Float2povitWS=float2 (v.vertex.x-povit.x, v.vertex.y-povit.y);
Wherein, v.vertex.x indicate model in pixel x-axis coordinate, v.vertex.y indicate model in pixelIn the coordinate of y-axis, povitWS indicates vector of the pixel to corresponding fulcrum, angle expression rotation angle, povit.x in modelModel central bearing point is indicated in the coordinate of x-axis, povit.y indicates model central bearing point in the coordinate of y-axis.
The swing parameter to simulation model is arranged by the first editing machine in step 406, and the swing parameter is sentTo tinter.
In one or more embodiment provided by the invention, swinging parameter includes simulating wind-force parameter and/or interaction parameter,Simulation wind-force parameter includes global wind factor, itself coefficient of disturbance, itself stiffness coefficient, the disturbance system for responding global wind-forceNumber, the stiffness coefficient for responding overall situation wind disturbance, the coefficient of rotary for responding global wind-force, the global amplitude of fluctuation system rotated of responseNumber and/or rotation angle limit coefficient, wherein global wind factor includes: wind-force, wind direction and/or wind frequency;Interaction parameter includes:The size and Orientation of stress when simulation model is touched.
In one or more embodiment provided by the invention, the value range of wind-force is [0,100], the value range of wind frequencyIt is gentle breeze state when wind-force value is [0,25], wind frequency value is [0,3] for [0,10];When wind-force value be [26,60],Wind frequency value is strong wind state when being [4,6];It is blast state when wind-force value is [61,85], wind frequency value is [7,9].
The size of different parameters and parameter can the swing effect to object to be simulated generate different influences, actually answerIn, different parameters can be selected according to different scenes or the value of parameter is arranged different sizes.
Step 408 is obtained the swing parameter by the tinter and is moved according to the swing parameter to the vertexThe swing effect of picture is rendered, the position of the fulcrum running parameter to simulation model, rotation angle change ginseng after being renderedSeveral and amplitude of fluctuation running parameter, and the position of the fulcrum running parameter, rotation angle running parameter and amplitude of fluctuation are changedParameter is sent to the second editing machine.
In this specification one or more embodiment, tinter is configured as dynamic to generated vertex according to parameter is swungDraw rendered to obtain vertex animation be affected by the wind and/or by reciprocal effect swing effect, in application process, swing parameterType and number can determine that for example, in one embodiment of this specification, rotation angle can be by following according to the actual situationCode is realized:
Angle=_selfDistortion*animation*noise+globalWindFlex+globalWindRotation;
Wherein, angle indicates rotation angle, and selfDistortion indicates that itself coefficient of disturbance, animation indicate topPoint animation, noise indicate that noise, globalWindFlex indicate to respond the stiffness coefficient of global wind disturbance,GlobalWindRotation indicates to respond the coefficient of rotary of global wind-force.
Only used in the above code itself coefficient of disturbance to simulation model, respond the stiffness coefficient of global wind disturbance withAnd the coefficient of rotary of global wind-force is responded, the noise occurred in code is Berlin noise, increases stochastical sampling noise, can make objectThe effect is more real for the swing of body.
Step 410, second editing machine are according to the position of the fulcrum running parameter, rotation angle running parameter and swingAmplitude running parameter renders swing effect to simulation model for described.
In this specification one or more embodiment, wind-engaging effect and interaction effect can be individually present, and can also be deposited simultaneously, according to the actual situation depending on.
In one or more embodiment provided by the invention, by tinter and Material Editor to the pendulum of object to be simulatedDynamic effect carries out simulation rendering, so that the effect is more real and naturally, can effectively improve object for appreciation for the swing of object in scene of gameThe game experiencing of family, increasing random discontinuous random value using the movement that Berlin noise treats simulation model influences, so that pendulumDynamic effect excessively will not be repeated linearly.
Fig. 6 shows a kind of interaction figure of the interaction effect analogy method provided according to one embodiment of this specification, includingStep 602 is to step 616.
Step 602, imported in the first editing machine in destination virtual scene to simulation model, the mould to be simulated is setThe fulcrum of type.
Step 604, tinter obtain the fulcrum coordinate to simulation model.
Step 606, tinter determine the fulcrum and described to respective pixel on simulation model according to the fulcrum coordinateThe interaction angle of point generates the vertex animation to simulation model according to the interactive angle.
The interaction parameter to simulation model is arranged by the first editing machine in step 608, and the interaction parameter is sentTo tinter.
In one or more embodiments of the invention, interaction parameter include when object to be simulated is touched the size of stress andDirection, and speed when stress size is by colliding determines, the range of impact velocity is [0.08,0.15] in the present embodiment.
Step 610 obtains the interaction parameter to simulation model by tinter.
Step 612, tinter are rendered according to swing effect of the interaction parameter to the vertex animation, obtain wash with watercoloursThe position of the fulcrum running parameter to simulation model, rotation angle running parameter and amplitude of fluctuation running parameter after dye, and by instituteIt states position of the fulcrum running parameter, rotation angle running parameter and amplitude of fluctuation running parameter and is sent to the second editing machine.
In one or more embodiments of the invention, by taking character in scene of game is interacted with careless model as an example, firstThe speed that editing machine is arranged when character collides careless model is 0.1, and direction is horizontal direction, collides careless mould according to characterThe swing effect of velocity magnitude and direction opposite vertexes animation when type is rendered, to the branch point of simulation model after being renderedSet running parameter, rotation angle running parameter and amplitude of fluctuation running parameter, and by the position of the fulcrum running parameter, rotation angleDegree running parameter and amplitude of fluctuation running parameter are sent to the second editing machine.
Step 614, the second editing machine obtain the position of the fulcrum running parameter, rotation angle running parameter and amplitude of fluctuationRunning parameter.
Step 616, the second editing machine are according to the position of the fulcrum running parameter, rotation angle running parameter and amplitude of fluctuationRunning parameter renders interaction effect to simulation model for described.
It in one or more embodiments of the invention, is simulated, is increased by the swing effect to object in virtual sceneAuthenticity is added, so that the swing effect of object is more life-like.
One embodiment of the application also provides a kind of calculating equipment, including memory, processor and storage are on a memory simultaneouslyThe computer instruction that can be run on a processor, the processor is realized when executing described instruction swings effect simulation as previously describedThe step of method.One embodiment of the application also provides a kind of computer readable storage medium, is stored with computer instruction, this refers toThe step of swinging effect simulation method as previously described is realized when order is executed by processor.
A kind of exemplary scheme of the above-mentioned computer readable storage medium for the present embodiment of specification.It needs to illustrateIt is that the technical solution of the technical solution of the storage medium and above-mentioned swing effect simulation method belongs to same design, storage is situated betweenThe detail content that the technical solution of matter is not described in detail may refer to retouching for the technical solution of above-mentioned swing effect simulation methodIt states.
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 instituteState any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, the computer storage of computer program codeDevice, 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 interiorIncrease 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 courtsArea 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 ofCombination of actions, but those skilled in the art should understand that, this specification is not limited by the described action sequence, becauseFor according to this specification, certain steps can use other sequences or carry out simultaneously.Secondly, those skilled in the art also shouldKnow, the embodiments described in the specification are all preferred embodiments, and related actions and modules might not all be thisNecessary to specification.
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 embodimentPoint, it may refer to the associated description of other embodiments.
This specification preferred embodiment disclosed above is only intended to help to illustrate this specification.Alternative embodiment is notAll details of detailed descriptionthe, do not limit the invention to the specific embodiments described.Obviously, according in this specificationHold, can make many modifications and variations.These embodiments are chosen and specifically described to this specification, is in order to preferably explain this ShenPrinciple and practical application please, so that skilled artisan be enable to better understand and utilize the application.This explanationBook is limited only by the claims and their full scope and equivalents.