I'm making a C64 demo and I'm working on one specific part and I'd appreciate some help. I can't figure out how to rotate an image on the X axis. Let me explain how this effect works first.
It's what is called on the C64 a FPP effect (flexible pixel position) meaning you can display any line of graphics on any line on the screen. My effect covers 120 lines of the screen and the graphics (the font of the scrolltext) is 21 lines high.
So I have a 120 bytes (actually 256 but the 121-255 bytes are unused) array and the values stored there decide on the line of graphics to be displayed. So, if you just put there 0,1,2,3,4,5.... you'll have a normal image. If you do 0,0,1,1,2,2,3,3,4,4... it will be double height. If you do 0,1,0,2,0,3,0,4,0,5.... you will make 1 pixel gaps between lines (blinds effect ?)
Now with this setup it's possible to make a pseudo 3D effect. By calculating which lines are displayed on the screen you can rotate the image on the Y axis. Do that 2 times and You can display 2 sides of the virtual cube. That's my problem, I can't come up with this algorithm. If you look on the internet for such things you will find tutorials or academic papers on rotation of bitmaps and such, but these are exact pixel perfect calculations, obviously this is not what I need or even could calculate in real time on the Commodore... It's just a manipulation of the lines order. Any ideas ?
video related, it's what I have right now (stretching, blinds)
I can describe some other C64 effects if someone's interested.