Nintendo 1504166 Programming Manual - Page 49

BG Rotation and Scaling Features

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171

AGB Programming Manual
Rendering Functions
©1999 - 2001 Nintendo of America Inc.
49
D.C.N. AGB-06-0001-002B4
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.
BG display
screen
BG data reference area
Horizontal line before
rotation
Horizontal line after
rotation
θ
x-axis
y-axis
dx
(distance moved in directionx, same line) =
(1 /
α
)
cos
q
dy
(distance moved in direction y, same line
) =
- (1 /
β
)
sin
q
dmx
(distance moved in direction x, next line) =
( 1 /
α
)
sin
q
dmy
(distance moved in direction y, next line) =
( 1 /
β
)
cos
q
α
: Magnification along x-axis
β
: Magnification along y-axis
q
q
dx
dy
dmy
dmx
*
Rotation center
coordinate
)
,
(
0
0
y
x
Origin
)
0
,
0
(
Coordinate
before rotation
)
,
(
1
1
y
x
Coordinate after
rotation
)
,
(
2
2
y
x
BG rotation and scaling are implemented in AGB using the following arithmetic
expressions.
0
0
1
0
1
2
0
0
1
0
1
2
0
0
0
1
0
1
2
2
)
(
)
(
)
(
)
(
cos
1
,
sin
1
,
sin
1
,
cos
1
y
y
y
D
x
x
C
y
x
y
y
B
x
x
A
x
D
C
B
A
y
x
y
y
x
x
D
C
B
A
y
x
-
-
=
-
-
=
=
-
=
=
=
-
-
=
q
b
q
b
q
a
q
a