It is currently Tue Nov 13, 2018 11:08 am

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Jun 09, 2018 2:03 pm 
Offline

Joined: Sat Apr 07, 2018 7:39 pm
Posts: 12
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.


Top
 Profile  
 
PostPosted: Sat Jun 09, 2018 3:11 pm 
Offline

Joined: Sun Mar 27, 2016 7:56 pm
Posts: 170
If I understand what you're saying, you basically mean having a horizon that isn't horizontal?


Top
 Profile  
 
PostPosted: Sat Jun 09, 2018 3:18 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20763
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
PostPosted: Sat Jun 09, 2018 4:34 pm 
Offline

Joined: Sat Apr 07, 2018 7:39 pm
Posts: 12
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.


Top
 Profile  
 
PostPosted: Sat Jun 09, 2018 4:48 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20763
Location: NE Indiana, USA (NTSC)
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?


Top
 Profile  
 
PostPosted: Sun Jun 10, 2018 11:45 am 
Offline

Joined: Sat Apr 07, 2018 7:39 pm
Posts: 12
A=D
B=0
C is changed using hdma


Top
 Profile  
 
PostPosted: Mon Jun 11, 2018 5:58 pm 
Offline

Joined: Wed Oct 18, 2017 1:33 pm
Posts: 5
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:
|     |   |  | |||


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?

_________________
WFDis Interactive 6502 Disassembler


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group