ive been playing with a 3d particle engine, i named spritez3d...

its not done yet, because of an issue with opengl..z ordering.

heres some stuff you can use...

you can make a particle out of anything...even missles...

This creates a centered billboard

`FUNCTION EmitterSys_X_CreateSquare: Color`

//flat square object, facing +z direction

LOCAL GenObjNum=GENX_OBJ()

X_AUTONORMALS 2 // smooth edges

X_OBJSTART GenObjNum

X_OBJADDVERTEX 0.5,0.5,0, 1,0, Color

X_OBJADDVERTEX -0.5,0.5,0, 0,0, Color

X_OBJADDVERTEX -0.5,-0.5,0, 0,1, Color

X_OBJNEWGROUP

X_OBJADDVERTEX -0.5,-0.5,0, 0,1, Color

X_OBJADDVERTEX 0.5,-0.5,0, 1,1, Color

X_OBJADDVERTEX 0.5,0.5,0, 1,0, Color

X_OBJEND

RETURN GenObjNum

ENDFUNCTION

heres movement/rotation/scale code:

`FUNCTION EmitterSys_X_Trans3d: x,y,z , Scale , rx,ry,rz // x,y,z, Scale, Rx,Ry,Rz //move,scale,rotate an object`

// This function Handles 3d inputs for,

// Move, Scale, Rotate for 3d objects.

X_MOVEMENT x,y,z

X_SCALING Scale, Scale, Scale

IF rz<>0 THEN X_ROTATION rz,0,0,1

IF rx<>0 THEN X_ROTATION rx,1,0,0

IF ry<>0 THEN X_ROTATION ry,0,1,0

RETURN TRUE //pass completed, return=1 (BOOL=TRUE)

ENDFUNCTION

and heres the functions to properly rotate the particles to face the camera, or point a missle.

`@FUNCTION X_Vec2Rot: vX , vY , vZ`

//Vector XYZ is the input, transforms to rotations, for use with X_Rotation .

//Object Face must be created towards +Z, so a camera IN +Z pointing to 0,0,0 sees the face.

//Returns rotations X and Y

//

//

//

// Billboarding:

// Call these before X_ROTATION:

//

// DistanceX = CameraX - BillBoardX

// DistanceY = CameraY - BillBoardY

// DistanceZ = CameraZ - BillBoardZ

// X_Vector2Rot( DistanceX , DistanceX , DistanceZ )

// X_ROTATION AngleX2,1,0,0

// X_ROTATION AngleY2,0,1,0

//

//

//

// Missles Guidance:

// This will use the vector Vector(dist per frame) of the missle to guide the rotations.

// Just use the real 3d Vector:

//

// X_Vector2Rotation( VectorX , VectorX , VectorZ )

// X_ROTATION AngleX2,1,0,0

// X_ROTATION AngleY2,0,1,0

//

// AngleX2 AngleY2 are your global memories for the x_rotation

vX2 = X_Distance( 0.0 , vY , 0.0 , vX , vY , vZ )

AngleX = ATAN(-vX2 , -vY ) + 90.0

AngleY = ATAN( -vX , -vZ ) + 180.0

ENDFUNCTION

@FUNCTION X_Distance: x0,y0,z0, x1,y1,z1

//This function is used by FaceObject() Operations.

//It gives a distance between two points in 3d space.

//Vector 1 = x0,y0,z0

//Vector 2 = x1,y1,z1

// The return is the true distance between these 2 points. (Hypotenuese)

LOCAL x , y , z , xx , yy , zz

x = x0 - x1; y = y0 - y1; z = z0 - z1;

xx = x*x; yy = y*y; zz = z*z;

RETURN SQR( xx + yy + zz )

ENDFUNCTION

goodluck, i have been banging my head for years on this.