3d Slope Maths

Blitz3D Forums/Blitz3D Programming/3d Slope Maths

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yeap.. sorted ! :)

3 pivot points + the main body shell
(Ya need the extra third pivot to counter the angle in all directions)

Here's my external functions if it helps:
Function fixentity_height(ent,ofx,ofy,ofz)
Pick=LinePick(EntityX#(ent,1),EntityY#(ent,1)+20,EntityZ#(ent,1),0,-30,0)
offset#=-(EntityY#(ent,1)-PickedY#())
MoveEntity ent,ofx,offset#+ofy,ofz
End Function

Function fixentity_rotation_height(ob1,ob2_f,ob3_s,ob4)

fixentity_height(ob1,0,0,0)
fixentity_height(ob2_f,0,0,0)
fixentity_height(ob3_s,0,0,0)

yo3#=ATan2 ( EntityY#(ob1)-EntityY#(ob2_f,1),0.4)
yo4#=ATan2 ( EntityY#(ob1)-EntityY#(ob3_s,1),0.2)

RotateEntity ob4,yo3#,0,-yo4#

End Function


Eventually I'll do away with the line picks, I know the Y height of quad patches - so I'll find out the vertexes of the nearest quad to the car, find out the difference between the height of the 2 points.. do a calculation to find the car position:

finally times the remainder (how far the car has travelled across a quad) by the height difference per width unit.

Should work... I think !