PDA

View Full Version : Walking along terrain

chxfryer
11-10-2001, 08:42 PM
I am having a problem finding information on moving ON a terrain. I can make the land, load the object, display the object and move it but I dont know how to make it move nicely up and down hills and what not. <--big run-on huh? please help

Bob
11-11-2001, 02:19 AM
Move the viewpoint around as usual, and change the Y-coordinate (or whatever axis is up) to match the height in the terrain at the given position. Add an offset if you don't want to crawl on the ground.

chxfryer
11-11-2001, 11:49 AM
I thought about that. but what if my object is in the middle of a triangle, how would I get the height? An average of the three verts would make the movement choppy. Is there someother way? knowing my luck the answer is simple and I am overlooking it. Thanks

DFrey
11-11-2001, 12:26 PM
The triangle and its normal defines a plane. Sinply plug your two known coordinate components into the appropriate plane equation to solve for the height.

[This message has been edited by DFrey (edited 11-11-2001).]

chxfryer
11-11-2001, 11:02 PM
Thanks for everyones help; I got it working.