首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Bezier点动画

Bezier点动画
EN

Stack Overflow用户
提问于 2016-02-07 09:31:56
回答 1查看 437关注 0票数 0

我需要很多不同的路径来动画幻灯片图片。动画将在Bezier曲线定义的点上进行。但我没有找到任何画廊或这条路的例子。第二种方法是以点转换SVG路径,但如何实现?沿途有现成的动画画廊吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-13 19:57:43

这是一个起点。这是直接从用于SVG animateMotion函数的Mozilla网络站点复制的。

代码语言:javascript
复制
<svg width="120" height="120"  viewBox="0 0 120 120"
     xmlns="http://www.w3.org/2000/svg" version="1.1"
     xmlns:xlink="http://www.w3.org/1999/xlink" >

    <!-- Draw the outline of the motion path in grey, along
         with 2 small circles at key points -->
    <path d="M10,110 A120,120 -45 0,1 110 10 A120,120 -45 0,1 10,110"
          stroke="lightgrey" stroke-width="2" 
          fill="none" id="theMotionPath"/>
    <circle cx="10" cy="110" r="3" fill="lightgrey"  />
    <circle cx="110" cy="10" r="3" fill="lightgrey"  />

    <!-- Here is a red circle which will be moved along the motion path. -->
    <circle cx="" cy="" r="5" fill="red">

        <!-- Define the motion path animation -->
        <animateMotion dur="6s" repeatCount="indefinite">
           <mpath xlink:href="#theMotionPath"/>
        </animateMotion>
    </circle>
</svg>

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35251830

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档