Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera roll #18

Open
Heath123 opened this issue Dec 12, 2022 · 1 comment
Open

Camera roll #18

Heath123 opened this issue Dec 12, 2022 · 1 comment

Comments

@Heath123
Copy link

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?

@gustavopezzi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants