It is cool when you look at a demo and it is resized automatically when you change the dimension of the browser’s window. To switch it fullscreen or such. THREEx.WindowResize is an little piece of code. It helps you do exactly that on your own demos in a single line.
Let’s include the script
You download it from here and include it in your page like this
Let’s use it
Now that the script is included, simply call the following line, and you are done! Your renderer will follow the window size.
As usual you got a
renderer and a
camera variable, just pass
them to the function and they will be updated on window resize.