@djtoon: sorry man, i wish i knew about it more.
@kanonet:
Yoo hoooo Kano, Draw2() here
// Cylindrical Billboards
// This billboard will only be rotated on Y axes, when the camera moves(not when camera rotates).
// This billboard is rigid on the Y axes, it only rotates facing the camera position.
// When the camera looks around(rotates), the billboard won't move.
// Is this method faster? I dont know. Its good for trees and lightning =D
// This billboard is mid handled.
// X,Y,Z are the billboard xyz coords
// CameraX, CameraY, CameraZ are the camera position
// Scale is absolute, in metric opengl coordinates 1:1, it will increase billboard size.
// rotation shouldnt need to be used, but you can use it to spin the billboard.
// use X_SETTEXTURE #,-1 to set the billboard image after you call type.start()
// -Neil Silver, aka Hemlos on GLBasic forums, hemlos@ymail.com
FUNCTION Draw2%: X#,Y#,Z#, CameraX#, CameraY#, CameraZ#, scale#=1.0, rotation#=360.0
LOCAL CMX#, CMY#, CMZ#, pwidth#, nscale#, pscale#, angx#, angy#
LOCAL vx1#, vy1#, vz1#, vx2#, vy2#, vz2#, vx3#, vy3#, vz3#, vx4#, vy4#, vz4#
rotation=rotation-45.0
angy=angy-(qATAN2((X-CameraX)*-1.0,(Z-CameraZ)*-1.0)-90.0)
width=scale*0.5; nscale=-width; pscale=width
vx1=qSIN(rotation)*qSIN(angy)*pscale; vy1=qCOS(rotation)*pscale; vz1=qSIN(rotation)*qCOS(angy)*nscale
vx2=qCOS(rotation)*qSIN(angy)*pscale; vy2=qSIN(rotation)*nscale; vz2=qCOS(rotation)*qCOS(angy)*nscale
vx3=-vx2; vy3=-vy2; vz3=-vz2; vx4=-vx1; vy4=-vy1; vz4=-vz1
self.vertices[0] = vx1 + X; self.vertices[1] = vy1 + Y; self.vertices[2] = vz1 + Z
self.vertices[3] = vx2 + X; self.vertices[4] = vy2 + Y; self.vertices[5] = vz2 + Z
self.vertices[6] = vx3 + X; self.vertices[7] = vy3 + Y; self.vertices[8] = vz3 + Z
self.vertices[9] = vx4 + X; self.vertices[10]= vy4 + Y; self.vertices[11]= vz4 + Z
?IF DEFINED( gl_gbas )
glVertexPointer( 3, GL_FLOAT, 0, self.vertices[] )
glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 )
?ELSE
INLINE
glVertexPointer( 3, GL_DOUBLE, 0, &this->vertices(0) );
glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 );
ENDINLINE
?ENDIF
ENDFUNCTION