1、画几个齿轮,大小随意,齿数对应,并按咬合关系调整好位置
2、分别复制三、五个(因为齿轮的齿间距是相同的,所以动画起来,仅需几帧即可实现360度旋转效果,但帧数越多,动画越细腻),在每层上调整角度,使其与下一个齿距咬合,每一个咬合做一个图层。
3、打开动画面板,将图层转换为帧,设置时间,导出动画。
Const PI As Single = 3.1415926
Dim t As Single, r As Single
Private Sub Command1_Click()
t = PI / 20
r = Me.Picture1.ScaleHeight / 2 * 4 / 5
Me.Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Static i As Long
Me.Text1.Text = i + 1
'Me.Picture1.PSet (Me.Picture1.ScaleWidth / 2 + r * Cos(i * t), Me.Picture1.ScaleHeight / 2 - r * Sin(i * t)), vbRed
'Me.Picture1.PSet (Me.Picture1.ScaleWidth / 2 + (r + 100) * Cos(i * t + t / 2), Me.Picture1.ScaleHeight / 2 - (r + 100) * Sin(i * t + t / 2)), vbRed
Me.Picture1.Line (Me.Picture1.ScaleWidth / 2 + r * Cos(i * t), Me.Picture1.ScaleHeight / 2 - r * Sin(i * t))-(Me.Picture1.ScaleWidth / 2 + (r + 100) * Cos(i * t + t / 2), Me.Picture1.ScaleHeight / 2 - (r + 100) * Sin(i * t + t / 2))
Me.Picture1.Line (Me.Picture1.ScaleWidth / 2 + (r + 100) * Cos(i * t + t / 2), Me.Picture1.ScaleHeight / 2 - (r + 100) * Sin(i * t + t / 2))-(Me.Picture1.ScaleWidth / 2 + r * Cos((i + 1) * t), Me.Picture1.ScaleHeight / 2 - r * Sin((i + 1) * t))
i = i + 1
If i >2 * PI / t - 1 Then Me.Timer1.Interval = 0
End Sub
第一系列:0.1;0.12;0.15;0.2;0.25;0.3;0.4;0.5;0.6;0.8;1;1.25;1.5;2;2.5;3;4;5;6;8;10;12;16;20;25;32;40;50第二系列:0.35;0.7;0.9;1.75;2.25;2.75;(3.25);3.5;(3.75);4.5;5.5;(6.5);7;9;(11);14;18;22;28;36;45
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)