Centre of all the Cubes?

Blitz3D Forums/Blitz3D Beginners Area/Centre of all the Cubes?

Hotshot2005(Posted 2009) [#1]
I trying get Camera inside the middle of all the cube around it then spin the camera around with all the cube around it

I want my camera to be CENTRE OF ALL CUBE 

Graphics3D 640,480,16,2
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,10,10,1000
; Set camera range
CameraRange camera,1,1000

light=CreateLight()
RotateEntity light,90,0,0

Dim Cube(2100)

For i=1 To 2000
cube(i)=CreateCube()
    PositionEntity cube(i),Rnd(1000),Rnd(1000),Rnd(1000)
Next 

While Not KeyDown(1)
For i=1 To 10
    TurnEntity Cube(i),1,1,1
Next
TurnEntity camera,0,1,0

RenderWorld
UpdateWorld

Flip

Wend




stayne(Posted 2009) [#2]
You are positioning all your cubes in front of the camera only. Try positioning them all around the camera...

PositionEntity cube(i),Rnd(-1000,1000),Rnd(-1000,1000),Rnd(-1000,1000)

That way they will be placed randomly behind, in front, at both sides and up/down.


Hotshot2005(Posted 2009) [#3]
thank you stayne