Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/2272/head
zouap 3 years ago
parent
commit
1e70e25352
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      custom/public/rotation3D/rotation3D.js

+ 6
- 5
custom/public/rotation3D/rotation3D.js View File

@@ -235,7 +235,7 @@ Rotation3D.prototype.lineStyle = function($line, index, rotation) {
Rotation3D.prototype.goTo = function (index) { Rotation3D.prototype.goTo = function (index) {
var self = this; var self = this;
this.currenIndex = index; this.currenIndex = index;
console.log('currenIndex', index);
console.log('goTo currenIndex', index);
/** /**
* 1.计算floatIndex,用于控死amdiff * 1.计算floatIndex,用于控死amdiff
*/ */
@@ -293,7 +293,7 @@ Rotation3D.prototype.scheduleNextFrame = function () {
*/ */
Rotation3D.prototype.render = function () { Rotation3D.prototype.render = function () {
var self=this; var self=this;
console.log("render....");
// 图形间隔:弧度 // 图形间隔:弧度
var spacing = 2 * Math.PI / this.$item.length; var spacing = 2 * Math.PI / this.$item.length;
var itemRotation = this.rotation; var itemRotation = this.rotation;
@@ -319,6 +319,7 @@ Rotation3D.prototype.onAutoPlay = function () {
if (self.currenIndex < 0) { if (self.currenIndex < 0) {
self.currenIndex = self.length - 1 self.currenIndex = self.length - 1
} }
console.log("autoPlayTimer....");
self.goTo(self.currenIndex); self.goTo(self.currenIndex);
self.currenIndex--; //倒叙 self.currenIndex--; //倒叙
}, this.autoPlayDelay) }, this.autoPlayDelay)
@@ -330,12 +331,12 @@ Rotation3D.prototype.onAutoPlay = function () {
Rotation3D.prototype.onDrag = function () { Rotation3D.prototype.onDrag = function () {
var self = this; var self = this;
var startX, startY, moveX, moveY, endX, endY; var startX, startY, moveX, moveY, endX, endY;
console.log("onDrag....");
// 拖拽:三个事件-按下 移动 抬起 // 拖拽:三个事件-按下 移动 抬起
//按下 //按下
this.$rotation.mousedown(function (e) { this.$rotation.mousedown(function (e) {
startX = e.pageX; startY = e.pageY; startX = e.pageX; startY = e.pageY;
console.log("mousedown....");
// 移动 // 移动
$(document).mousemove(function (e) { $(document).mousemove(function (e) {
// console.log('移动'); // console.log('移动');
@@ -347,7 +348,7 @@ Rotation3D.prototype.onDrag = function () {
$(document).mouseup(function (e) { $(document).mouseup(function (e) {
endX = e.pageX; endY = e.pageY; endX = e.pageX; endY = e.pageY;
moveX = endX - startX; moveY = endY - startY; moveX = endX - startX; moveY = endY - startY;
console.log("mouseup....");
// 每40旋转一步 // 每40旋转一步
var moveIndex = parseInt(Math.abs(moveX) / 50) var moveIndex = parseInt(Math.abs(moveX) / 50)
console.log('moveIndex',moveIndex) console.log('moveIndex',moveIndex)


Loading…
Cancel
Save