Aligning the player to the ground

Blitz3D Forums/Blitz3D Programming/Aligning the player to the ground

JoshK(Posted 2004) [#1]
I am trying to fix it so that when my player goes prone, he gets aligned to the ground. It's harder than it sounds.

The player has a pitch and a yaw. Although I can find the normal of the triangle he is standing on, there doesn't seem to be any way to use that effectively. AlignToVector(entity,nx,ny,nz,2), and then applying the rotations, does nto produce the desired effect.


Dreamora(Posted 2004) [#2]
Use instead of nx, ny, nz
ObjectX + nx, ObjectY + ny, ObjectZ + nz

AlignToVector aligns the object to a point so if it is only used with nx, ny, nz it will result in a wrong result normally.


poopla(Posted 2004) [#3]

AlignToVector aligns the object to a point so if it is only used with nx, ny, nz it will result in a wrong result normally.



No.. it alings an entity to a vector :).

Just use AlignToVector, set to align your entity's Z axis to the vector. It will work.


Dreamora(Posted 2004) [#4]
Hmm in that case the translated helpfiles are buggy.
Thanks for the correction


AntonyWells(Posted 2004) [#5]
definitely alignTovector with a vector..I used it to let my soldiers go 'prone' against a wall, snake stylee.. works fine.


JoshK(Posted 2004) [#6]
Dude, you should be using axis 2, not axis 3, right? For some reason I am getting wack alignment.


Rob(Posted 2004) [#7]
0,1,2 are the axes


JoshK(Posted 2004) [#8]
No, it's 1,2,3.

I figured it out, it was because my terrain is scaledhuge, and I was using a vector in terrain space.