Code Help please :)

Blitz3D Forums/Blitz3D Beginners Area/Code Help please :)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Graphics3D 800,600,0,2
SetBuffer BackBuffer()

camera=CreateCamera()
CameraViewport camera,0,0,800,600

light=CreateLight()

col=8 : row=11 : total_cube=col*row : num=0 : spacer_cube=4 : xoffset#=24.1 : yoffset#=17.7
total_hexa=9 : spacer_hexa#=2.5

Dim cube(total_cube) 
Dim hexa(total_hexa)

plane=CreatePlane()
MoveEntity plane,0,0,25
RotateEntity plane,-90,0,0
EntityColor plane,0,50,255

ball=CreateSphere()
PositionEntity ball,0,0,35
PointEntity light,ball
PositionEntity light,0,0,0

; remove ball 2 later
ball2=CreateSphere()
PositionEntity ball2,0,0,5
ScaleEntity ball2,.5,.5,.5
; end of remove section

Dim sinetable#(360),costable#(360)

light_spacer=4
For angle = 0 To 359
	sinetable#(angle)=light_spacer*Sin(angle)
	costable#(angle)=light_spacer*Cos(angle)
Next



x#=0 : y#=0 : depth=22
For columns = 1 To col
	For rows = 1 To row
		num=num+1
		x#=rows*spacer_cube-xoffset#
		y#=columns*spacer_cube-yoffset#
		
		cube(num)=CreateCube()
		PositionEntity cube(num),x#,y#,depth
		EntityColor cube(num),0,120,255
	Next
Next

x#=-4.7 : y#=0 : depth=8 : offset_hex=8 : alpha#=.9 : hexa_scale#=1.5
For hexs=1 To total_hexa
	hexa(hexs)=CreateCube()
	y#=hexs*spacer_hexa#-offset_hex
	PositionEntity hexa(hexs),x#,y#,depth
	RotateEntity hexa(hexs),0,hexs*(90/total_hexa),0
	ScaleEntity hexa(hexs),hexa_scale#,1,hexa_scale#
	EntityColor hexa(hexs),100,100,255
	EntityAlpha hexa(hexs),alpha# 
Next

speed#=.03 : angle=0 : angle2=34
While Not KeyHit(1)

	For reps=1 To total_cube
		TurnEntity cube(reps),.5,1.2,1.3
	Next
	For reps=1 To total_hexa
		TurnEntity hexa(reps),0,1,0
		MoveEntity hexa(reps),0,-speed#,0
		If EntityY(hexa(reps)) <-10 Then PositionEntity hexa(reps),x#,12.5,depth
	Next
	
	; ball2 to remove after
	PositionEntity ball2,sinetable#(angle),costable#(angle2),5
	; end of remove section
	PositionEntity light,sinetable#(angle),costable#(angle2),5
	PointEntity light,ball
					
	angle=angle+1
	angle2=angle2+1
	If angle>359 Then angle=0
	If angle2>359 Then angle2=0

	RenderWorld
	
	Flip
Wend

End


Hi again !! :)

My demo is coming along nice now, got light source moving to a sine/cos wave and got plane sorted, one problem now though!!
How do I get shadows????