Math

Math

The XNA Framework provides classes and methods for manipulating vectors and matrices. This section discusses math and includes examples of common math-related game tasks.

In This Section

Math Overview
Overview of the math related functionality provided by the XNA Framework.
Collision Detection Overview
Overview of the collision-detection–related functionality provided by the XNA Framework.
How to: Transform a Point with a Matrix
This example demonstrates how to use the Vector3 and Matrix classes to transform a point.
How to: Rotate and Move a Camera
This example demonstrates how to rotate and move the camera by creating a view matrix with CreateLookAt.
How to: Make a Third-Person Camera
This example demonstrates how to create a third-person camera.
How to: Script the Camera to Follow a Curve
This example demonstrates how to use the Curve and CurveKey classes to script the movement of the camera.
How to: Position the Camera to View All Objects in a Scene
This example demonstrates how to position the camera so that all objects in a scene are within the view frustum while maintaining the camera's original orientation.
How to: Detect Whether Two Models Collide
This example demonstrates how to use the BoundingSphere class to check whether two models are colliding.
How to: Detect Whether a User Clicked a 3D Object
This example demonstrates how to check whether the mouse is positioned over a 3D object by creating a ray starting at the camera's near clipping plane and ending at its far clipping plane.
Bb203904.note(en-US,XNAGameStudio.10).gifNote
This example applies only to Windows development. The Mouse and MouseState objects are not supported on Xbox 360.
Show:
© 2016 Microsoft