How can I calculate canvas size based on its container? To avoid scrolling.
If I set the size based on window the canvas is too big.
Advertisement
Answer
Well,that’s not difficult.Set your render’s size will work.
container = document.getElementById('container'); renderer.setSize($(container).width(), $(container).height()); container.appendChild(renderer.domElement);