Upload
august-short
View
238
Download
9
Tags:
Embed Size (px)
Citation preview
CSE 381 – Advanced Game ProgrammingCode Setup
Fix the Working Directory
[ERROR] Failed to initialize the resource cache! Are your paths set up correctly?Function: GameCodeApp::InitInstance\psf\home\desktop\gamecode4\source\gcc\gamecode4\gamecode.cppLine: 178
Solution: Right-click on the TeapotWars project and go to properties. Then go to the Debugging section and enter in ..\..\..\Game as the Working Directory.
Game Programmers 30 Years Ago
• Used to do everything• design• art• code
Today’s Game Programmer
• Typically Specialized• Character movements programmer
• Network communications programmer
• Web programmer …
Why is that important?
Oh by the way
Version Control is not just for Code
Assets too
Don’t lose a model an artist spent weeks on
Paraphrasing Richard Garriott (a.k.a Lord British)
The game industry is a lot like the movie industryBUTAt the beginning of every game project we start by inventing new cameras, film, and processing techniques, and projectors.
SDKs Pros & Cons
• Pros:• Speed Up Development• Flexible• Well Tested (hopefully)• Can be powerful
• But, might::• Be inflexible for your purposes• Have difficult to find bugs• Have big differences between versions
Game Engine SDKs with Tools• For Building game
• merging & optimizing assets
• organizing content
• Adding triggers, dynamic object generators, bots, etc.
• Level geometry/terrain likely built elsewhere• i.e. Maya
Unity Scene Editor
Lots of them Out There
For Next Wednesday
• Read Chapters 2-5 (that’s 125 pages or so)
• Download & Install Blender3D• do Noob to Pro Tutorial Units 1-2B
• http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro
• I’ll check next Wed. to make sure everyone completed the Simple Person with a Hat
Why Blender3D?
• It can make great content
• It's widely used
• It's free
Download & Install
• http://www.blender.org/download/get-blender
• Latest version 2.68a
Blender 3D: Noob to Pro
• http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro
What can blender do?
• Create 3D content• Create 3D worlds• Produce realistic, beautiful, fantastic 2D projected
renderings of 3D content/worlds
First, some formal definitions
• What's a 3D model?– an abstract version of an object
– renderable
– data (vertices, edges, textures, etc.)
• What's modeling?– Process of making 3D models
Model Data
• Vertices
• Edges
• Faces
• Surface Normals
Steps in the Modeling Process
• Object modeling
• Shading
• Lighting
• Rigging
• Posing
Shading includes Texturing
• Wrapping 3D geometry in images
• Atlas and Model
Polygon Mesh Creation Example
Polygon Mesh Creation Example
Polygon Mesh Creation Example
3D World Construction & Rendering
• Based on Geometry• Imagine a model of this room• Everything needs a position in 3D space
– think 3D coordinates (x, y, z)– Where's the origin (0,0,0) of our room?
Blender3D Axes
• X, Y, Z– Cartesian Coordinates– Are negative coordinates ok?
• Right-handed System, Huh?
Axes of Rotation
• We'll want to rotate stuff
• How do we denote a rotation?
• We need 2 things:
– Axis of rotation– Angle around axis
• Right-grip rule
Coordinate Transformations
• Changes an object's coordinate values in some way
– Moving an object (translation)– Rotating an object (rotation)– Enlarging or shrinking an object (scaling)
Translation, Rotation, & Scaling
Multiple Transformations
• They can be combined on an object
• Order of processing matters
Projections
• Our 3D worlds are projected onto 2D screens
– Orthographic vs. Perspective projection
Orthographic
Perspective
Orthographic views can be useful. Why?
Perspective Projection uses Foreshortening
• What's that?
– nearby objects rendered larger than faraway objects– gives the illusion of depth and distance
What's a vanishing point?
• Imagine looking down a set of train tracks• They appear to converge at a point on the horizon• This is the vanishing point
The Projection Plane
• Depends on camera position and orientation
Blender Coordinates
• Global Coordinate System
– each scene has its own– fixed origin & orientation– virtual camera may be moved about
• Local Coordinate System– each object has its own