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;
}
});
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