Page 1 of 1

More complex mode 7 rotation (z-axis)

Posted: Sat Jun 09, 2018 2:03 pm
by Molive
Hey guys,

So I've been thinking about how mode 7 works and the ways which you can rotate the background.
It's pretty trivial to rotate about the x-axis by changing the matrix values. It's also somewhat easy to rotate about the y-axis using HDMA and stuff.
However, I was wondering if there was a good way to rotate the background on the z-axis? It seems like the hardest option here and really complicated, as the whole background will not be used per scanline, amongst other problems.
I'd be quite interested on what you guys think is the best way to achieve this.

Thanks,
Molive.

Re: More complex mode 7 rotation (z-axis)

Posted: Sat Jun 09, 2018 3:11 pm
by niconii
If I understand what you're saying, you basically mean having a horizon that isn't horizontal?

Re: More complex mode 7 rotation (z-axis)

Posted: Sat Jun 09, 2018 3:18 pm
by tepples
Molive wrote:However, I was wondering if there was a good way to rotate the background on the z-axis? It seems like the hardest option here and really complicated, as the whole background will not be used per scanline, amongst other problems.
I'd be quite interested on what you guys think is the best way to achieve this.
GSU.

Re: More complex mode 7 rotation (z-axis+others)

Posted: Sat Jun 09, 2018 4:34 pm
by Molive
So I've been looking at this by messing with a plane in the 3D modelling software Blender, and I don't think there's actually any angle where the rotation can't be defined as a set of scanline strips of a matrix transformed plane. However, I very well may be wrong.

Nicole: Yes, exactly.

tepples: I don't feel like the GSU is totally needed for this, as the PPU should handle it. A coprocessor to generate HDMA tables/Matrix values may be needed however, with some complicated maths...

Also, before I forget, I messed around with some pixel rendering to see if I could get close to what I wanted, and I realised that a similar effect could be achieved by using vertical shearing that changes per scanline: so the top is sheared a lot up on one side, the middle isn't sheared, and the bottom is sheared a lot down on the same side, with a linear slide of shearing in-between. Basically turning the background into a parallelogram.
I guess the next step is combining rotation axes.

Re: More complex mode 7 rotation (z-axis)

Posted: Sat Jun 09, 2018 4:48 pm
by tepples
Say you have rolled the camera by 90 degrees. (Take an F-Zero screenshot and turn it by 90 degrees.) What would the matrix for each such scanline look like?

Re: More complex mode 7 rotation (z-axis)

Posted: Sun Jun 10, 2018 11:45 am
by Molive
A=D
B=0
C is changed using hdma

Re: More complex mode 7 rotation (z-axis)

Posted: Mon Jun 11, 2018 5:58 pm
by White Flame
The matrix coefficients can be seen as simple deltas. Every time the raster moves 1 pixel to the right, the 2D texel coordinate moves by +(A,C). Every time the raster moves 1 pixel down, the texel moves by +(B,D).

If the horizon is vertical on the screen, then the boundaries between tiles on a single scanline look something like this:

Code: Select all

|     |   |  | |||
This means C is increasing every time the scanline moves to the right (assuming the +Y texel direction goes into the horizon), not remaining constant for the line. How often are you assuming you're going to update it, and how would HDMA work with it?