How to Make a Quad pont at Camera

Blitz3D Forums/Blitz3D Programming/How to Make a Quad pont at Camera

This is the kinda thing I use. It should be a fair bit faster with alot of particles ...

;p\size = size of particle ( assume square )
;p\Vertex = First vertex of 4 For this quad
;p\Pos = 3d coords of particle
;s = surface of particle mesh

;point quad to face the camera
TFormVector -p\size,0,0, Camera , 0
x1# = TFormedX()
y1# = TFormedY()
z1# = TFormedZ()
TFormVector 0,-p\size,0,Camera, 0
x2# = TFormedX()
y2# = TFormedY()
z2# = TFormedZ()
VertexCoords s, p\Vertex + 0 , p\Pos\x - x1 - x2 , p\Pos\y - y1 - y2 , p\Pos\z - z1 - z2
VertexCoords s, p\Vertex + 1 , p\Pos\x - x1 + x2 , p\Pos\y - y1 + y2 , p\Pos\z - z1 + z2
VertexCoords s, p\Vertex + 2 , p\Pos\x + x1 + x2 , p\Pos\y + y1 + y2 , p\Pos\z + z1 + z2
VertexCoords s, p\Vertex + 3 , p\Pos\x + x1 - x2 , p\Pos\y + y1 - y2 , p\Pos\z + z1 - z2