<canvas id="canvas" width="800" height="400" style="background-color: #000;"></canvas>
<script type="text/javascript">
var canvas=document.getElementById("canvas");
var cxt=canvas.getContext("2d");
var centerX=canvas.width/2;
var centerY=canvas.height/2;
var radiusX=200;
var radiusY=50;
function bg(){
cxt.clearRect(0,0,canvas.width,canvas.height)
for(var i=0;i<Math.PI*2;i+=0.1)
{
cxt.beginPath();
cxt.arc(Math.cos(i)*radiusX+centerX,Math.sin(i)*radiusY+centerY,2,0,Math.PI*2,true);
cxt.fillStyle="#fff";
cxt.fill();
cxt.closePath();
}
}
var ra=0;
function radiu(){
cxt.clearRect(0,0,canvas.width,canvas.height);
bg()
cxt.beginPath();
cxt.fillStyle="#fff";
cxt.arc(Math.cos(ra)*radiusX+centerX,Math.sin(ra)*radiusY+centerY,10,0,Math.PI*2,true)
cxt.fill();
cxt.closePath();
ra+=0.01;
requestAnimationFrame(radiu)
}
radiu()
</script>

最新文章

  1. [LeetCode] Search in Rotated Sorted Array 在旋转有序数组中搜索
  2. poj 2378 (dijkstra)
  3. WCF服务与WCF数据服务的区别
  4. sql遍历树
  5. Repeater控件的分页效果
  6. 2013 Asia Hangzhou Regional Contest
  7. [topcoder]BadNeighbors
  8. android:layout_weight详解
  9. C# 中英文符号互转
  10. CoCos2dx开发:tile地图绘制和Tiled工具的基本使用
  11. go基本语法
  12. Java属性中指定Json的属性名称
  13. 如何通过setTimeout理解JS运行机制详解
  14. poj 2059 单调栈
  15. flashfxp v3.7 注册码
  16. k8s踩坑记第1篇--rc无法创建
  17. Linux 命令find、grep
  18. 我认为比较有用的快捷键(Eclipse)
  19. 关于记录cookie引发的问题
  20. react组件性能

热门文章

  1. 怎样在ZBrush中快速绘制人体躯干
  2. u3d_Shader_effects笔记2 自定义surfaceDiffuseLight
  3. Centos下Tomcat 安装Apache Portable Runtime
  4. noip2008 双栈排序
  5. AI: Jarvis
  6. [py]shell着色
  7. 读书摘要,Hackable Projects
  8. 2013级软件工程GitHub账号信息
  9. OpenCV中的神器Image Watch
  10. 单片机C语言探究--为什么变量最好要赋初值