How to create movement along a trajectory. A natural way to specify the movement of a point

Special guide layers allow you to define motion paths for animated instances, groups, or text blocks. You can link multiple layers of objects to a single guide layer so that all objects follow the same path. When connected to a guide layer, a regular layer becomes a slave layer.

Rice. 4.12. Snap an object to a path

Let's consider the sequence of actions when creating animation with the movement of an object along a given path:

  1. Let's create motion animation using one of the methods discussed earlier.
  2. When checking the box Orient to Path(Path Orientation) The baseline of a group of animated objects will move parallel to the specified path. To fix the registration point of an object on the trajectory, set the checkbox Snap(Binding).
  3. Execute the command Insert › Motion Guide(Insert › Motion trajectory). Flash creates a new layer above the selected layer with a guide icon to the left of its name.
  4. We use any drawing tool to depict the desired trajectory. In the first frame, we fix the object at the starting point of the line, and in the last frame, at the end of the line, moving the object with the mouse beyond its registration point.
  5. To make the path invisible, click at the intersection of the row of the guide layer and the column marked with the eye icon.


Rice. 4.13. Movement along a given trajectory


Rice. 4.14. Layer Properties Window

To link a layer to an existing guide layer, you can do one of the following:

  • Move the layer with objects under the layer with the guide. All animated objects on it are automatically snapped to the path, as indicated by shifting the layer name to the right.
  • Create a new layer under the guide layer. Objects placed on this layer to which animation will be applied using the frame calculation method (tweened), are automatically attached to the trajectory.
  • Select the layer below the guide layer and execute the command Modify › Layer Guided(Managed) for layer type in the dialog box Layer Properties(Layer properties).
  • Click on a layer while holding down the key ALT.

To unlink a layer from a guide layer, do one of the following:

  • Select the layer whose link you want to break and drag it above the guide layer.
  • Run the command Modify › Layer(Edit › Layer) with a choice of value Normal(Normal) for layer type in window Layer Properties(Layer properties).
  • Click on the layer while holding down the key ALT.

Make flash videos with motion animation, but this movement was in a straight line. Now it’s time to figure out how to move along a given trajectory. To set the trajectory, we need an additional layer.

Open Macromedia Flash Professional 8 program, and create a new document in it. Layers are created on the timeline by clicking an icon Insert Layer(insert layer). To create a new layer, you can also select from the menu Insert - Timeline - Layer . This creates a regular layer. You may have already done this when you created without a trajectory.

But now you need a guide layer. It is created using an icon Add Motion Guide(add motion guide), or using the menu Insert - Timeline - Add Motion Guide . Create it, it will appear on your timeline above the main layer. If the guide layer is lower, it will not work. In this case, you need to drag it up with the mouse.

In the main layer, select the first frame from which the motion animation will begin, and if it is not the key frame, make it the key frame using the menu Insert - Timeline - Keyframe (or by right-clicking on it and selecting Insert Keyframe). Place an object on this frame. This could be an imported picture, a group of objects, or text. If you import an image, first prepare it in a graphics editor, and then in Macromedia Flash program select from menu File - Import - Import to Stage . If the object is drawn, then group it using the menu Modify — Convert into Symbol .

Then select the last frame on the main layer that will end the motion animation, and make this frame the key frame. In this frame, you drag the object to the final position where it will be at the end of the motion animation.

Select the first frame in the guide layer, if it is not a key one, make it a key one, and place a motion path on it: select the first key frame in the guide layer, and create a path with any tools that create a line. It can be a broken line, a curve, part of a circle, and so on.

After that, select the first frame and drag the object to the starting point of the path. The object at the starting point should be fixed. You will see how it will be attracted to the starting point - the contours of the object will become bolder.

In order for an object to be attracted in Macromedia Flash Professional 8, in the menu View - Snapping items must be included Snap to Guides(grip along guides) and Snap to Objects(capture by objects). Also check if the item is enabled Snap Align(alignment grip). Although the last point does not affect the attraction of an object to the trajectory, it is still better to include it too.

Now go Macromedia Flash program to the final frame. Select it in the guide layer and select it from the menu Insert - Timeline - Frame . An ordinary frame, not a key frame, will be added (to add, you can also right-click on the frame and select Insert Frame). Thus, you will have a key frame on the final frame in the main layer, and a simple frame in the guide layer.

After that, in the last frame, pull the object to the end point of the path. Next, do motion animation in Macromedia Flash: select some intermediate frame between the start and end, and in the panel Properties choose from the list Tween(filling frames) item Motion(movement). If you want the object to rotate in the direction of the trajectory, and not just move, turn on the item in the property panel Orient to Path(if you don’t see this property, click on the white triangle in the lower right corner of the property panel).

Also in the properties panel in Macromedia Flash Professional 8 you can add the following properties for your motion animation:

Scale(scale): When enabled, if the size or shape of an object in the start or end keyframes is changed, the change will occur smoothly during the motion tween.

Ease(deceleration): used when you need to speed up or slow down movement. To apply the option, move the slider up or down, or enter numbers from −100 to 100 in the box.

Rotate(rotation): objects rotate clockwise or counterclockwise when moving. The number of rotations of the object during the motion animation is written in the window.

Assignment: make a flash video with animation of movement along a trajectory. Here's what I got:

In this flash video, I used, in addition to motion animation (ship), also (words) and (waves).

Video on how to make motion animation along a trajectory in Macromedia Flash Professional 8

You can get more detailed information in the “All Courses” and “Utilities” sections, which can be accessed through the top menu of the site. In these sections, articles are grouped by topic into blocks containing the most detailed (as far as possible) information on various topics.

You can also subscribe to the blog and learn about all new articles.
It won't take long. Just click on the link below:

s = s(t), (10)

Where s- arc coordinate measured from the selected origin on the trajectory. Sign s determined in accordance with the selected direction of arc counting.

When specifying the motion of a point in a natural way, its speed is found using the formula

where is the unit tangent vector directed towards increasing values ​​of the arc coordinate s.

The speed of a point as an algebraic quantity is determined by the formula

At v> 0 the point moves in the direction of increasing ones, and when v < 0 - в сторону убывающих значений s.

If dependency is known v = v(t), then the arc coordinate is found using the formula

, (13)

Where s 0 - arc coordinate value at t= 0.

If the origin of the arcs coincides with the initial position of the point, then s 0 = 0, and then

Since a moving point can change the direction of movement along the trajectory, then the path σ traversed by a point during a period of time (0, t), is defined as the sum of the lengths of the arcs of individual sections, on each of which the speed v retains its sign.

Thus,

σ = |s 1 -s 0 | + |s 2 -s 1 | + ... + |s - s n |. (15)

Where s 1 , s 2 , .... s p- arc coordinate values ​​at moments of time t 1 , t 2 ,…t n, at which speed v changes its sign.

Example 1. An inextensible cable is unwound from a stationary drum with a radius R, remaining in a tense state all the time (Fig. 20). Determine the equation of motion along the trajectory of the rope point located on the drum at the initial moment of time, if the angle φ , defining the position of the radius drawn to the point N cable release, specified as an increasing function of time ( φ > 0).

Solution. Let's draw the axis Oh through the center of the drum and the initial position of the point in question

Rice. 20 M u. Due to the inextensibility of the cable, the length of the wound end is equal to the length of the corresponding arc of the drum, i.e. NM == Rφ.

From the picture we find

X=ON cos φ + N.M. sin φ = Rcos φ + R φ sin φ ;

y = - ON sin φ + N.M. cos φ = - R sin φ - cos φ .

When winding the cable, the angle φ = φ (t), therefore, these equations are equations of motion of a point M.

Let's find the projections of the point's velocity onto the selected axes:

hence,

.

Considering that φ = 0, s= 0 at t= 0, using formula (14) we find

.

If instead φ substitute a known function φ = φ (t), That

i.e., we obtain the equation of motion of a point along a trajectory.

Example 2. The movement of a point along a trajectory is given by the equation (s - in meters, t- in seconds). Determine arc coordinate value s at the moment t= 15 s and way σ , passed by the point in the first 15 s.

Solution. Let's determine the speed of the point

.

Let's find moments in time t 1 , t 2,..., at which the speed of the point changes its sign:



,

where tn+1 = (-l) n+6n With ( n= 0;1; 2; ...).

Consequently, during the first 15 s the speed changes its sign at the moments of time: t 1 = l s, t 2 = 5 s, t 3 = 13 s.

Let us determine the values ​​of the arc coordinate s at these moments in time, as well as at the moment

t 0 = 0 and at the moment t 4 = 15 s:

s 0 = 12 m;

m;

m;

m;

m.

Using formula (15), we find the path traveled by the point in the first 15 s:

П = |π+6√З-l2| + |5π-6√3-π-6√3| + |13π+6√3-5π+6√3 | +

+|15π-13π-6√3| = 59.7 m.

Example 3. Determine the equation of motion of a point along a trajectory if its equations of motion are given in Cartesian coordinates:

X = A(2cos t+ cos 2 t),y = a(2sin t- sin 2 t), 0 ≤ t ≤.

The arc coordinate is counted from the initial position of the point in the direction of the initial movement.

Solution. The given equations are parametric equations of a hypocycloid, i.e., a line described by a point on a circle with a radius A, rolling inside a circle of radius 3 A, and t equal to the angle of rotation of the line of centers from its initial position.

To determine s we'll find v(t):

= - 2A(sin t+ sin 2 t),

2a(cos t- cos 2 t),

from here .

Note that the value v(t) is always positive, since the point does not change the direction of its movement. This follows from the above interpretation of the movement. This can be verified analytically by considering the change in angle φ , formed by the radius vector of a point with the abscissa axis:

tg φ = x/y; φ = arc tan x/y,

The denominator and numerator are always positive, since

.

Thus, the point always moves in one direction ( φ increases) and the speed retains a constant sign, which coincides with its original sign:

.

For s( t) we get

.

This integral cannot be calculated in elementary functions (for an arbitrary t). Let's calculate it by sections.

Then s(t)= .

In particular, when t= 2π/3

s =(2π/3) = 16 a/3.

Apply this formula for large t it is forbidden. For example, when t = 4π /3 it would lead to a ridiculous result s= 0. When , .



.

1.2.1.* Determine the equation of motion of a point along a trajectory, as well as the value of the arc coordinate s and the path traveled σ by the time t= 5s if its speed v given by the equation:

1) v=10 cm/s;

2) v= 2 cm/s (0 ≤ t≤ 3);

v= (5 - t) cm/s(3 ≤ t≤ 5);

3) v =(2t+ 1) cm/s;

4) v= (3 - t) cm/s;

5) v= cm/s;

6) cm/s;

7) cm/s;

8) v =(t 2 - 3t+ 2) cm/s.

Answers:

1) s= 10t cm; s| t=5c = 50 cm; σ | t=5c = 50 cm;

2) s= 2t cm (0 ≤ t≤ 3); s= (5t- - 4.5) cm (3 ≤ t≤ 5);

s| t=5c = 8 cm; σ| t=5 c = 8 cm;

3) s= (t 2 +t) cm; s| t=5c = 30 cm; σ| t=5c = 30 cm;

4)s=(3t- ) cm; s| t=5c = 2.5 cm; σ| t=5c = 6.5 cm;

5) s= (1- cos ) cm; s| t=5c = cm; σ| t=5c = 2 cm;

6) s= (3t+ sin ) cm; s| t=5c = 15 cm; σ| t=5c = 15cm;

7) s= (πt+5 sin ) cm; s| t=5c = 5 π cm;

σ| t=5c = cm;

8)s= cm; s| t=5c = cm; σ| t=5c = cm.

1.2.2.* Determine the equation of motion of a point along a trajectory if the equations of its motion are given in Cartesian coordinates. Arc coordinate s count from the initial position of the point in the direction of the initial movement:

1.2.3 .* Wheel radius R rolls without sliding on a horizontal rail at the speed of the center . Determine the equation of motion along the trajectory of the wheel rim point, which was at the initial moment at the point of contact with the rail. What is the distance s i will the point travel along the trajectory from the beginning of the movement to the highest position?

Answer: s= 8R sin 2 ; s i = 4R. Expression for s only fair until the moment t =, at which s = 8R. After that you need to calculate s the same as in example 3.

1.2.4. s= 15 + 4 sin πt. Indicate the nearest time after the start of movement t 1, at which s 1 =17 m (0.167)

1.2.5. The point moves along a trajectory according to the equation s = 0,5t 2 + 4t. Determine at what point in time the speed of the point reaches 10 m/s. (6)

1.2.6. The point moves along a given trajectory with speed v = 5 m/s. Determine Curvilinear Coordinate s points at a time t= 18 s, if at

t 0 = 0 coordinate s 0 = 26 m (116)

1.2.7 . The point moves along a curve with speed v= 0,5 t. Determine its coordinate at the moment of time t = 10 s, if at t 0 = 0 point coordinate s 0 = 0. (25)

Trajectory(from Late Latin trajectories - related to movement) is the line along which a body (material point) moves. The trajectory of movement can be straight (the body moves in one direction) and curved, that is, mechanical movement can be rectilinear and curvilinear.

Straight-line trajectory in this coordinate system it is a straight line. For example, we can assume that the trajectory of a car on a flat road without turns is straight.

Curvilinear movement is the movement of bodies in a circle, ellipse, parabola or hyperbola. An example of curvilinear motion is the movement of a point on the wheel of a moving car or the movement of a car in a turn.

The movement can be difficult. For example, the trajectory of a body at the beginning of its journey can be rectilinear, then curved. For example, at the beginning of the journey a car moves along a straight road, and then the road begins to “wind” and the car begins to move in a curved direction.

Path

Path is the length of the trajectory. Path is a scalar quantity and is measured in meters (m) in the SI system. Path calculation is performed in many physics problems. Some examples will be discussed later in this tutorial.

Move vector

Move vector(or just moving) is a directed straight line segment connecting the initial position of the body with its subsequent position (Fig. 1.1). Displacement is a vector quantity. The displacement vector is directed from the starting point of movement to the ending point.

Motion vector module(that is, the length of the segment that connects the starting and ending points of the movement) can be equal to the distance traveled or less than the distance traveled. But the magnitude of the displacement vector can never be greater than the distance traveled.

The magnitude of the displacement vector is equal to the distance traveled when the path coincides with the trajectory (see sections and ), for example, if a car moves from point A to point B along a straight road. The magnitude of the displacement vector is less than the distance traveled when a material point moves along a curved path (Fig. 1.1).

Rice. 1.1. Displacement vector and distance traveled.

In Fig. 1.1:

Another example. If the car drives in a circle once, it turns out that the point at which the movement begins will coincide with the point at which the movement ends, and then the displacement vector will be equal to zero, and the distance traveled will be equal to the length of the circle. Thus, path and movement are two different concepts.

Vector addition rule

The displacement vectors are added geometrically according to the vector addition rule (triangle rule or parallelogram rule, see Fig. 1.2).

Rice. 1.2. Addition of displacement vectors.

Figure 1.2 shows the rules for adding vectors S1 and S2:

a) Addition according to the triangle rule
b) Addition according to the parallelogram rule

Motion vector projections

When solving problems in physics, projections of the displacement vector onto coordinate axes are often used. Projections of the displacement vector onto the coordinate axes can be expressed through the differences in the coordinates of its end and beginning. For example, if a material point moves from point A to point B, then the displacement vector (see Fig. 1.3).

Let us choose the OX axis so that the vector lies in the same plane with this axis. Let's lower the perpendiculars from points A and B (from the starting and ending points of the displacement vector) until they intersect with the OX axis. Thus, we obtain the projections of points A and B onto the X axis. Let us denote the projections of points A and B, respectively, as A x and B x. The length of the segment A x B x on the OX axis is displacement vector projection on the OX axis, that is

S x = A x B x

IMPORTANT!
I remind you for those who do not know mathematics very well: do not confuse a vector with the projection of a vector onto any axis (for example, S x). A vector is always indicated by a letter or several letters, above which there is an arrow. In some electronic documents, the arrow is not placed, as this may cause difficulties when creating an electronic document. In such cases, be guided by the content of the article, where the word “vector” may be written next to the letter or in some other way they indicate to you that this is a vector, and not just a segment.

Rice. 1.3. Projection of the displacement vector.

The projection of the displacement vector onto the OX axis is equal to the difference between the coordinates of the end and beginning of the vector, that is

S x = x – x 0

The projections of the displacement vector on the OY and OZ axes are determined and written similarly:

S y = y – y 0 S z = z – z 0

Here x 0 , y 0 , z 0 are the initial coordinates, or the coordinates of the initial position of the body (material point); x, y, z - final coordinates, or coordinates of the subsequent position of the body (material point).

The projection of the displacement vector is considered positive if the direction of the vector and the direction of the coordinate axis coincide (as in Fig. 1.3). If the direction of the vector and the direction of the coordinate axis do not coincide (opposite), then the projection of the vector is negative (Fig. 1.4).

If the displacement vector is parallel to the axis, then the modulus of its projection is equal to the modulus of the Vector itself. If the displacement vector is perpendicular to the axis, then the modulus of its projection is equal to zero (Fig. 1.4).

Rice. 1.4. Motion vector projection modules.

The difference between the subsequent and initial values ​​of some quantity is called the change in this quantity. That is, the projection of the displacement vector onto the coordinate axis is equal to the change in the corresponding coordinate. For example, for the case when the body moves perpendicular to the X axis (Fig. 1.4), it turns out that the body DOES NOT MOVE relative to the X axis. That is, the movement of the body along the X axis is zero.

Let's consider an example of body motion on a plane. The initial position of the body is point A with coordinates x 0 and y 0, that is, A(x 0, y 0). The final position of the body is point B with coordinates x and y, that is, B(x, y). Let's find the modulus of body displacement.

From points A and B we lower perpendiculars to the coordinate axes OX and OY (Fig. 1.5).

Rice. 1.5. Movement of a body on a plane.

Let us determine the projections of the displacement vector on the OX and OY axes:

S x = x – x 0 S y = y – y 0

In Fig. 1.5 it is clear that triangle ABC is a right triangle. It follows from this that when solving the problem one can use Pythagorean theorem, with which you can find the module of the displacement vector, since

AC = s x CB = s y

According to the Pythagorean theorem

S 2 = S x 2 + S y 2

Where can you find the module of the displacement vector, that is, the length of the body’s path from point A to point B:

And finally, I suggest you consolidate your knowledge and calculate a few examples at your discretion. To do this, enter some numbers in the coordinate fields and click the CALCULATE button. Your browser must support the execution of JavaScript scripts and script execution must be enabled in your browser settings, otherwise the calculation will not be performed. In real numbers, the integer and fractional parts must be separated by a dot, for example, 10.5.

Animation of movement along a given trajectory is carried out using a special guide layer . It is placed directly above the layer in which the animated object is located.

Example 1. Create an animation of an apple falling from a tower along a curved path


By clicking the button with the icon under the list of layers, we will add a layer of the Guide type directly above the “apple” layer, which becomes the driven layer
Select the 20th frame in three layers and convert it to the F6 key.

Select an instance of the “apple” symbol using the Arrow tool and, by moving it with the left mouse button pressed, connect it to the beginning (in the 1st frame) and the end (in the 20th frame) of the guide line. Snapping to the line is facilitated by activating the magnet modifier. Let's increase the size of the apple in the 20th frame Select any intermediate frame of the “apple” layer and autofill the frames (menu Insert - Create double motion). Let's look at the sequence of frames. To orient a moving object relative to the guide curve, on the property panel, select the Direction checkbox. ways. Let's save the work under the name tower.fla. Let's test the animation.

Example 2. Create an animation of the moon rotating

around the Earth with a period of 3 s.

Importing starry sky images
(sky.jpg), Earth (zem.gif) and the moon (luna.gif)

into different layers. Let's turn the image of the Moon into

Above the “moon” layer, add a guide layer on which we will draw a trajectory (an oval with the fill turned off). Using an eraser, we will remove a small fragment of the closed orbit to ensure reference to the beginning and end of the trajectory.

Select the 36th frame in all layers and turn it into a key frame.

Let's bind the moon to the beginning and end of the trajectory and autofill frames in the "moon" layer.

4. Physical education is performed to relieve tension.


5. To consolidate the studied material, students are asked to implement the considered examples on a computer.

Additional tasks:

Create animations using the suggested samples:

1. The balloon rises up. The clouds in the foreground are moving horizontally.

2. Two cars are moving towards each other against the backdrop of motionless trees

3. The ball moves along the created trajectory.

4. The ship moves horizontally and rocks on the waves

5. Leaves fall and are oriented along curved paths.



6. The lesson is summarized. Comments are made and marks are given. The issues that caused the greatest difficulties during the completion of the tasks are explained.

Questions:

1. List the stages of creating animation of several movements.

2. How are key frames placed?

3. What is meant by animation of movement along a trajectory?

4. List the stages of creating path animation

5. How is the motion path created?

Homework: §17-18, questions