Moving in 3D

Blitz3D Forums/Blitz3D Programming/Moving in 3D

RGR(Posted 2004) [#1]
;-


jfk EO-11110(Posted 2004) [#2]
couldn't you align the sphere with vertexNX() etc. to the triangle?


RGR(Posted 2004) [#3]
;-


RGR(Posted 2004) [#4]
;-


jfk EO-11110(Posted 2004) [#5]
I am not a crack in things like this. for debuggin purposes you could use a linepick and then compare pickednx etc with other parameters.


RGR(Posted 2004) [#6]
;-


Jeppe Nielsen(Posted 2004) [#7]
Couldnīt you use a cross product for this?:
sx1#=(a_x0#-a_x1#)
sy1#=(a_y0#-a_y1#)
sz1#=(a_z0#-a_z1#)

sx2#=(a_x0#-a_x2#)
sy2#=(a_y0#-a_y2#)
sz2#=(a_z0#-a_z2#)

;cross product, a vector perpendicular to both sx1, and sx2 vectors:
cx#=(sy1*sz2)-(sz1*sy2)
cy#=(sz1*sx2)-(sx1*sz2)
cz#=(sx1*sy2)-(sy1*sx2)

;normalize
clen#=sqr(cx*cx+cy*cy+cz*cz)

cx=cx/clen
cy=cy/clen
cz=cz/clen

;position sphere, at distance away:

d#=5

PositionEntity sphere, m_x+cx*d , m_y+cy*d , m_z+cz*d



Hope this helps, as I am not entirely sure of what you want to do.


RGR(Posted 2004) [#8]
;-


Jeppe Nielsen(Posted 2004) [#9]
I am glad you could use it :)