Giter VIP home page Giter VIP logo

zzwaterwave's Introduction

ZZWaterWave

实现思路

  1. 定义一个View,并增加圆形或者自定义背景视图
  2. 画出静态正弦函数
  3. 遮罩,mask层
  4. 定时器,不断的改变路径上的各个点,让波浪动起来

iOS运行效果图

波浪效果图

难点

三角函数:假设 y = Asin(ωx+φ)+ C

A 表示振幅,也就是使用这个变量来调整波浪的最大的高度 ω 与周期相关,周期 T = 2 x pi / ω 即这个变量用来调整同宽度内显示的波浪的数量 φ 表示波浪横向的偏移,也就是使用这个变量来调整波浪的流动 C 表示波浪纵向偏移的位置。

如果你的三角函数还给了敬爱的老师,我在网上大概找了一下比较详细的教程可以参考下:

详细过程请参考简书:【iOS】绘画波浪篇

zzwaterwave's People

Contributors

zhouxiaor avatar

Stargazers

 avatar ShenYj avatar Duke avatar Yikai avatar  avatar  avatar  avatar 李扬 avatar kaitoulee avatar 静持大师 avatar  avatar zenggang avatar Zampono avatar tommyz avatar  avatar  avatar MWCao avatar

Watchers

 avatar

Forkers

tommyz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.