Summary of the invention
Embodiment of the invention technical matters to be solved is, a kind of control method of animate object motion is provided, and this method may further comprise the steps:
According to one default be that the function calculation of independent variable goes out a curve of being made up of a plurality of points with time, described curve comprises first node and the Section Point that is positioned at described curve two ends;
Obtain the point that at least one coordinate figure of described curve is modified, the point that is modified according to described coordinate figure is revised the shape of described curve;
Obtain an object;
According to a default time span, be mobile route with described object with amended described curve, move to described Section Point from described first node.
Wherein, according to one default be that the function calculation of independent variable goes out a curve of being made up of a plurality of points with time, described curve comprises that the first node that is arranged in described curve two ends and the step of Section Point also comprise following substep:
Obtain the coordinate of first node and Section Point;
According to default be that the function of independent variable is set the described curve between described first node and the described Section Point with time.
After obtaining an object, described according to a default time span, be mobile route with described object with amended described curve, move to before the described Section Point further comprising the steps of from described first node:
Obtain the attribute of described object at described first node and described Section Point;
At the attribute of described first node and described object attribute, the variable quantity of the attribute of described object between described first node and described Section Point is set by default time span according to described object at described Section Point;
Described according to a default time span, be mobile route with described object with amended described curve, the step that moves to described Section Point from described first node comprises:
By default time span described object is moved to described Section Point along amended described curve from described first node, and calculate a plurality of attributes of described object between described first node and described Section Point at the variable quantity of the attribute between described first node and the described Section Point according to described object.
The control method of described animate object motion is further comprising the steps of:
Obtain at least one segmented node on the described curve, described segmented node is provided with the attribute of described object at per two adjacent nodes according to described object in the mode that described first node and described Section Point set a property between described first node and described Section Point.
In at least one segmented node of obtaining on the described curve, described segmented node is between described first node and described Section Point, described object is set with described object in the step of the attribute of per two adjacent nodes in the mode that described first node and described Section Point set a property, at identical move mode between described first node and the described Section Point move mode of described object between per two adjacent nodes is set with described object.
Accordingly, the embodiment of the invention also provides a kind of control system of animate object motion, and this system comprises:
The curve generation module, be used for according to one default be that the function calculation of independent variable goes out a curve of being made up of a plurality of points with time, described curve comprises first node and the Section Point that is positioned at described curve two ends;
Modified module is used to obtain the point that at least one coordinate figure of described curve is modified, and the point that is modified according to described coordinate figure is revised the shape of described curve;
The object acquisition module is used to obtain an object;
Motion module is used for according to a default time span, is mobile route with described object with amended described curve, moves to described Section Point from described first node.
Wherein, described control system also comprises:
The node acquisition module is used to obtain the coordinate of first node and Section Point;
The curve generation module, be used for according to default be that the function of independent variable is set the described curve between described first node and the described Section Point with time.
Described control system also comprises:
Attribute module is used to obtain the attribute of described object at described first node and described Section Point;
Change module, be used for according to described object the variable quantity of the attribute of described object between described first node and described Section Point being set by default time span at the attribute of described first node and described object attribute at described Section Point;
Described motion module also is used for by default time span described object being moved to described Section Point along amended described curve from described first node, and calculates a plurality of attributes of described object between described first node and described Section Point according to described object at the variable quantity of the attribute between described first node and the described Section Point.
Described control system also comprises:
Segmentation module, be used to obtain at least one segmented node on the described curve, described segmented node is provided with the attribute of described object at per two adjacent nodes with described object in the mode that described first node and described Section Point set a property between described first node and described Section Point.
Described segmentation module also is used at identical move mode between described first node and the described Section Point move mode of described object between per two adjacent nodes being set with described object.
The control method of animate object motion provided by the invention can be made an amendment the position of coordinate points in the motion of objects curve, thereby can make animate object according to flexible way motion more, improves the variation and the convenience of animation.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
In embodiments of the present invention, make an amendment, thereby can make animate object, improve the variation and the convenience of animation according to flexible way motion more by the position of coordinate points in the motion of objects curve.
See also Fig. 1 and Fig. 2, be the control method of the animate object of first embodiment provided by the invention motion, this method is used for video editing software.This method comprises step:
Step 101, according to one default be that the function calculation of independent variable goes out a curve L who is made up of a plurality of points with time, described curve L comprises first node A and the Section Point B that is positioned at described curve L two ends.Described function can be obtained by curved line arithmetics such as B-spline curves algorithms.In the present embodiment, described function is the Bezier function of two latitudes, and formula is as follows:
Wherein:
N is an exponent number, the number-1 of exponent number=definite point;
I is the sequence index that expression is had a few, i.e. P
0, P
1, P
2
P represent a little coordinate (x, y);
T express time independent variable, and between 0,1, can equal 0 and 1.
In the present embodiment, can obtain each point coordinate function constantly of described curve L, by the variation of t, just can calculate the described curve L that is combined into a little again by this function.Certainly in other embodiments, described function also can be other two-dimensional curve functions, or the three-dimensional curve function that adopts cubic spline interpolation one class algorithm to obtain.
Step 103 is obtained the point that at least one coordinate figure of described curve L is modified, and the point that is modified according to described coordinate figure is revised the shape of described curve L.In the present embodiment, the position of all coordinate points of described curve L can change by mouse drag, revises the shape of described curve L according to the coordinate of trailing coordinate points.Certainly, in other embodiments, the position of the coordinate points of described curve L also can adopt finger to drag on touch screen to change, or comprises the dialog box of the coordinate figure of the coordinate points that will revise by ejection, the position of revising coordinate by the coordinate figure of revising in the dialog box.In other embodiments, this step can also be calculated the position of coordinate points of unmodified position so that described curve L keeps level and smooth by the smooth curve algorithm.
Step 105 is obtained an object M.But described object M picture, literal or video window.In the present embodiment, choose picture, literal or video window, again picture, literal or video window are written among the described object M by open file dialogs.
Step 107 according to a default time span, is mobile route with described object M with amended described curve L, moves to described Section Point B from described first node A.Described default time span can be set by the software business man, also can be set by the user.In the present embodiment, described default time span is set by the user.Animation in default time span is made up of a plurality of frames, and the centre coordinate of described object M is set to the coordinate of described first node A in first frame, and in the end the centre coordinate of described object M is set to the coordinate of described Section Point B in the frame.Frame per second and the default time span play according to animation calculate frame number, and described frame per second is preestablished by the software business man.Obtain corresponding coordinate points among the described curve L according to each frame with position in all frames, the centre coordinate correspondence with described object M in each frame is revised as coordinate points corresponding among the described curve L.Certainly, also can be that the upper left corner coordinate of described object M or lower right corner coordinate are revised as coordinate points corresponding among the described curve L in other embodiments.
If frame per second was 25 frame/seconds, default time span is 2 seconds.Described first node A is the 0th second, and described Section Point B is the 2nd second, and so described first node A is to there being 50 frames (frame that comprises described first node A and described Section Point B correspondence) between the described Section Point B.The coordinate points (coordinate points that comprises described first node A and described Section Point B) that has 50 correspondences in the coordinate points of described curve L.Be positioned at 2/50 position as the 2nd frame in all frames, when being played to described the 2nd frame, be positioned at the coordinate points at 2/50 place of described default time span in the function of the centre coordinate of described object M with the described curve L of correspondence, promptly t is the coordinate points that generated in 0.04 o'clock.In playing process, the centre coordinate of described object M constantly is revised as the point coordinate value that curve L goes up corresponding each frame, be revised as Section Point B up to the centre coordinate of described object M, thereby generate a animation according to curvilinear motion.
See also Fig. 3, be the control system 100 of the object motion of first embodiment provided by the invention, this system 100 comprises curve generation module 10, modified module 20, object acquisition module 30 and motion module 40.
Described curve generation module 10 be used for according to one default be that the function calculation of independent variable goes out a curve L who is made up of a plurality of points with time, described curve L comprises first node A and the Section Point B that is positioned at described curve L two ends.Described function can be obtained by curved line arithmetics such as B-spline curves algorithms.In the present embodiment, described curve generation module 10 utilizes the Bezier function to obtain each point coordinate function constantly of described curve L, and the variation by t obtains the described curve L that is combined into a little again.
Described modified module 20 is used to obtain the point that at least one coordinate figure of described curve L is modified, and the point that is modified according to described coordinate figure is revised the shape of described curve L.In the present embodiment, the position of the coordinate points of described curve L can change by mouse drag.Certainly, in other embodiments, the position of the coordinate points of described curve L also can adopt finger to drag on touch screen to change, or comprises the dialog box of the coordinate figure of the coordinate points that will revise by ejection, the position of revising coordinate by the coordinate figure of revising in the dialog box.In other embodiments, described modified module 20 can also change the position of coordinate points of unmodified position so that described curve L keeps level and smooth by the smooth curve algorithm.
Described object acquisition module 30 is used to obtain an object M.But described object M picture, literal or video window.In the present embodiment, choose picture, literal or video window, again picture, literal or video window are written among the described object M by open file dialogs.
Described motion module 40 is used for according to a default time span, is mobile route with described object M with amended described curve L, moves to described Section Point B from described first node A.Described default time span can be set by the software business man, also can be set by the user.In the present embodiment, described default time span is set by the user.Animation in default time span is made up of a plurality of frames, and the centre coordinate of described object M is set to the coordinate of described first node A in first frame, and in the end the centre coordinate of described object M is set to the coordinate of described Section Point B in the frame.Frame per second and the default time span play according to animation calculate frame number, and described frame per second is preestablished by the software business man.Obtain coordinate points corresponding among the described curve L according to the position of each frame in all frames, the centre coordinate correspondence with described object M in each frame is revised as coordinate points corresponding among the described curve L
See also Fig. 4 and Fig. 5, the control method that a kind of animate object that provides for second embodiment of the invention moves, this method may further comprise the steps:
Step 401 is obtained the coordinate of first node A1 and Section Point B1.The coordinate of described first node A1 and Section Point B1 can preestablish or obtain two coordinate points that the user clicks screen.
Step 403, according to default be that the function of independent variable is set the described curve L1 between described first node A1 and the described Section Point B1 with time.In the present embodiment, utilize the algorithm identical between described first node A1 and described Section Point B1, to calculate the shape of described curve L1 with described step 101.
Step 405 is obtained the point that at least one coordinate figure of described curve L1 is modified, and the point that is modified according to described coordinate figure is revised the shape of described curve L1.In the present embodiment, described step 405 is identical with described step 103.
Step 409 is obtained an object M1.In the present embodiment, described step 409 is identical with described step 105.
Step 411 is obtained the attribute of described object M1 at described first node A1 and described Section Point B1.Described attribute can be one or several the combination in the attributes such as the anglec of rotation, scaling, transparency.In the present embodiment, it is 1 at the scaling of described first node A1 that the user is provided with described object M1, and the scaling of described Section Point B1 is 2.
Step 413, at the attribute of described first node A1 and described object M1 attribute, the variable quantity of the attribute of described object M1 between described first node A1 and described Section Point B1 is set by default time span according to described object M1 at described Section Point B1.In the present embodiment, the mode of employing linear change is provided with the variable quantity of the attribute of described object M1 between described first node A1 and described Section Point B1.Described default time span can be set by the software business man, also can be set by the user.In the present embodiment, described default time span is set by the user.Animation in default time span is made up of a plurality of frames, the attribute of described object M1 is arranged on the attribute of described first node A1 in first frame, in the end in the frame attribute of described object M1 is arranged on the attribute of described Section Point B1.Frame per second and the default time span play according to animation calculate frame number, and described frame per second is preestablished by the software business man.Obtain the variable quantity of the attribute correspondence of described object M1 according to the position of each frame in all frames, in each frame, the attribute of described object M1 is revised according to variable quantity is corresponding.
If frame per second was 25 frame/seconds, default time span is 2 seconds.Described first node A1 is the 0th second, and described Section Point B1 is the 2nd second, and so described first node A1 is to there being 50 frames (frame that comprises described first node A1 and described Section Point B1 correspondence) between the described Section Point B1.The scaling of described object M1 between described first node A1 and described Section Point B1 is divided into the variable quantity of 49 equal portions.For example, the 2nd frame is positioned at 2/50 position in all frames, and the scaling of the described object M1 of corresponding described the 2nd frame will increase to 1/49+1.
Step 415, by default time span described object M1 is moved to described Section Point B1 along amended described curve L1 from described first node A1, and calculate a plurality of attributes of described object M1 between described first node A1 and described Section Point B1 at the variable quantity of the attribute between described first node A1 and the described Section Point B1 according to described object M1.Described object M1 is moved to the process of described Section Point B1 along described curve L1 from described first node A1 identical with step 107 described first embodiment.The corresponding scaling of described object M1 in each frame of revising when in this step, revising the centre coordinate of described object M1.
Step 417, obtain at least one the segmented node C on the described curve L1, described segmented node C is provided with the attribute of described object M1 at per two adjacent nodes according to described object M1 in the mode that described first node A1 and described Section Point B1 set a property between described first node A1 and described Section Point B1.In the present embodiment, on described curve L1, increase by two segmented node C.Increase the stage that changes by increasing described two segmented node C.Certainly, this step also can be omitted.This step can also be placed between described step 405 and the step 409.Described two segmented node C are the same with described first node A1, Section Point B1 can to set a property.And motion between described first node A1, two segmented node C and each node of Section Point B1 and attribute set adopt with described first node A1 and described Section Point B1 between motion and the identical method of attribute setting.In other embodiments, on described curve L, also can only increase a segmented node C, or increase more a plurality of segmented node C.
See also Fig. 6, the control system 200 that a kind of animate object that provides for second embodiment of the invention moves, this system 200 comprise node acquisition module 110, curve generation module 120, modified module 130, object acquisition module 140, attribute module 150, change module 160 and motion module 170.
Described node acquisition module 110 is used to obtain the coordinate of first node A1 and Section Point B1.The coordinate of described first node A1 and Section Point B1 can preestablish or click setting screen by the user.
Described curve generation module 120 be used for according to default be that the function of independent variable is set the described curve L1 between described first node A1 and the described Section Point B1 with time.In the present embodiment, adopt the method for described step 403 between described first node A1 and described Section Point B1, to define described curve L1.
Described modified module 130 obtains the point that at least one coordinate figure of described curve L1 is modified, and the point that is modified according to described coordinate figure is revised the shape of described curve L1.In the present embodiment, described modified module 130 adopts the method for described step 405 to change the shape of described curve L1.
Described object acquisition module 140 is used to obtain an object M1.In the present embodiment, described object acquisition module 140 adopts the method for described step 409 that an object M1 is provided.
Described attribute module 150 is used to obtain the attribute of described object M1 at described first node A1 and described Section Point B1.Described attribute can be one or several the combination in the attributes such as the anglec of rotation, scaling, transparency.In the present embodiment, it is 1 at the scaling of described first node A1 that described object M1 is set, and is 2 at the scaling of described Section Point B1.
Described variation module 160 is used for according to described object M1 at the attribute of described first node A1 and the described object M1 attribute at described Section Point B1 the variable quantity of the attribute of described object M1 between described first node A1 and described Section Point B1 being set by default time span.In the present embodiment, the mode of employing linear change is provided with the variable quantity of the attribute of described object M1 between described first node A1 and described Section Point B1.Described default time span can be set by the software business man, also can be set by the user.In the present embodiment, described default time span is set by the user.Animation in default time span is made up of a plurality of frames, the attribute of described object M1 is arranged on the attribute of described first node A1 in first frame, in the end in the frame attribute of described object M1 is arranged on the attribute of described Section Point B1.Frame per second and the default time span play according to animation calculate frame number, and described frame per second is preestablished by the software business man.Obtain the variable quantity of the attribute of described object M1 according to the position of each frame in all frames, in each frame, the attribute of described object M1 is revised according to variable quantity is corresponding.
Described motion module 170 is used for by default time span described object M1 being moved to described Section Point B1 along amended described curve L1 from described first node A1, and calculates a plurality of attributes of described object M1 between described first node A1 and described Section Point B1 according to described object M1 at the variable quantity of the attribute between described first node A1 and the described Section Point B1.In the present embodiment, described motion module 170 moves described object M1 according to the method for described step 415 and revises the attribute of described object M1.
Described segmentation module 180 is used to obtain at least one the segmented node C on the described curve L1, described segmented node C is provided with the attribute of described object M1 at per two adjacent nodes according to described object M1 in the mode that described first node A1 and described Section Point B1 set a property between described first node A1 and described Section Point B1.In the present embodiment, on described curve L1, increase by two segmented node C.Increase the stage that changes by increasing described two segmented node C.Certainly, described segmentation module 180 also can omit.Described two segmented node C are the same with described first node A1, Section Point B1 can to set a property.And motion between described first node A1, two segmented node C and each node of Section Point B1 and attribute set adopt with described first node A1 and described Section Point B1 between motion and the identical technology of attribute setting.In other embodiments, on described curve L, also can only increase a segmented node C, or increase more a plurality of segmented node C.
The control method of animate object motion provided by the invention can be made an amendment the position of coordinate points in the motion of objects curve, thereby can make animate object according to flexible way motion more, improves the variation and the convenience of animation.
Above disclosed is a kind of preferred embodiment of the present invention only, can not limit the present invention's interest field certainly with this, and therefore the equivalent variations of doing according to claim of the present invention still belongs to the scope that the present invention is contained.