Professional Documents
Culture Documents
Perspective in 2D Games
the
gamedesigninitiative
at cornell university
gamedesigninitiative
at cornell university
Camera in 2D Games
World origin World
Camera origin
Camera
Perspective
the
gamedesigninitiative
at cornell university
Perspective
the
gamedesigninitiative
at cornell university
Camera in XNA
Purpose of BasicEffects class
View property holds eye space transform
gamedesigninitiative
at cornell university
Perspective
the
gamedesigninitiative
at cornell university
Perspective
the
gamedesigninitiative
at cornell university
Orthographic Projection
Project perpendicular to an axis
Top-down: perpendicular to z-axis Side scrolling: perpendicular to y-axis
gamedesigninitiative
at cornell university
Orthographic Projection
Perspective
the
gamedesigninitiative
at cornell university
Parallax Scrolling
Gives depth to orthographic projection
Objects in background have distance Rate of scrolling depends on distance
gamedesigninitiative
at cornell university
Parallax Scrolling
Perspective
the
gamedesigninitiative
at cornell university
Axonometric Projection
Off axis view of object
View along all 3-axes
2 axes equal
the
gamedesigninitiative
at cornell university
Axonometric Projection
Perspective
the
gamedesigninitiative
at cornell university
Axonometric Projection
Perspective
the
gamedesigninitiative
at cornell university
Projection Types
Isometric
All axes are equal If need all dimensions Classic RPGs
2 axes equal
Dimetric
z-axis is very short x, y axes are equal Orthographic+depth
all axes equal
Perspective
the
gamedesigninitiative
at cornell university
Projection Geometry
Axes relative to screen
z goes into the screen x, y are in screen plane
y y z z y x z
Axonometric coodinates
May not be true coords Meaning of x, y, z?
Side-Scroller
Orthographic substitutes
Side-scroller: y is height Top-down: z is height
Perspective
the
Top Down
gamedesigninitiative
at cornell university
Isometric View
If need all axes visible
h 1 = w 3
h 45 27
30
Game View
Top View
Side View
Perspective
the
gamedesigninitiative
at cornell university
Isometric View
x, y, z = Axonometric Coords x, y = Screen Coordinates
w h 45 27 Game View Top View Side View 30
x = x - z y = y + (x+z)
Perspective
the
gamedesigninitiative
at cornell university
h 1 = w 6
h 75
0.25 0.5
10
Game View
Top View
Side View
Perspective
the
gamedesigninitiative
at cornell university
x = x +(z) y = y +(z)
10
Game View
Top View
Side View
Perspective
the
gamedesigninitiative
at cornell university
h 2 = w 5
h 78
0.5 0.25
~24
Game View
Top View
Side View
the
Perspective
gamedesigninitiative
at cornell university
x = x +(z) y = y +(z)
~24
Game View
Top View
Side View
the
Perspective
gamedesigninitiative
at cornell university
gamedesigninitiative
at cornell university
Axonometric
Advantages
Relatively easy to tile Supports 3-D gameplay
Disadvantages
No 3-D gameplay Game feels flat
Disadvantages
Harder to composite Objects may be hidden
Perspective
the
gamedesigninitiative
at cornell university
Summary
Camera represents eye space coordinates
3D games have arbitrary camera movement 2D games are limited to scrolling movement
gamedesigninitiative
at cornell university