Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Sound in games Think about truly memorable games – They almost always have.

Slides:



Advertisements
Similar presentations
Defining the Viewing Coordinate System
Advertisements

Välkommen till Sommarkollo Introduce XNA Game Studio Express Make A Game!
MAT 594CM S2010Fundamentals of Spatial ComputingAngus Forbes Overview Goals of the course: 1. to introduce real-time 3D graphics programming with openGL.
Creating Games For Windows, Xbox 360, and Windows Phone 7 Ryan Plemons
COMPUTER PROGRAMMING 2 Chapter 7 Sound. Objectives Find out how to prepare sounds for inclusion in Microsoft XNA projects. Incorporate sounds into XNA.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Computer Science – Game DesignUC Santa Cruz Today Announcements – Imagine cup theme is required for all games Only one team has signed up on imagine cup.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Computer Science – Game DesignUC Santa Cruz CMPS 20: Game Design Experience 2D Movement Pathfinding.
Introduction to Shader Programming
Playing Sounds inside XNA Game Design Experience Professor Jim Whitehead February 23, 2009 Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0.
Point Lighting Using Shaders Game Design Experience Professor Jim Whitehead March 13, 2009 Creative Commons Attribution 3.0 (Except copyrighted images.
Particle Systems Final Exam Study Guide Game Design Experience Professor Jim Whitehead March 16, 2009 Creative Commons Attribution 3.0 (Except copyrighted.
Simple 3D Camera Game Design Experience Professor Jim Whitehead March 6, 2009 Creative Commons Attribution 3.0 (Except copyrighted images) creativecommons.org/licenses/by/3.0.
Outline for Today More math… Finish linear algebra: Matrix composition
Introduction to 3D in XNA Game Design Experience Professor Jim Whitehead February 27, 2009 Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0.
Triangles, Translations Game Design Experience Professor Jim Whitehead March 2, 2009 Creative Commons Attribution 3.0 (Except copyrighted images) creativecommons.org/licenses/by/3.0.
Viewbox 4 Tutorial How to create a Template Please view this tutorial as a Slide Show in PowerPoint, because it contains animations that will not appear.
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Shaders Feb 18, 2011 Creative Commons Attribution 3.0 (Except copyrighted.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Hierarchical Transformations Hierarchical Models Scene Graphs
Text. Graphics Images – photos Animation Video Audio Text Copyright issues.
Week 1 - Friday.  What did we talk about last time?  C#  SharpDX.
3D Concepts Coordinate Systems Coordinates specify points in space 3D coords commonly use X, Y, & Z A vertex is a 'corner' of an object Different coordinate.
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
CHAPTER 4 Images XNA Game Studio 4.0. Objectives Find out how the Content Manager lets you add pictures to Microsoft XNA games. Discover how pictures.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
CSE 381 – Advanced Game Programming Basic 3D Graphics
11 A First Game Program Session Session Overview  Begin the creation of an arcade game  Learn software design techniques that apply to any form.
Week 2 - Wednesday CS361.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
1 Useful Tools for Making Video Games Part V An overview of.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
SKM 4200 Computer Animation Chapter 4: Animation (3D Computer Animation – Part 1)
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Announcements Prototype submissions will be directly from SVN on Gforge.
Ch 2 Graphics Programming page 1 CSC 367 Coordinate Systems (2.1.2) Device coordinates, or screen coordinates (pixels) put limitations on programmers and.
Introduction to XNA Graphics Programming Asst. Prof. Rujchai Ung-arunyawee COE, KKU.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CSE 381 – Advanced Game Programming Code Setup.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
Maths & Technologies for Games DirectX 11 – New Features Tessellation & Displacement Mapping CO3303 Week 19.
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Games Development 2 Entity Update & Rendering CO3301 Week 2, Part 1.
Sky Boxes and Vector Math 2 Course Information CVG: Programming 4 My Name: Mark Walsh Website:
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
Chapter III Rasterization
Maths & Technologies for Games Graphics Optimisation - Batching CO3303 Week 5.
Computer Graphics Matrices
11 Writing Text Session 5.1. Session Overview  Show how fonts are managed in computers  Discover the difference between bitmap fonts and vector fonts.
11 Computers, C#, XNA, and You Session 1.1. Session Overview  Find out what computers are all about ...and what makes a great programmer  Discover.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
 Advancing from moving premade primitives to making our own models  Two different approaches: ◦ Direct mesh editing: A more traditional approach commonly.
Computer Science – Game DesignUC Santa Cruz Tile Engine.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
How to use a Pixel Shader CMT3317. Pixel shaders There is NO requirement to use a pixel shader for the coursework though you can if you want to You should.
- Introduction - Graphics Pipeline
3D Modeling & Animation Software
Week 2 - Monday CS361.
CENG 477 Introduction to Computer Graphics
Chapter V Vertex Processing
03 | Creating, Texturing and Moving Objects
Presentation transcript:

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Sound in games Think about truly memorable games – They almost always have excellent background music and sound effects – Legend of Zelda, PacMan, Katamari Damacy, Little Big Planet, Radiant Silvergun – Music and artwork style combine to create an overall tone, or mood, for a game – Done well, this substantially enhances the overall gameplay experience

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Finding/Making Sounds Where can you find music to use in your game? – Reminder: there is this legal framework called Copyright Law – Creative Commons: use licenses that may allow free, non-commercial use Sites with Creative Commons licensed music – New Grounds, Jamendo Look for “Attribution, Non-commercial” – “No Derivative Works” is OK, so long as you don’t modify If you use in your game, make sure you provide attribution – Put name of artist in your game (About page, splash screen, etc.) – Is polite to send them an telling them about the use—will make them jazzed

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Finding/Making Sounds (cont’d) Find someone to create music for you – Music student at UCSC, for example – One team has already put up announcements for a music person It has never been cheaper to create high quality music – Instruments, microphones, mixing technology are all at historically low prices – Has led to a proliferation of music – Biggest problem: finding an audience – Games provide a good audience – Sales of many videogames larger than most music album sales – For many musicians, might have larger audience for video game soundtrack than for traditional album

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Finding/Making Sounds (cont’d) Use your voice! – Your voice is wonderfully adaptable and expressive Consider: – Record a raw voice clip – Bring into an editing software suite – Tweak/filter/alter until it suits your game – Can do much worse… Tools – Audacity Free, open source sound recorder/editor – FL Studio (grown-up commercial version of Fruity Loops)

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Playing Sounds in XNA Two ways Hard (but powerful) way – XACT audio tool Cross-platform audio creation tool – Many neat features – Edit volume, pitch, looping of sound clips – Can easily group together sound clips Easy (and 95% sufficient) way – Use Simplified Sound API – Can start, stop, and pause sound playing – Much, much easier to use

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Simple Sound API Two ways to play music – As a song Good for background music, or other long sounds – As a sound effect Good for short duration sounds

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides XNA Simple Sound API Supported music types: wav, wma, mp3 Add sound into project Contents folder – Audio files treated like other files in content pipeline – Copy sound file into project Contents folder – Right-click on Contents folder inside Visual Studio C# Express Add  Existing Item … select audio file you just copied in – Will now be visible inside Visual Studio – Need to double-check the Content Processor Sound Effect – XNA Framework – sound effects Song – XNA Framework - songs

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides XNA Song API Create a variable of type Song – Used to load songs via the content pipeline – Song mySong; Load sound file – mySong = Content.Load of song file without extension}”) To play a sound, call Play() method on MediaPlayer object – MediaPlayer.Play(mySong); To pause/resume, call Pause()/Resume() on MediaPlayer object – MediaPlayer.Pause(); // no argument – MediaPlayer.Resume(); // no argument

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides XNA Sound Effect API Create a variable of type SoundEffect – Used to load sounds via the content pipeline – SoundEffect soundEffect; Load sound file – soundEffect = Content.Load of sound file without extension}”) To play a sound, call Play() method on SoundEffect object – Returns a soundEffectInstance object – Can use this to stop, pause, and restart sound – SoundEffectInstance soundEffectInstance = soundEffect.Play();

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Demo of Song and Sound Effect API // Demo of use of Songs and Sound Effects inside XNA Caution: Treating a song as a sound effect can lead to very long compile times – Solution: keep sound effects short

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides 3D in XNA

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides 2D to 3D Many current games use 3D graphics – Much more complex than 2D graphics – This course will provide a basic overview of 3D graphics – CMPS 160, 161, 164 provide greater depth Ratchet and Clank

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides 3D Camera Analogy – 2D is like putting stickers on a page Place sticker (sprite) at x,y coordinate If a sticker is placed at 50,50, you see it – 3D is like recording a video with a camera What is recorded (shown on screen) is what camera sees Can have objects in a scene that aren’t visible – Can have 3D object at 50,50,50, but if camera is pointing in the opposite direction, won’t see it! Introduces rotation – Camera can potentially be rotated around all 3 axes – Objects can also be rotated around 3 axes – Affects what shows up on screen

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides 3D Coordinate System 3D graphics requires use of x,y,z coordinates So, which direction is positive z? – Is it back away from you, or towards you? – Either choice would work, need to pick one Right handed vs left handed coordinate systems – XNA uses right handed coordinate system Place hands, palms up – Point fingers in direction of positive X – Curl fingers in direction of positive Y – Thumb is pointing in direction of positive Z Right-handed coordinate system

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Camera Camera is comprised of two Matrix objects – View matrix holds information on Location of camera in world Camera direction Camera orientation – Projection matrix holds information on View angle Aspect ratio Near and far plane Location (x,y,z) Orientation Direction

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Matrix Structure XNA provides a Matrix structure – A 4x4 matrix, in row vector layout Row vector matrices view vectors as a row from left to right column vector matrices view vectors as a column from top to bottom – Built-in matrix operations +, -, *, /, == – Also, convenience matrices Identity, Up, Down, Left, Right – Large number of convenience methods Rotations, views into 3D world, determinants, invert

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Vector3 Structure Represents either: – An X, Y, Z coordinate, or, – Distances along X, Y, Z coordinates (e.g., a vector) Often a unit vector – all values between 0 and 1 – X, Y, Z properties (floats) Built-in operators – +, -, *, /, ==, != Convenience vectors – UnitX, UnitY, UnitZ, Up, Down, Left, Right Many convenience methods – Interpolations, rotations, distance, dot product, normalization (x,y,z) coordinate x y z (x,y,z) vector

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Creating an XNA Camera – View Matrix View matrix – Use CreateLookAt method of Matrix structure – Parameters (all Vector3) cameraPosition – location of camera (x,y,z) cameraTarget – coordinate of point where camera is looking cameraUpVector – vector indicating up position cameraPosition (x,y,z) cameraUpVector cameraTarget (x,y,z)

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Creating an XNA Camera – Projection Matrix Projection Matrix – Use CreatePerspectiveFieldOfView method – Parameters (all floats) fieldOfView – angle of camera view, in radians – Typically 45degrees – pi/2 radians aspectRatio – Typically width of screen divided by height of screen nearPlaneDistance – Distance from camera to near viewing plane – Objects between camera and near plane are not shown! farPlaneDistance – Distance from camera to far viewing plane – Objects beyond far plane are not shown! cameraPosition (x,y,z)

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Drawing Triangles All complex 3D shapes seen in games are composed of a series of triangles – A triangle has 3 points, one for each corner Points are more typically known as verticies Minimum number of points to unambiguously define a plane VertexPositionColor object – Represents the x,y,z location of a vertex – Also has a color for the vertex –VertexPositionColor v = new VertexPositionColor(new Vector3(0,1,0), Color.Blue); – Need 3 verticies to draw a triangle

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Vertex Declaration XNA requires you to tell the graphics device what kind of vertex data you will be using – Unclear why XNA can’t just figure this out, or handle multiple types seamlessly – Probably due to structure of DirectX API, or capabilities of graphics hardware – For now, treat as a must-do, black box – Put following in your main, derived from Game class –GraphicsDevice.VertextDeclaration = new VertexDeclaration(GrahpicsDevice, VertexPositionColor.VertexElements);

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Actually drawing the triangles In XNA, all 3D rendering is handled by a shader – Shaders defined using High Level Shader Language (HLSL) – Permits creation of wide range of visual effects – More on shaders in a few classes XNA provides a default shader – Called BasicEffect – Will use this for now BasicEffect is a type of effect – Effects contain a series of EffectPass – Each pass handles some aspect of putting things on screen

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Using Basic shader Five steps Create Shader Copy over camera information Iterate through EffectPasses Examine source code from example in Chapter 9 of XNA 3.0

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Using Basic shader Five steps: 1.Create Shader –BasicEffect effect = new BasicEffect(GraphicsDevice, null); 2.Copy over camera information –effect.View = camera.view; –effect.Projection = camera.projection; 3.Set world matrix –effect.World = … (more on this in a few slides) 4.Enable vertex capabilities (varies by Vertex type) –Effect.VertexColorEnabled = true; // for VertexPositionColor –Effect.Texture = myTexture; // for VertexPositionTexture Effect.TextureEnabled = true; 5.Iterate through EffectPasses – Call to DrawUserPrimitives inside EffectPass puts triangles on screen

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Iterating Through Effect Passes Each Effect has calls to begin()/end() Effects are comprised of passes – Each pass requires a call to begin()/end() effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); GraphicsDevice.DrawUserPrimitives (PrimitiveType.TriangleStrip, verts, 0, 1); pass.End(); } effect.End(); Draws verticies Passes # of triangles (the “primitive shape” in this context) to draw Index into verts array

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Triangle Drawing Examine this line of code –GraphicsDevice.DrawUserPrimitives (PrimitiveType.TriangleStrip, verts, 0, 1); – What is a TriangleStrip? Three ways to draw triangles – Triangle List Each set of three verticies defines a triangle Memory inefficient, since triangles often share edges in complex 3D meshes – Triangle Strip Builds triangle out of first three verticies Each additional vertex creates new triangle using that vertex, plus previous two verticies – Triangle Fan Each additional vertex creates new triable using that vertex, the previous vertex, plus the first vertex surfaceModeling015.png

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides World Matrix Each triangle has 3 verticies, and each vertex has an x,y,z position – This position is given with respect to an origin location – That is, location is with respect to a local coordinate system World matrix – Translates from the local coordinate system to the world (i.e., visible on screen) coordinate system Local coordinate system offset, no rotation (Note: example uses left handed coordinate system, XNA uses right-handed coordinates) Source: MSDN DirectX documentation Local coordinate system offset and rotated www1.adept.com/main/KE/DATA/V%20Plus/V%20Language%20User/i mages/World+yaw.gif local world

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Translation A translation shifts the local coordinate system relative to the world coordinate system XNA provides a method for this – Matrix.CreateTranslation 3 parameters are x,y,z movements Matrix.CreateTranslation(0.01f, 0, 0); // Shift right (positive) along x axis Matrix.CreateTranslation(-0.01f, 0, 0); // Shift left (negative) along x axis Multiply world matrix by translation matrix to cause shift – All translations and rotations in 3D graphics accomplished via matrix multiplication

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Rotation A rotation shifts the local coordinate system by an angle relative to the world coordinate system XNA helper methods – Matrix.CreateRotationX, Matrix.CreateRotationY, Matrix.CreateRotationZ Rotations around single axes Matrix.CreateRotationY(angle in radians); – Matrix.CreateFromYawPitchRoll Rotate around multiple axes Matrix.CreateFromYawPitchRoll(yaw rad., pitch rad., roll rad.) Demonstration of example triangle drawing code

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Triangles are fine, but models are better Today’s 3D games have a large number of objects – Theoretically possible to create these objects by manually writing C# code to create each individual triangle – In practice, this is rarely done. – Far better to use a 3D modeling tool Maya, XSI, 3DS Max, Blender – Allows artists to create objects in world – Allows programmers to focus on behavior of objects – Modeling tools permit much faster creation and editing of models

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides 3D Modeling Several ways to model a 3D object – Polygonal modeling Objects are subdivided into a series of polygons (triangles) Can only approximate curved surfaces Dominant modeling form in computer games and computer graphics due to speed of rendering – NURBS Surfaces are defined by spline curves Curves defined and controlled by control points – Splines and patches Curved lines define surfaces. Between polygons and NURBS – Primitives modeling Objects built up from primitive shapes (balls, cubes, cylinders, etc.)

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides 3D Model formats There is a huge number of 3D model formats – No dominant standard – Interchange among models is often lossy XNA supports two 3D model formats –.X (DirectX) –.FBX Originally for FilmBox by Kaydara, then Alias, now Autodesk

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Models in XNA Model – Represents some entity A person, a car, or potentially a complex scene with many parts – Typically used to represent one logical object (e.g., a person) that has multiple parts (head, arms, legs, etc.) – A model contains multiple meshes and bones Mesh – Represents a single physical object – Triangles, textures, shaders, etc. – XNA ModelMesh class Bone – Represents placement of each mesh relative to other meshes – A transformation matrix Model ModelMesh 1 N Car Body +bone Wheel +bone Door +bone Bone 1 N

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Models in XNA (cont’d) ModelMesh contains: – List of ModelMeshPart – List of Effects – Verticies for triangles that comprise this mesh VertexBuffer – Also has a bounding sphere ModelMeshPart – Represents a set of triangles that share the same materials (e.g., shader, or Effect) – Has indexes into the ModelMesh – Starting index, number of triangles, number of primitives to use from parent ModelMesh’s VertexBuffer Model ModelMesh 1 N Bone 1 N ModelMeshPart Effect 1 N 1 N VertexBuffer 1 1 Verticies 1 N Effect 1 1 StartIndex NumVerticies PrimitiveCount

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Working with Models in XNA Bring model into XNA project inside Visual Studio Load model into XNA via Content manager Draw model by iterating through all contained meshes

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Importing Models into Visual Studio Import model into Content directory – Copy.x or.fbx file, along with associated texture images, into Content directory in XNA project – Inside Visual C#, right-click on Content directory Add… Add Existing Item Select.x or.fbx file – Similar process to adding bitmap textures, etc.

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Loading Model via Content manager Models are loaded via the content manager – Model model = Content.Load of my model without.x or.fbx extension}”) XNA parses the model file, and fills in verticies, textures, and effects in Model, and ModelMeshes – In XNA, this is a robust operation, big time savings – In many open source 3D game engines, model import can be a big problem – At present, typically is not safe to assume model import will work smoothly in a given 3D game engine – Need to test your tool chain

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Drawing a Model Iterate through all of the meshes – Iterate through each effect for each mesh Set lighting, camera, and world for each effect – Draw each mesh using Draw() method on ModelMesh class foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect be in mesh.Effects) { be.EnableDefaultLighting(); be.Projection = camera.projection; be.View = camera.view; be.World = world * mesh.ParentBone.Transform; } mesh.Draw(); } Examine example code from Chapter 10 of Learning XNA 3.0

Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides More on Models Explanation of parts of XNA models – 1/20/models-meshes-parts-and-bones.aspx 1/20/models-meshes-parts-and-bones.aspx