Reputation: 15
I am writing JavaScript with Three.js to use WebGL.
My code calls:
renderer.setSize( 100, 100 );
The window is much larger than that size.
The rendered scene is placed in the top left corner of the window.
I would like it centered.
How can I center the rendered scene?
Upvotes: 0
Views: 832
Reputation: 670
Try this
renderer.setSize( window.innerWidth, window.innerHeight );
Happy Coding :)
Upvotes: 0