( Creates a saturnus planet with rings consisting of particles ( --------------------------------------------------------------- 6.28 FCONSTANT PI2 ( Modify these values to suit your needs 0.01 FCONSTANT fPartSize ( size of one particle 1.0 FCONSTANT fPlanetSize ( sizeo of the planet to be created 100 CONSTANT iPartCnt ( number of particles in one ring 10 CONSTANT iCircCnt ( number of rings ( Material for planet iLOCK_EXCL MAT_LOCK "planet" ( name ) 0 ( specularity ) 25 ( specbright ) 0 ( brilliancy ) 0 ( transparency ) 0 ( turbidity ) 0 ( refraction ) 0 ( currindex ) 100 ( effectiveness ) 0 ( density ) 0 ( roughness ) 204 ( flags ) 46 ( turbidpower ) 6 ( method ) 0 ( handler ) 0 ( txt_freqx ) 0 ( txt_freqy ) 0 ( sp_x ) 0 ( sp_y ) 1 ( sp_w ) 1 ( sp_h ) "" ( handler_prg ) "marble1" ( picture ) 0 0 0 0 ( transp.color ) 5 ( bumph ) 0 ( ditherscale ) 0 ( scopehandler ) "" ( scopeexpr ) 0 ( scope1 ) 0 ( scope2 ) 0 ( tcoorhandler ) "" ( tcoorexpr ) 0 ( tco1 ) 0 ( tco2 ) 0 ( bumphandler ) "" ( bumpexpr ) 0 ( bmp1 ) 0 ( bmp2 ) 0 ( colorhandler ) "" ( colorexpr ) 0 ( co1 ) 0 ( co2 ) 0 ( indexhandler ) "" ( indexexpr ) 0 ( id1 ) 0 ( id2 ) "CEND" MAT_CREATE DROP iLOCK_REMOVE MAT_LOCK ( Object Attributes for Particles. The color is generated randomly for ( each particle : Attributes ( - ) 255 RANDOM F* 255 RANDOM F* 255 RANDOM F* 0 ( RGBA ) "noname" 0 "CEND" ; ( This function creates the actual planet : CrPlanet ( - ) 2 ( subtype ) "level" ( name ) 0 ( flags ) "CEND" C_LEVEL O_CURRENT DROP 0 0 0 ( center fPlanetSize 0 0 ( a 0 fPlanetSize 0 ( b 0 0 fPlanetSize ( c Attributes C_ELLIPSOID DROP 0 0 0 ( center fPlanetSize 0 0 ( a 0 fPlanetSize 0 ( b 0 0 fPlanetSize ( c 255 255 255 0 ( RGBA ) "planet" ( name ) 2048 ( flags = texture ) "CEND" "planet" "SMAT" C_ELLIPSOID DROP O_GETCURR O_GETPAR O_CURRENT DROP ; ( This creates one particle in given position : CrParticle ( vCenter ) fPartSize 0 0 ( a 0 fPartSize 0 ( b 0 0 fPartSize ( c Attributes C_ELLIPSOID DROP ; ( Computes radius for particle in question : CrRad ( iCircOrd ) fPartSize 4 F* F* fPlanetSize 1.5 F* F+ fPartSize 0.3 F* RANDOM F* F+ ; ( Computes angle for particle in question : CrAngle ( iPartOrd ) iPartCnt F/ PI2 F* PI2 iPartCnt F/ RANDOM F* F+ ; : CrSaturnus iLOCK_EXCL O_LOCK CrPlanet iCircCnt 0 DO iPartCnt 0 DO I CrAngle SIN J CrRad F* I CrAngle COS J CrRad F* fPartSize RANDOM F* CrParticle LOOP LOOP iLOCK_REMOVE O_LOCK ; ( Create planet CrSaturnus ( get rid of defined words FORGET PI2