Chapter 12: 3D Collision Detection and Shooting
Quiz Answers
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.
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 aModelMesh
object. EveryModel
has one or moreModelMesh
objects. TheBoundingSphere
therefore may cover the entire model, but aModel
may also have several meshes, and in that case, theModel
will have multipleBoundingSphere
objects that each surround portions of theModel
.
When using
BoundingSphere
s associated with a moving model for collision detection, what must be done to theBoundingSphere
in order to accurately detect collisions?BoundingSphere
s do not automatically move, rotate, and scale with the model that owns them. You need to apply the movement, rotation, and scale matrices to theBoundingSphere
before using them for collision detection.
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.
How much does the tongue of a blue whale weigh?
As much as an average-sized elephant! ...
Get Learning XNA 3.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.