markdown 能够在一个方向上连续移动3D小部件,并停止移动

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 能够在一个方向上连续移动3D小部件,并停止移动相关的知识,希望对你有一定的参考价值。

var timerId = -1;
var timingInterval = 30; //frequency at which position of widget is updated

//starts moving the model forward
$scope.moveForward = function() {
    timerId = setInterval(function () {
      $scope.$apply(function () {     
        $scope.view.wdg[__studioIDofWidget__]['x'] -= .01;
        });
    }, timingInterval);
}

//stops the position from being updated
$scope.stop = function() {
clearInterval(timerId);
}
![](https://thumbs.gfycat.com/IndolentNiftyCicada-size_restricted.gif)
![](https://i.imgur.com/N50eWl4.png)

以上是关于markdown 能够在一个方向上连续移动3D小部件,并停止移动的主要内容,如果未能解决你的问题,请参考以下文章