VoxelSpace
VoxelSpace copied to clipboard
Camera roll
Do you know how the game/engine rolls the camera? Does the vertical line drawing function draw the line at an angle instead? Or does it render to a buffer and then rotate that? Or does it skew the image for a rough approximation of roll at low angles, like how this demo fakes moving the camera up and down by panning the image?
You still want to draw vertical lines. Doing anything different would be a lot more expensive (not possible on a 386).
Also, drawing pixels one vertical column at the time would be the best approach for how VGA paging works.
Offsetting the tilt before the vertical line drawing would be a quick/dirty solution:
let tiltOffset = (input.leftright * (i /screenwidth - 0.5) + 0.5) * screendata.canvas.height / 4;
DrawVerticalLine(i, heightonscreen + tiltOffset, hiddeny[i] + tiltOffset, map.color[mapoffset]);