javascript - Manipulating the slider - the circle disappears -
javascript - Manipulating the slider - the circle disappears -
manipulating slider until end, circle represents star disappears or different motion. see: jsfiddle.net/nxnxj/13 unlike this: astro.unl.edu/naap/hr/animations/hrexplorer.html
can help me?? thanks
when supply big luminosity, you're rendering circle millions of pixels tall. broswer might not render because it's big. however, interested in little piece of big circle - namely, bit fits in tiny window. @ point, doesn't create sense increment size of circle, since can't observe alter in curvature of circle - looks straight vertical line.
this apparent verticality occurs around when x^2 + y^2 = r^2, r radius of star, y half height of window, , x r-1. solve r in terms of y, , get
function maximumnecessaryradius(windowheight){ y = windowheight / 2; maxradius = (y*y - 1)/2; homecoming math.round(maxradius); } when resizing star, check create sure radius doesn't exceed maximum necessary radius. rendering larger overkill.
example implementation
javascript browser slider
Comments
Post a Comment