Rem Project: Clock Challenge By TDK_Man Set Display Mode 1024,768,32 Sync On Sync Rate 0 Set Text Transparent AutoCam Off Backdrop On Color Backdrop 0 Set Ambient Light 20: Hide Light 0 Make Light 1: R#=255: G#=255: B#=255: Color Light 1,RGB(255,255,255) Make Light 2: Color Light 2,RGB(255,255,255): SET SPOT LIGHT 2, 8, 29 Make Light 3: Color Light 3,RGB(255,255,255): SET SPOT LIGHT 3, 12, 24 Make Light 4: Color Light 4,RGB(255,255,255): SET SPOT LIGHT 4, 6, 40 True=1: False=0 Radius#=20.0: XDist#=Radius#: ZDist#=Radius# Gosub MakeCubes Position Camera 0,10,-20 Point Camera 0,0,0 Rem Main Loop Do T$=Get Time$() Gosub DecodeTime Gosub SetCubes Gosub Sparkle Sync Loop DecodeTime: Hr = Val(Left$(T$,2)) If Hr<13 PM=False If Hr=0 Then Hr=12 Else Hr=Hr-12 PM=True Endif M$ = Mid$(T$,4)+Mid$(T$,5): Min = Val(M$) Sec = Val(Right$(T$,2)) Return SetCubes: Rem AM/PM Cube Position If PM=True Position Object 133,-4.2,.7,4.5: Position Object 134,4.2,1.4,4.5 Else Position Object 133,-4.2,1.4,4.5: Position Object 134,4.2,.7,4.5 Endif Rem Hour Cube Position For N=1 To 12 HrPos#=(N-6.5)*2.1 If N=Hr Position Object N,HrPos#,1,2 Position Light 4, HrPos#, 7, 2 POINT LIGHT 4, HrPos#, 1, 2 Else If Object Position Y(N)>-0 Position Object N, Object Position X(N),Object Position Y(N)-.004,Object Position Z(N), Endif Endif Next N Rem Minute Cube Position For Ny=0 To 3 For Nx=1 To 15 ObjNum=Ny*15+Nx+12 MinPosX#=(ObjNum-(Ny*15)-20.0)*1.56 If ObjNum-13=Min Position Object ObjNum, MinPosX#, 0-(Ny*0.5)+.5, 0-(Ny*1.5)-1 Position Light 3,MinPosX#,0-(Ny*0.5)+6.5,0-(Ny*1.5)-.5 POINT LIGHT 3,MinPosX#,0-(Ny*0.5)+.5,0-(Ny*1.5)-1 Else If Object Position Y(ObjNum)>-0-(Ny*0.5) Position Object ObjNum, Object Position X(ObjNum),Object Position Y(ObjNum)-.004,Object Position Z(ObjNum), Endif Endif Next Nx Next Ny Rem Seconds Cube Position For Ny=0 To 1 For Nx=1 To 30 ObjNum=Ny*30+Nx+72 SecPosX#=((ObjNum-73)-(Ny*30)-14.5)*.77 If ObjNum-73=Sec Position Object ObjNum, SecPosX#, -2+.5, 0-(Ny*.9)-6.5 Position Light 2,SecPosX#,-2+3.0,0-(Ny*.9)-6.0 POINT LIGHT 2,SecPosX#,-2+.5,0-(Ny*.9)-6.5 Else If Object Position Y(ObjNum)>-2 Position Object ObjNum, Object Position X(ObjNum),Object Position Y(ObjNum)-.004,Object Position Z(ObjNum), Endif Endif Next Nx Next Ny Return MakeCubes: Set Text Font "Arial" Set Text Size 36 Ink 0,0 Rem Hour Cubes For N=1 To 12 CLS RGB(255,100,100) If N<10 Text 4,2,"0"+Str$(N) Else Text 4,2,Str$(N) Endif Get Image N,0,0,64,64 Make Object Cube N,2 Texture Object N,N HrPos#=(N-6.5)*2.1 Position Object N,HrPos#,0,2 Next N Rem Minute Cubes For Ny=0 To 3 For Nx=1 To 15 ObjNum=Ny*15+Nx+12 CLS RGB(100,255,100) If ObjNum-13<10 Text 4,2,"0"+Str$(ObjNum-13) Else Text 4,2,Str$(ObjNum-13) Endif Get Image ObjNum,0,0,64,64 Make Object Cube ObjNum,1.5 Texture Object ObjNum,ObjNum Scale Object ObjNum,100,100,70 MinPosX#=(ObjNum-(Ny*15)-20.0)*1.56 Position Object ObjNum, MinPosX#, 0-(Ny*0.5), 0-(Ny*1.5)-1 Next Nx Next Ny Rem Seconds Cubes Set Text Size 32 For Ny=0 To 1 For Nx=1 To 30 ObjNum=Ny*30+Nx+72 CLS RGB(100,100,255) If ObjNum-73<10 Text 1,1,"0"+Str$(ObjNum-73) Else Text 1,1,Str$(ObjNum-73) Endif Get Image ObjNum,0,0,36,36 Make Object Cube ObjNum,.70 Texture Object ObjNum,ObjNum SecPosX#=((ObjNum-73)-(Ny*30)-14.5)*.77 Position Object ObjNum,SecPosX#, -2, 0-(Ny*.9)-6.5 Next Nx Next Ny Rem AM/PM Cubes Set Text Size 36 CLS RGB(255,100,255) Text 4,2,"AM" Get Image 133,0,0,56,48 Make Object Cube 133,2 Scale Object 133,400,100,100 Texture Object 133,133 Position Object 133,-4.2,.7,4.5 CLS RGB(255,100,255) Text 4,2,"PM" Get Image 134,0,0,56,48 Make Object Cube 134,2 Scale Object 134,400,100,100 Texture Object 134,134 Position Object 134,4.2,.7,4.5 Set Text Opaque Set Text Size 16 Ink RGB(255,255,255),0 Return Sparkle: Rem Try to add a bit of sparkle to a drab program! :) X# = WrapValue(X# + .05): Z# = WrapValue(Z# + .05) If ChangeCol=0 REnd=Rnd(255): GEnd=Rnd(255): BEnd=Rnd(255) ChangeCol=1 Else If REnd>Int(R#) Then Inc R#,.1 If REnd<Int(R#) Then Dec R#,.1 If GEnd>Int(G#) Then Inc G#,.1 If GEnd<Int(G#) Then Dec G#,.1 If BEnd>Int(B#) Then Inc B#,.1 If BEnd<Int(B#) Then Dec B#,.1 Color Light 1, RGB(R#,G#,B#) If REnd=Int(R#) and GEnd=Int(G#) and BEnd=Int(B#) Then ChangeCol=0 Endif Position Light 1, newxvalue(0,X#,XDist#),newyvalue(0,5,5)+5,newzvalue(0,Z#,ZDist#) Return