Challenge:
Version:
Invalid Entry - Reason: Used media
Winner?:
No
Code Snippet:
Rem Project: Island Demo Rem Created: 5/5/2006 9:26:06 PM Rem ***** Main Source File ***** rem ini sync rate 60:sync on:make camera 1:backdrop on:color backdrop 1,rgb(0,0,255) rem variables dim ripple(25*26) for t=0 to 25*25 : ripple(t)=rnd(350) : next t rem images load image "Grass00.jpg",2 load image "water.jpg",3 load image "sky.jpg",4 rem terrain make terrain 1,"Heightmap.jpg" texture terrain 1,2 position terrain 1,0,0,64 rem matrix make matrix 1,5000,5000,25,25 position matrix 1,-2500,0,-2500 prepare matrix texture 1,3,1,1 rem make sky sphere make object sphere 1,-5000 texture object 1,4 scale object texture 1,.5,.5 rem loop do rem make waves for x=1 to 24 for y=1 to 24 rem Get current height of matrix point h#=get matrix height(1,x,y) rem Find index to the right ripple height in array tt=x+(y*25) rem Choppyness if x<5 or x>20 or y<5 or y>25 choppy#=2.5 else choppy#=1.0 endif rem Change height of matrix point using ripple height set matrix height 1,x,y,h#+(cos(ripple(tt))*choppy#) rem Change the ripple height for next time ripple(tt)=wrapvalue(ripple(tt)+5) next y next x update matrix 1 rem rotate camera around island inc y#,0.4 y#=wrapvalue(y#) cx#=newxvalue(0,y#,-200) cz#=newzvalue(0,y#,-200) point camera 1,0,0,0 position camera 1,cx#,100,cz# sync loop