You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to modify the scale of a model in realtime, so I resorted to obj.set({scale: [x, y, z]}) and it does work as long as I don't drag or rotate the model. Otherwise it gets reset to the original value.
To Reproduce
Steps to reproduce the behavior:
Add a model to threebox
Manually override the scale with obj.set() or obj.scale.set()
Drag or rotate the model
Scale gets reset
Expected behavior
Scale should stay as set?
Relevant Code
const step = 0.1;
window.addEventListener('keydown', function (event) {
switch (event.key) {
case '+':
case '=':
// PROBLEM Resets upon moving/rotating
curScale.x += step;
curScale.y += step;
curScale.z += step;
myModel.set({ scale: [curScale.x, curScale.y, curScale.z]});
console.log(curScale);
tb.map.repaint = true;
break;
case '-':
case '_':
curScale.x -= step;
curScale.y -= step;
curScale.z -= step;
myModel.set({ scale: [curScale.x, curScale.y, curScale.z]});
console.log(curScale);
tb.map.repaint = true;
break;
}
});
Version 2.2.7
The text was updated successfully, but these errors were encountered:
Describe the bug
I am trying to modify the scale of a model in realtime, so I resorted to
obj.set({scale: [x, y, z]})
and it does work as long as I don't drag or rotate the model. Otherwise it gets reset to the original value.To Reproduce
Steps to reproduce the behavior:
obj.set()
orobj.scale.set()
Expected behavior
Scale should stay as set?
Relevant Code
The text was updated successfully, but these errors were encountered: