Home Articles Tutorials Resources About
Basic samples   Last update: July 15 2008 by System

Quaternions for rotation
This sample demonstrates the very basics on how to use quaternions for rotations and how to interpolate between them. It comes with an XNA adaptation of some handy Ogre3D code to fetch the quaternion representing the rotation between two vectors.

» View this resource
 
Supporting an arbitrary number of lights in HLSL
This little sample demonstrates a basic idea to support multiple lights in HLSL. This is by no means the definite solution to supporting multiple lights, but more of a starting point. Also the lighting just uses simple directional lights without any fancy normal mapping, just to avoid disappointment.

» View this resource
 
Rendering decals onto a background texture
This little sample shows how to use a RenderTraget2D to render ocasional new decals to a background texture, so you only need to render the single texture during the main rendering phase. Note: to get rid of the alpha being carried over to the render target, check out this thread.

» Download this resource
 
Capturing mouse moves
This quick sample demonstrates how to get input from mouse movements in your game and how to use Mouse.SetPosition to keep the cursor from the border of the screen to keep things moving. In this example we use the mouse moves to set a general yaw and pitch, which shows the particularities of this approach to 3D rotation.

» Download this resource
 
 
XNA info is sponsored by vector4. All content is copyright © 2005-2012 by its respective authors | About XNA info | Terms of Use | RSS feed