Fast replacement for Line command?

Blitz3D Forums/Blitz3D Programming/Fast replacement for Line command?

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.

Hi big10p, I knocked this up for you. I hope it's what your after :)

;*** VectorGFX - R. Ferriby

Graphics3D 800,600,32,0
SetBuffer BackBuffer()
AntiAlias 1

Global camera%=CreateCamera()
PositionEntity camera,0,0,-40

vectorcube%=CreateVectorMesh()

AddVector(vectorcube,-1,-1,-1, -1,1,-1)      ; 0,1
VectorTo(vectorcube,1,1,-1)		     ; 1,2
VectorTo(vectorcube,1,-1,-1)		     ; 2,3
CloseVector(vectorcube,0,3)		     ; 3,0

AddVector(vectorcube,-1,-1, 1, -1,1, 1)	     ; 4,5
VectorTo(vectorcube,1,1, 1)		     ; 5,6
VectorTo(vectorcube,1,-1, 1)		     ; 6,7
CloseVector(vectorcube,7,4)		     ; 7,4

CloseVector(vectorcube,0,4)		     ; 0,4
CloseVector(vectorcube,1,5)		     ; 1,5
CloseVector(vectorcube,2,6)		     ; 2,6
CloseVector(vectorcube,3,7)		     ; 3,7

ScaleEntity vectorcube,10,10,10

WireFrame 1
While Not KeyHit(1)
	TurnEntity vectorcube,1,2,3
	RenderWorld
	Flip
Wend
End


Function CreateVectorMesh%()
	Local mesh%=CreateMesh()
	Local surf%=CreateSurface(mesh)
	EntityFX mesh,17
	Return mesh
End Function

Function AddVector(mesh%,x1#,y1#,z1#,x2#,y2#,z2#)
	Local surf%=GetSurface(mesh,1)
	Local v1%,v2%

	v1=AddVertex(surf,x1,y1,z1)
	v2=AddVertex(surf,x2,y2,z2)
	AddTriangle(surf,v1,v2,v1)
End Function

Function VectorTo(mesh,x2#,y2#,z2#)
	Local surf%=GetSurface(mesh,1)
	Local v1,v2%
	v2=AddVertex(surf,x2,y2,z2)
	v1=v2-1
	AddTriangle(surf,v1,v2,v1)
End Function

Function CloseVector(mesh,v1%,v2%)
	Local surf%=GetSurface(mesh,1)
	AddTriangle(surf,v1,v2,v1)
End Function


Cheers,

Roy