5 ms·
In the Comanche GIF, the viewport tilts when the aircraft turns. Is anything special going on here, or is it simply a rotation of the projection? If it's just a
by Xophmeister 6y ago
In the Comanche GIF, the viewport tilts when the aircraft turns. Is anything special going on here, or is it simply a rotation of the projection? If it's just a rotation, what extra work does the engine need to do to fill in any gaps from the lines that will no longer be neatly aligned to pixels, like they would be when it's flat?
- pjc50 6y agoThe lines are always drawn vertically from the point of view of the viewport, so they're always aligned to pixels. This does limit the rotation allowed before the user starts to notice!
- s-macke 6y agoAuthor here. That is exactly what is going on here. I just move the horizon line up and down. This works very well as long as the rotation remains small. That is also the reason, why Comanche was a helicopter game and not an airplane game.
- degenerate 6y agoI played Comanche on a Sony VAIO display laptop at Circuit City for hours when I was young (my dad worked there). The speed and detail was indeed mind blowing back then, thanks for your excellent writeup and examples on how it worked!
- JKCalhoun 6y agoYeah, I've written this code twice now after seeing the algorithm described years ago in an article. I did add my own "skew" parameter that would fake a little bit of horizon roll (skew by shifting up and down the column-renders to the screen along a shallow diagonal ... if you know what I mean). If you kept it small it looked like roll and added a sense of realism to the motion.
- deleted 6y ago[deleted]
- 1wd 6y agoAdding the tilting is a tiny tweak: https://news.ycombinator.com/item?id=21945633 https://news.ycombinator.com/item?id=21945633
- s-macke 6y agoYeah, thanks for the reminder. Probably I have to add this part to the GitHub README. Because these lines are too simple to ignore.