Search code examples
javascriptcssthree.jsfullscreen

Three-JS - Fullscreen change Size of renderer


I have made an ThreeJS application which is build to run in a 4:3 layout (there are many of buttons and so on). I would like to allow using Fullscreen via THREEx.Fullscreen.js. The Fullscreen mode is working, the problem I run into is, that the renderer.size(x,y) is changed into the screen size. Which is in my case a 16:9 layout.

So the question is, how to run ThreeJS fullscreen but still keep the renderer size?


Solution

  • Make the display property of your canvas element as

    canvas{
    display: block;
    }