VoxelSpace icon indicating copy to clipboard operation
VoxelSpace copied to clipboard

Camera roll

Open Heath123 opened this issue 2 years ago • 1 comments

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?

Heath123 avatar Dec 12 '22 22:12 Heath123

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]);

gustavopezzi avatar Dec 13 '22 07:12 gustavopezzi