Shaded globe using pen

16,565
0
Published 2014-01-17
The 3D Framework now has Globe components (v0.45 on)
3D STUDIO HERE: http://scratch.mit.edu/studios/202972
---------------------------------------------------------------
This works by drawing lots of ellipses (well, parts of ellipses).
The ellipses are drawn from either the darkest or lightest point on the globe (depending which is furthest from the viewer), and increase in size up to mid-brightness. Then the ellipses shrink again to the opposite point. Each ellipse is a constant brightness.

As usual, in order to get reasonable performance, several compromises have to be made:
1) The penwidth is small where the shade changes most quickly (so the shade change looks reasonably smooth), but becomes larger at certain places (so it can get away with fewer ellipses).
2) The ellipses are drawn using not too many straight sides - from some angles it's fairly easy to see that.
3) Because the ellipses overlap slightly, and the direction of shade change depends on whether the brightest or darkest point is closest to the viewer, there can be a slightly abrupt change in the shading as the light source goes from being slightly in front to slightly behind the globe. But at times it also doesn't look quite so good without some overlapping.
4) The slightly brighter 'bright spot', in the direction of the light source, makes it look a little like some specular reflection.
However, if you know anything about that, you'll see it's clearly in the wrong place! But getting that right would be a fair bit of extra work, so this is another compromise between performance and looking reasonable...