That's the code: http://jsfiddle.net/Mgq79/3/
for (var xgrid = 0; xgrid < (canvasWidth / grid_step); xgrid++)
{
ctx.moveTo(xgrid * grid_step, 0);
ctx.lineTo(xgrid * grid_step, canvasHeight);
}
for (var ygrid = 0; ygrid < (canvasHeight / grid_step); ygrid++)
{
ctx.moveTo(0, ygrid * grid_step);
ctx.lineTo(canvasWidth, ygrid * grid_step);
}
Long story short - after adding the grid, noticed some lag while rendering at small velocity values (<=150m/s) while it was almost smooth near upper 1000m/s limit. So how to optimise this part?
Thanks
ps link updated Also note that lag is very noticeable when trajectories are 3 or more