ICAX上对运动仿真动画的讨论很热烈,我们这个论坛是不是也应该讨论一下。受ICAX的启发或者说是学人家的,做了一个曲柄连杆动画。<img src="attachments/dvbbs/20038241044193039.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onclick="if(!this.resized) {return true;} else {window.open(\'attachments/dvbbs/20038241044193039.gif\');}" onmousewheel="return imgzoom(this);" alt="" />
我也是跟人家学的,写教程岂不是班门弄斧,就贴张图,说说关键点吧。关键是几个约束,动画只有一个,即曲柄的高度方向旋转动画,要注意的是施加旋转动画时必须把锚点移动到旋转轴上。尺寸约束和贴合约束都必须有才能保证动作正确。<img src="attachments/dvbbs/20038259173022701.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onclick="if(!this.resized) {return true;} else {window.open(\'attachments/dvbbs/20038259173022701.jpg\');}" onmousewheel="return imgzoom(this);" alt="" />
只用了三个约束,没有用贴合
<img src="attachments/dvbbs/20038291524497927.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onclick="if(!this.resized) {return true;} else {window.open(\'attachments/dvbbs/20038291524497927.gif\');}" onmousewheel="return imgzoom(this);" alt="" />