normals help

Blitz3D Forums/Blitz3D Programming/normals help

Rob(Posted 2003) [#1]
Hi there,

Given nx,ny and nz (normals) how do we determine a slope value? for example when linepicking directly down we return these normals. I would like to translate them into a workable result: a slope value between 0 and 1, with 1 being vertical and 0 being horizontal.

I hope you can help :)

Rob


fredborg(Posted 2003) [#2]
slope# = 1.0-CollisionNY(blablabla)


Rob(Posted 2003) [#3]
Thanks :)


Floyd(Posted 2003) [#4]
If it's any help the components nx,ny,nz are also the direction cosines for the vector.

The normal vector has length 1 and can be considered as a direction.

nx = Cosine of angle between vector and positive X axis
ny = Cosine of angle between vector and positive Y axis
nz = Cosine of angle between vector and positive Z axis

So ACos() tells you the various angles.