Is there a way to modify the standard Three.js resize code so that the scene scales with the DOM element's width as it does with the height? Currently, the scene scales in relation to the element's height, but when the width decreases, the model gets cropped by the element. How can I ensure that the scene scales proportionally with both the element's width and height?
window.onresize = function(event) {
camera.aspect = $(threeContainer).width() / $(threeContainer).height();
camera.updateProjectionMatrix();
renderer.setSize($(threeContainer).width(), $(threeContainer).height());
};