Logo
HOW TO
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows Phone

Windows Phone 7 : 3D Game Development (part 1) - 3D Game Concepts

5/2/2013 6:29:18 PM
Many of the 2D concepts I have covered so far still apply in 3D game development as well, such as applying velocity, collision detection, and so on. This section focuses on drawing 3D models and some of the additional considerations related to 3D rendering.

1. 3D Game Concepts

Programming in 2D is similar in process to hand-drawing a cartoon on paper. You can draw a scene in 2D that makes objects appear near or in the background, providing perspective that models the 3D real world. 3D game development results in the same 2D projection on a flat 2D screen, however, the path to rendering is very different.

In 3D game development, you create a 3D world using wireframe models with a skin over the wireframe that is a 2D texture. The view into the world is similar to viewing the real world behind a camera, where the front aspect of an object is visible and the back of an object is not; however, the back of an object still exists. As an example, Figure 1 shows a sample 3D rendering named Pac Man displayed in CaligritruSpace with views from different angles.

Figure 1. 3D model rendered in Caligri trueSpace

You can spin, rotate, and zoom in on the model to get a different view of the environment. Just as in the real world, any view you pick is translated into a 2D rendering. However, with 3D game development, as hardware grows more powerful, the 3D model and rendering comes closer and closer to the real world. With the power of matrix mathematics, 3D vectors, and Algorithms, a game developer can fly around a 3D model of an imaginary world resulting in an immersive experience.

1.1. Modeling the Real World

For 3D game development, you mathematically create the camera view on the loaded model. As a user manipulates a game controller or tilts a phone in a mobile game experience, the Accelerometer readings can be measured and the movement is translated to affect the camera view in the model.

A 3D world can be quite expansive, so much so that trying to render an entire world model will bog down even the most powerful graphics cards. Just like viewing the real world through a camera, developers mathematically create a view that consists of a boxed 3D area that is rendered called the Frustum.

The Frustum consists of a near plane, a far plane, left and right plane that boxes an area of view, as shown in Figure 2.

Figure 2. Frustum area of a view

Notice that some objects are shown outside of the Frustum; this means that if the scene is rendered those objects would not be shown. If the user moves the camera closer in, the people would come into view. Likewise, moving the camera towards the cars could begin to bring in the building in the background. Notice in Figure 8-4 that the developer could decide to make the Frustum longer, with the near plane in front of the crowd of people and behind the buildings. As mentioned before, this could overload the graphics card resulting in frame rate loss, especially in a high-speed racing game. This is the essence of 3D game development, building out a model and rendering it in such a way that user movement feels "natural" within the game.

1.2. 3D Coordinate Systems

The XNA Framework is engineered to work with the modeling techniques in the previous section, modeling the real world via 3D coordinate systems and mathematics to project a view of a 3D experience to a game player. At the heart of 3D is the coordinate system.

Remember in 2D game development that the 2D origin (X,Y) is in the upper left-hand corner of the screen with positive X going left to right and positive Y going top to bottom. In 3D game development, the origin (0,0,0) can be at the center of a car model, or it could be at an arbitrary place in the overall 3D world. In reality, there are multiple 3D origins that are relatively positioned to each other. A model has a 3D origin that runs through the center of the model or could be centered at the bottom of the model, depending on what makes most sense for the game at that time. You can rotate around the model origin, and the model would spin like a top.

Likewise, the overall world will have an origin as well. You can also rotate a model about the 3D world origin like a plane orbiting the sun in our Solar System.

One aspect of coordinate systems that needs to be consistent is how the three axis (X,Y,Z) are oriented. In 3D game development, this is called either a right-handed or left-handed coordinate system. Figure 3 shows the two coordinate systems taken from the DirectX documentation on MSDN.

Figure 3. Left-handed and right-handed coordinate systems

So the idea is you can use your hand to remember the direction of the positive Z access. Point your fingers in the direction of the positive X axis and curl your fingers up toward the positive Y axis, and your thumb points in the direction of the positive Z axis.

The XNA Framework is a right-handed coordinate system, meaning that the Z axis is positive coming out of the screen. There are many programming models including DirectX that are left-handed systems so be cognizant of the coordinate convention when reviewing sample code and documentation.
Other -----------------
- Windows Phone 8 : Phone-Specific Design (part 3) - Using the Pivot Control in Blend
- Windows Phone 8 : Phone-Specific Design (part 2) - Using the Panorama Control in Blend
- Windows Phone 8 : Phone-Specific Design (part 1) - The ApplicationBar in Blend
- Windows Phone 7 : AlienShooter Enhancements (part 2) - Tombstone Support, Particle System
- Windows Phone 7 : AlienShooter Enhancements (part 1) - Load and Save Game State
- Windows Phone 7 Programming Model : Application Execution Model
- Windows Phone 7 Programming Model : Bing Maps Control
- Windows Phone 8 : Designing for the Phone - Blend Basics (part 4) - Working with Behaviors
- Windows Phone 8 : Designing for the Phone - Blend Basics (part 3) - Creating Animations
- Windows Phone 8 : Designing for the Phone - Blend Basics (part 2) - Brushes
 
 
REVIEW
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox
 
VIDEO TUTORIAL
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
 
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
Top 10
- Microsoft Excel : How to Use the VLookUp Function
- Fix and Tweak Graphics and Video (part 3) : How to Fix : My Screen Is Sluggish - Adjust Hardware Acceleration
- Fix and Tweak Graphics and Video (part 2) : How to Fix : Text on My Screen Is Too Small
- Fix and Tweak Graphics and Video (part 1) : How to Fix : Adjust the Resolution
- Windows Phone 8 Apps : Camera (part 4) - Adjusting Video Settings, Using the Video Light
- Windows Phone 8 Apps : Camera (part 3) - Using the Front Camera, Activating Video Mode
- Windows Phone 8 Apps : Camera (part 2) - Controlling the Camera’s Flash, Changing the Camera’s Behavior with Lenses
- Windows Phone 8 Apps : Camera (part 1) - Adjusting Photo Settings
- MDT's Client Wizard : Package Properties
- MDT's Client Wizard : Driver Properties
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro