Animation.rotate3d
解释:从 X 轴顺时针旋转一个角度
方法参数
Number x,Number y,Number z,Number deg
参数说明
同 transform-function rotate3d。
示例
在开发者工具中预览效果
扫码体验
请使用百度APP扫码
图片示例
代码示例
<view class="wrap"> <view class="animation-element-wrapper"> <view class="animation-element" animation="{{animation}}"></view> </view> <view class="card-area"> <view class="top-description border-bottom">展示动画</view> <button type="primary" bindtap="rotate3d">rotate3d</button> </view></view>
Page({ data:{ }, onReady() { this.animation = swan.createAnimation({ transformOrigin: "50% 50%", duration: 1000, timingFunction: "ease", delay: 0 }) }, rotate3d() { this.animation.rotate3d(Math.random() * 720 - 360,Math.random() * 720 - 360,Math.random() * 720 - 360,Math.random() * 720 - 360).step() this.setData({animation: this.animation.export()}) }});
