just for the sake of things
here is the code I modified
Rem Project: 12_AnimatedBillboards
Rem Created: May 20, 2013
Rem a idea by : Resourceful
Rem Built with DBP 7.62 on windows 7 home Premium 64 bit
Rem ***** Main Source File *****
sp init
backdrop on
color backdrop 0
sync on
sync rate 70
// load 4x4 fire texture
fireTexture = 1
load image "media\firetiles.bmp",fireTexture
//load loads image to be turned into txt
`the image should only be 2 colors
`white for the text
`black for the background
cls RGB(255,255,255)
load image "12_AnimatedBillboards-E_2.png",2
paste image 2,0,0
`gets image width and hight
Ix=image width(2)-1:Iy=image height(2)-1
`MAKE OBJECT BOX 201, Ix, 0.01, Iy
`position object 201, 0, -1.5 ,0
`color object 201,RGB(0,0,255)
dim Co(Ix,Iy)
for y=0 to Iy
for x=0 to Ix
col=point(x,y)
if col=>1 then col=1:Co(x,y)=col:cn=cn+1
next : next
obj = cn
position camera 0,50,-104
point camera 0,0,0
sync
// in this tutorial you will learn how to use animated textures on billboards
// and how to create simple fast flames with only 2 quads !!!
// Ok here begins the SPARK code :
// create system
billboardSystem = sp create system (0,0,0,0)
// we will add 2 groups. First group the flame billbords :
billboardGroup1 = sp add group (billboardSystem , obj , 0,0,0)
// we set it immortal.Be aware that particles are never become inactive ,
// so you need to delete them manually !!!
sp set group immortal billboardGroup1 , 1
// set the groups lifetime.This only affects interpolators such
// as atlas dimensions , scale etc .The particles are immortal so this command
// has no effect on particles ! In this case it controls the texture animation speed
sp set group lifetime billboardGroup1 , 3,3
// create a quad renderer with the 4x4 flame texture
renderer1 = sp set quad renderer (billboardGroup1 , fireTexture ,110,130,4,4,2)
// we don't want particles always face to camera , so we use a fixed orientation
// and set the angles
sp set quad orientation renderer1 , FIXED_ORIENTATION ,0,1,0,1,0,0
// we use a linear interpolator for PARAM_ATLAS_DIMENSIONS
// this way we ensure texture parts are played lineary from 0 to 16
// if reaches 16 it will start from the beginning
textureInterp = sp add interpolator (billboardGroup1 , PARAM_ATLAS_DIMENSIONS , 0,16,0)
// and finally we set the particles color to constant value
color = sp add rgba interpolator (billboardGroup1 , 0x999999E0)
// And now we add the second group for the billboards 2nd.This group will have
// exacly the same parameters as the first one !!! The only difference is
// the quad orientation.In this group particles will be square to particles in
// the first group !
billboardGroup2 = sp add group (billboardSystem , obj , 0,0,0)
sp set group immortal billboardGroup2 , 1
sp set group lifetime billboardGroup2 , 3,3
renderer2 = sp set quad renderer (billboardGroup2 , fireTexture ,110,130,4,4,2)
// set particles orthogonal to the particles in the first group...
sp set quad orientation renderer2 , FIXED_ORIENTATION ,0,1,0,0,0,-1
textureInterp = sp add interpolator (billboardGroup2 , PARAM_ATLAS_DIMENSIONS , 0,16,0)
color = sp add rgba interpolator (billboardGroup2 , 0x999999E0)
// and finally we load up the flames to display txt
for x=0 to Ix : `abs(Ix/2)
for y=0 to Iy : `abs(Iy/2)
`Finds Center
Cx=abs(Ix/2):Cy=abs(Iy/2) : `find center
`set postion of each flame
if Co(x,y)=>1
`puts object in place if it's part of the text
posx# = x-Cx : posz# = Cy-y
//particle 1
particle1 = sp add group particle ( billboardGroup1 , posx#,0,posz#)
// particle2 (square to particle 1)
particle2 = sp add group particle ( billboardGroup2 , posx#,0,posz#)
point camera 0,posx#,0,posy#
sync
ENDIF
next
next
point camera 0,0,0
position camera 0,50,-104
sync rate 60
do
rotate camera 0 ,camera angle x(0)+ mousemovey()*0.2 , camera angle y(0)+ mousemovex()*0.2 ,0
if upkey() = 1 then move camera 0,0.5
if downkey() = 1 then move camera 0,-0.5
set cursor 0,0
print "SPARK BILLBOARD DEMO 1"
print "PARTICLES RENDERED : " + str$( sp get particles count())
print
print "total Number of Points Created : "+str$(Cn)
`changes color of box under text
`color object 201,colz
`vv=vv+1:if vv=19 then vv=0:CLa=CLa+15:if CLa>255 then CLa=0:CLb=CLb+15:if CLb>255 then CLb=0:CLc=CLc+1:if CLc>255 then CLc=0
`colz=RGB(CLa,CLb,CLc)
sync
loop
remstart
I want to set up several ways for this to be built
will need to build a function for each
regular
2 way build in
2 way build out
to center
center out
4 way build in
4 way build out
8 way build in
8 way build out
random placement but compleat
spriral - 2 directions
transition between 2 or more
this hole thing will need to be turned into it's own function setup
to be incorperated in to other projects
remend
function Sp()
ENDFUNCTION
function SpA()
ENDFUNCTION
function SpB()
ENDFUNCTION
function SpC()
ENDFUNCTION
function SpD()
ENDFUNCTION
function SpE()
ENDFUNCTION
function SpF()
ENDFUNCTION
function SpG()
ENDFUNCTION
function SpH()
ENDFUNCTION
function SpI()
ENDFUNCTION
the image I used is attached
example 12 is the one I added too
I set the sync rate at 70 to have it build things quicker
and the array is used to store what spots get displayed
and there is count dun when it reads the image spot locations
so it know how man object are needed to be built
to move side ways - is to move forward
Since a Strait line gets thin fast