mrdoob/three.js — Issue #921: Make sphere geometry the same width as the canvas
Author: interactiveluke
Created: 2011-12-16 16:55:26+00:00
State: open

Hey, I've been trying to make a sphere's width fill the width of a canvas for a while now although can't seem to make it work.
It works great on my screen size, although when the browser is made smaller, it gets progressively smaller than the canvas, and vice versa when the browser is enlarged.

I'm pretty sure the problem is how I've defined the radius of the circle, although I'm not sure of the correct maths to use.

You can see the project at http://lukekidney.co.uk/ecological/

And my code is below:

I also don't understand why the earth is resizing vertically when the browser is resized vertically, as I've only added resizing to the width of the browser/ sphere. So any clarity on that would be great!

Thanks, Luke.