View Full Version : Terrain Hugging / Height Detection
04-07-2005, 04:09 PM
Hi, does anyone know how I can detect the height of a face directly beneath a model? I have some terrain and a ship and I basically want the ship's height to change depending on the height of the terrain beneath it so that it appears to hug the terrain as it moves (like in the wipeout or fzero games). Any help appreciated, thanks
04-07-2005, 04:27 PM
Well if you can find some free code to do a line intersection on a plane (Used to be on gametutorials.com)... usually you can create a "plane" from a triangle (three points to define a plane) and then your line will be from your spaceship straight down below the terrain. then the y value where the line intersects the "plane" (triangle) is where you will want to put the bottom of your ship, or maybe a couple points higher to make it look like it is floating.
04-07-2005, 07:56 PM
hi, an unoptimized method would be to read the height values and save them ina an array then as you move your ship compare them
04-08-2005, 02:28 AM
Thanks a lot guys, I'll give it a go
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.