XNA Creators Club Online

sample details

Collision Series 5: Heightmap Collision with Normals
Sample
submitted
1/10/2008

Description:

This sample demonstrates how to use information about a heightmap's vertex normals to follow the contour of the terrain.

Sample Overview

The Collision Series 4: Collision with a Heightmap sample demonstrated how to make a sphere roll around on a heightmap. One way to improve this is by orienting the object to follow the contour of the terrain. This sample provides a more believable effect for objects such as vehicles, which will not always be pointing the same way up as they move around.

This sample demonstrates how to do this by moving a tank around on a heightmap. The code involved is similar to the Collision Series 4: Collision with a Heightmap sample and throughout this sample it is assumed that you are familiar with that sample. In addition, you will use the technique described in the Simple Animation sample to animate the tank.

Other items in the Collision Series:

downloads
Framework

GS 2.0

Vertex Shader Version

VS 1.1

Pixel Shader Version

PS 1.1

var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG