Update: CC - SpoonLib - Mouse Up (abw1ga2etc.js) 216 bytes modified

beta.r3js.org
-=yb4f310 2018-01-16 14:30:56 +01:00
parent 81ac351bef
commit cf95162762
1 changed files with 22 additions and 9 deletions

View File

@ -11,23 +11,36 @@ if (!this.initialized) {
this.initialized = true;
}
var currentRotation = this.cylinder.rotation.x;
this.animationSystem.start();
var offset = currentRotation / 0.4488;
var currentRotation = this.cylinder.rotation.x;
var integer = Math.floor(offset);
console.log('current rotation: ' + currentRotation);
var remainder = offset - integer;
var remainder = currentRotation % 0.4488;
if (remainder > 0.5) {
this.cylinder.rotation.x = (integer + 1) * 0.4488 * 2 - 0.4488;
if (remainder > (0.4488 / 2)) {
this.cylinder.rotation.x += remainder;
} else {
this.cylinder.rotation.x = (integer) * 0.4488 * 2 - 0.4488;
this.cylinder.rotation.x -= 0.4488 - remainder;
}
console.log('offset:' + offset + ', remainder: ' + remainder);
//var offset = currentRotation / 0.4488;
//var integer = Math.floor(offset);
//if (remainder > 0.5) {
// this.cylinder.rotation.x = (integer + 1) * 0.4488 * 2 - 0.4488;
//} else {
// this.cylinder.rotation.x = (integer) * 0.4488 * 2 - 0.4488;
//}
//console.log('offset:' + offset + ', remainder: ' + remainder);