Question 1: Quote: "I was thinking about this. You know, in the terrain demo, when you go up a mountain, you go really fast? Not realistic at all, right?"
Think about what's happening a second. You have your charater moving FORWARD at a particular speed. The the computer is likely lauching your player to the current hill height... giving ILLUSION you are going faster. YOU AREN'T! .... but it does look that way... so how do we fix it? Your way? VERY KLUDEGY. Why? Because if nothing is done to account for the angle of the hill, now you have 2 speeds... flat land and NOT-FLATLAND.
To REALLY fix, either do major math to get the speed/angle correct or ... My Preference... Simple "Angle" the player (or a hidden object) to the hill... point in correct direction to travel, the dbMoveObject(id,dist). Then readjust to new position - meaning reorient player to hill.... like you asked about in....
Question 2: Quote: "Also, how do I 'stick' stuff to terrain? You know, like, if you have a tank. You don't want it level on the side of a hill, right? How do I do that? Let physics and collision do it?"
I almost ruined an LCD monitor trying to get the scotch tape off, so trust me that one doesn't work! There are a few ways... Loose placement? Put in the air, and "DROP" onto terrain, letting the collision pick up when it hits the ground. So - to answer your question - physics would do al of it in this scenario... though I just mentioned a decent sparky collision trick... Physics you need to be a little more careful, as things will bounce, roll when you try the DROP from the Sky technique.
Now you sound like your talking about making a TANK appear on the hill correctly... Like as you drive up a hill. Well, I had to ask like you, and someone gave me a code snip. Here is one, I WROTE using it, and this is dbpro, but hopefully you can study it and do like I did, study, try, break, try, GOT IT eventually LOL..
`---------------------------------------------------------------------------- Get TERRAIN PITCH-N-ROLL
` Use object finder to Get "TANK's" pitch in degrees relative to current
` direction its facing. Note this Works Providing TANK Facing correct direction
` Prior to Call.
position object gc.objAngleFinder,garTank(i).rNewC.X#, garTank(i).rNewC.Y#,garTank(i).rNewC.Z#
rotate object gc.objAngleFinder,0,0,0
Turn Object Right gc.objAngleFinder, garTank(i).AngleY#
` Move to front of tank
Move object gc.objAngleFinder,8
FrontY#=GroundHeight#(object position x(gc.objAngleFinder), object position z(gc.objAngleFinder))
` Move to back of tank
Move object gc.objAngleFinder,-16
BackY#=GroundHeight#(object position x(gc.objAngleFinder), object position z(gc.objAngleFinder))
` Move back to center to prepare For Left-n-Right
Move object gc.objAngleFinder,8
` Move object to Left
turn object Left gc.objAngleFinder,90
Move object gc.objAngleFinder,5.5
LeftY#=GroundHeight#(object position x(gc.objAngleFinder), object position z(gc.objAngleFinder))
` Move object to Right of tank
Move object gc.objAngleFinder, -11
RightY#=GroundHeight#(object position x(gc.objAngleFinder), object position z(gc.objAngleFinder))
garTank(i).OldRoll#=garTank(i).RollAngle#
garTank(i).OldPitch#=garTank(i).PitchAngle#
garTank(i).RollAngle# = 90 - ATANFULL(11, LeftY#-RightY#)
garTank(i).PitchAngle# = 90 - ATANFULL(16, FrontY#-BackY#)
`---------------------------------------------------------------------------- Get TERRAIN PITCH-N-ROLL
Rotate Object garTank(i).objHighPoly, 0, 0, 0
Turn Object Right garTank(i).objHighPoly, garTank(i).AngleY#
Roll Object Right garTank(i).objHighPoly,garTank(i).RollAngle#
Pitch Object Up garTank(i).objHighPoly,garTank(i).PitchAngle#