E
E
Eugene2017-10-08 13:00:19
JavaScript
Eugene, 2017-10-08 13:00:19

How and through what can svg be morphed following the mouse cursor?

Good afternoon. Interested in solving such a problem:
There is a semi-oval, while it is made on svg, and then we'll see. When you hover over the mouse, a plugin is activated that will morph the svg when the cursor position changes, up to a certain aisle, after which the semi-oval will return to its original position.
So far, all the plugins that I have found work with two variants of svg: source and destination.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Mudrenok, 2017-10-08
@mudrenokanton

Usually such things are written on canvas, a bit too much math in 1 frame for dom objects.
But in general, all plugins should work the same way. They take shape before and after. You are required to calculate in the required time interval only the shape after. In fact, when moving with the mouse, you drag the nearest 1-3 vertices, you can change their coordinates.
I would probably calculate the shape in the maximum stretch strictly along the axis 1 time, and then rotate it after the cursor with the desired stretch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question