Nintendo 1504166 Programming Manual - Page 49
BG Rotation and Scaling Features
View all Nintendo 1504166 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 49 highlights
AGB Programming Manual Rendering Functions 6.1.7 BG Rotation and Scaling Features Rotation and scaling of the BG as a whole can be performed in a rotation/scaling BG screen. With rotation, BG data is referenced as shown in the following figure. Origin (0,0) Coordinate before rotation (x1,y1) BG display screen x-axis Horizontal line before rotation ∗ Coordinate after rotation ( x2 , y2 ) BG data reference area θ Rotation center coordinate ( x0 , y0 ) Horizrootnattaiol nline after y-axis dx θ θ dmy dy dmx dx (distance moved in directionx, same line) = (1 /α ) cos θ dy (distance moved in direction y, same lin)e= - (1 /β ) sin θ dmx (distance moved in direction x, next line) = ( 1 /α ) sin θ dmy (distance moved in direction y, next line) =( 1 /β ) cos θ α: Magnification along x-axis β: Magnification along y-axis BG rotation and scaling are implemented in AGB using the following arithmetic expressions. x2 y2 = A C DB x1 y1 − − x0 y0 + x0 y0 A = 1 cosθ , B = 1 sin θ , C = − 1 sin θ , D = 1 cos θ α α β β x2 = A(x1 − x0 ) + B( y1 − y0 ) + x0 y2 = C(x1 − x0 ) + D( y1 − y0 ) + y0 ©1999 - 2001 Nintendo of America Inc. 49 D.C.N. AGB-06-0001-002B4