目次

楕円運動

斜めに楕円運動

この内容を表示するためには Adobe Flash Plugin が必要です。

<?xml version="1.0" encoding="UTF-8"?>
<canvas proxied="false" bgcolor="0xeeeeee"> 
<view x="150" y="150">
  <view bgcolor="blue" width="20" height="20" 
    x="${(Math.cos(radAngle)*Math.cos(radDegree)*rLong) - (Math.sin(radAngle)*Math.sin(radDegree)*rShort)}"
    y="${(Math.cos(radAngle)*Math.sin(radDegree)*rLong) + (Math.sin(radAngle)*Math.cos(radDegree)*rShort)}">
    <attribute name="rLong" value="120"/><!--長いほうの半径-->
    <attribute name="rShort" value="50"/><!--短いほうの半径-->
    <attribute name="degree" value="45"/><!--楕円の傾斜角度-->
    <attribute name="angle"/><!--角度-->
    <attribute name="radDegree" value="${Math.PI/180*(degree)}"/><!--傾斜角度をラジアンに変換-->
    <attribute name="radAngle" value="${Math.PI/180*angle}"/><!--角度をラジアンに変換-->
    <animator attribute="angle" from="0" to="360" duration="1000" motion="linear" repeat="Infinity"/>
  </view>
</view>
</canvas>

奥行きのある3Dもどき楕円運動

この内容を表示するためには Adobe Flash Plugin が必要です。

<?xml version="1.0" encoding="UTF-8"?>
<canvas proxied="false" bgcolor="0xeeeeee"> 
<view x="20" y="20">
  <view bgcolor="#ff0000" width="${this.y/4+20}" height="${this.width}" x="${r+(r*Math.cos(cnt))}" y="${(r+(r*Math.sin(cnt)))/5}"
      opacity="${this.y/200+0.4}">
    <attribute name="cnt"/>
    <attribute name="r" value="200"/>
    <animator attribute="cnt" from="0" to="$once{Math.PI * 2}" duration="3000" motion="linear" repeat="Infinity"/>
  </view>
</view>
</canvas>