drawing connection between 2 objects

Blitz3D Forums/Blitz3D Programming/drawing connection between 2 objects

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.

This is the function I use (nicked from a kind Blitzer). 'rope' is just a cylinder.

;--------------------------------------
Function RopeEntToEnt(rope, ent1, ent2)
;--------------------------------------
Local distance#
Local x1#,y1#,z1#,x2#,y2#,z2#
Local Radius#=0.5

ShowEntity rope
x1# = EntityX(ent1,True)
y1# = EntityY(ent1,True)
z1# = EntityZ(ent1,True)
x2# = EntityX(ent2,True)
y2# = EntityY(ent2,True)
z2# = EntityZ(ent2,True)
distance# = EntityDistance#(ent1, ent2)
FitMesh rope, -Radius# / 2, -Radius# / 2, 0, Radius#, Radius#, distance#
PositionEntity rope,x1#,y1#,z1#
PointEntity rope,ent2
End Function