
//*********************************************************************************
//                          SPARK Wrapper PointMass Demo
//               Point mass modifier demonstration (One of my favorites)
//*********************************************************************************




backdrop on
color backdrop 0


load image "media\bigpoint.bmp",1

mySystem = sp create system (0,0,0,0)
myGroup = sp add group (mySystem , 2500 , 0.01 , 0,0,0)
sp set group lifetime myGroup , 13.5 , 13.5
myRenderer = sp set quad renderer (myGroup , 1 , 5,5,1,1,2)
scaleInterpolator = sp add interpolator (myGroup , PARAM_SCALE , 0.1 , 0.5 , 5 ,10)
angleInterpolator = sp add interpolator (myGroup ,PARAM_ANGLE, 0.01 , 2.2,0)

rgbaInterpolator = sp add rgba interpolator (myGroup , 0x0580DDE0 , 0x0580DD00 , 0)


emitter1 = sp add spheric emitter (myGroup , -1 , 4 , -1 , 0.01 , 0.03 , 30 , 0.5 , 0.8 ,-1 , sp point zone(0,0,0))
emitter2 = sp add spheric emitter (myGroup ,1 , 4 , -1 , 0.01 , 0.03 , 30 , 0.5 , 0.8 ,-1 , sp point zone(0,0,0))

emitter3 = sp add spheric emitter (myGroup , 1 , 4 , 1 , 0.01 , 0.03 , 30 , 0.5 , 0.8 ,-1 , sp point zone(0,0,0))
emitter4 = sp add spheric emitter (myGroup , -1 , 4 , 1 , 0.01 , 0.03 , 30 , 0.5 , 0.8 ,-1 , sp point zone(0,0,0))

// Try changing the parameters :
pmass = sp add pointmass modifier (myGroup ,2,2,2,20,0.1)



do
    
    position camera 0,0,0,0
rotate camera 0 ,camera angle x(0)+ mousemovey()*0.2 , camera angle y(0)+ mousemovex()*0.2 ,0
move camera 0,-10

    

    sp update
    
    
loop



