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.

First turn the 3D coordinates of both objects into 2D coordinates for the screen. You use the CameraProject command for this.

Each time you call CameraProject() it will place the results in ProjectedX() and ProjectedY(). Remember to draw your 2D graphics like Line after Renderworld though as Renderworld will draw over everything.

CameraProject camera,EntityX(ent1),EntityY(ent1),EntityZ(ent1)
x1=ProjectedX()
y1=ProjectedY()

CameraProject camera,EntityX(ent2),EntityY(ent2),EntityZ(ent2)
x2=ProjectedX()
y2=ProjectedY()

Line x1,y1,x2,y2