diff --git a/src/kiri/init.js b/src/kiri/init.js index b721ce2b..b553e514 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1897,6 +1897,7 @@ $('mode-sla').onclick = () => { API.mode.set('SLA') }; $('mode-cam').onclick = () => { API.mode.set('CAM') }; $('mode-laser').onclick = () => { API.mode.set('LASER') }; + // $('unrotate').onclick = () => { API.widgets.for(w => w.unrotate()) }; // add app name hover info $('app-info').innerText = KIRI.version; diff --git a/src/kiri/widget.js b/src/kiri/widget.js index 0fbe6bba..85e4fbec 100644 --- a/src/kiri/widget.js +++ b/src/kiri/widget.js @@ -112,6 +112,7 @@ if (groups.indexOf(this.group) < 0) { groups.push(this.group); } + this.roto = new THREE.Matrix4(); this.mesh = null; this.points = null; // todo resolve use of this vs. mesh.bounds @@ -548,7 +549,8 @@ } else { m4 = m4.makeRotationFromQuaternion(x); } - this.mesh.geometry.applyMatrix4(m4); + this.roto.multiply(m4); + this.mesh.geometry.applyMatrix4(new THREE.Matrix4().getInverse(m4)); if (!temp && euler) { let rot = this.track.rot; rot.x += (x || 0); @@ -557,6 +559,10 @@ } }; + PRO.unrotate = function() { + this.mesh.geometry.applyMatrix4(this.roto); + }; + PRO.mirror = function() { this.group.forEach(w => { w._mirror(); diff --git a/web/kiri/index.css b/web/kiri/index.css index 11f81094..2d475ae5 100644 --- a/web/kiri/index.css +++ b/web/kiri/index.css @@ -424,6 +424,14 @@ th, tr, td { .txt-sel button { background-color: #ccc; } +#pop-rotate .value, #pop-scale .value { + width: 90%; +} +#lock_x, #lock_y, #lock_z { + position: absolute; + left: 2px; + top: 7px; +} #end { left: 0; diff --git a/web/kiri/index.html b/web/kiri/index.html index 7fb59268..a577255b 100644 --- a/web/kiri/index.html +++ b/web/kiri/index.html @@ -149,6 +149,7 @@ +
reset
@@ -156,21 +157,24 @@
-
-
-
+ +
+
+
-
-
-
+ +
+
+
-
-
-
+ +
+
+
-
+