Skip to Main Content
Learning XNA 3.0
book

Learning XNA 3.0

by Aaron Reed
November 2008
Beginner content levelBeginner
510 pages
16h 24m
English
O'Reilly Media, Inc.
Content preview from Learning XNA 3.0

Chapter 12: 3D Collision Detection and Shooting

Quiz Answers

  1. When firing a shot in a 3D (or 2D, for that matter) game, how do you determine the direction of the shot?

    • Typically, the thing that's firing a shot (a camera, a gun, etc.) has a direction of its own. When firing a shot, you give the bullet or projectile the same direction vector as the item from which it emanates.

  2. Fact or fiction: every model has a BoundingSphere object that surrounds the entire model and can be used for collision detection.

    • Fiction. The BoundingSphere object belongs to a ModelMesh object. Every Model has one or more ModelMesh objects. The BoundingSphere therefore may cover the entire model, but a Model may also have several meshes, and in that case, the Model will have multiple BoundingSphere objects that each surround portions of the Model.

  3. When using BoundingSpheres associated with a moving model for collision detection, what must be done to the BoundingSphere in order to accurately detect collisions?

    • BoundingSpheres do not automatically move, rotate, and scale with the model that owns them. You need to apply the movement, rotation, and scale matrices to the BoundingSphere before using them for collision detection.

  4. What is the difference between drawing 2D images on screen in a 3D game and drawing 2D images on the screen in a 2D game?

    • Nothing. Drawing in 2D is the same regardless of whether there are also 3D graphics in the game.

  5. How much does the tongue of a blue whale weigh?

    • As much as an average-sized elephant! ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning XNA 4.0

Learning XNA 4.0

Aaron Reed
Beginning C# 7 Programming with Visual Studio 2017

Beginning C# 7 Programming with Visual Studio 2017

Benjamin Perkins, Jacob Vibe Hammer, Jon D. Reid

Publisher Resources

ISBN: 9780596154905Supplemental ContentErrata Page