Hacker News new | ask | show | jobs
by s-macke 2362 days ago
Indeed, look up / down is very simple implemented. Just alter the horizon line position. This works for the human eye for small deviations such as ±20°, but will lead to perspective distortions for higher angles.
1 comments

Same with leaning. Add one more line of code and tweak the draw call:

    var ylean = (input.leftright*(i/screenwidth-0.5) + 0.5) * screendata.canvas.height / 4;
    DrawVerticalLine(i, heightonscreen+ylean, hiddeny[i]+ylean, map.color[mapoffset]);
It adds a lot to the "feeling" IMO :)
Cool, that works!