javascript - Rotating Wireframe Sphere in Canvas -
i'll admit, i'm not quite well-versed in canvas or javascript yet (heck, haven't done trig in many many years), able find similar looking in canvas demos.
rotating sphere: http://www.javascriptdemos.com/?demoid=1
it's wanted, wondering if can me draw lines in rather being dotted longitude , latitude.
any assistance appreciated.
to draw line on html canvas context:
var ctx = mycanvas.getcontext('2d'); ... ctx.linewidth = 2; //px ctx.strokestyle = '#000'; // black ctx.beginpath(); ctx.moveto(14,42); // first point ctx.lineto(20,30); // repeat desired ctx.lineto(25,35); // repeat desired ctx.stroke(); // draw path!
i suspect you're missing call stroke()
in attempts. note can call moveto()
multiple times during single path, long want use same linewidth/strokestyle segments (as sounds do).
Comments
Post a Comment