News for hackers. Stuff that matters.
Re:Hacking Minecraft into WebGL by wiradikusuma on Wednesday December 21, 2011 @04:10AM (#3376881)
The demo screen doesn't resize on browser resize. I'm using Chrome on Windows 7.
Re:Hacking Minecraft into WebGL by DanielRibeiro on Wednesday December 21, 2011 @04:16AM (#3376896)
Thanks for the feedback. Sorry about that, but it inherits from the fact that none of Three.js' demos resize. This is because doing it is a lot more fun than it looks: not the entire DOM canvas has to be changed, but all the rendering engine behind has to be recreated (camera, scene and so on). I'll see if I can make it work.
Re:Hacking Minecraft into WebGL by Arcanis on Wednesday December 21, 2011 @06:58AM (#3377234)
IIRC, you can change a Renderer size using renderer.setSize(w, h). In order to update the camera aspect, you just have to use : camera.ratio = w / h; camera.updateProjectionMatrix().