a array position question

Blitz3D Forums/Blitz3D Beginners Area/a array position question

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.

Well, you are creating a multi-dimensioned array - which is okay. However, you are only creating one row of that array. You have realised (correctly) that arrays begin at 0 - however, you begin your loop at 1 - if you were looping through successive rows (which you are not currently doing) you would get problems with the 'rings' from a line appearing on another line.

Pretending you were doing it with a single shape - look at this example:

AppTitle "A test of mine"

Graphics3D 800,600,32,2

SetBuffer BackBuffer() 

cam1=CreateCamera()

light=CreateLight()

PositionEntity cam1,80,10,5

RotateEntity light,0,0,90

Dim box(9,9)
For mx = 0 To 9
For my = 0 To 9
	box(mx,my)=CreateCube()
	PositionEntity box(mx,my),mx*10,0,my*10
Next
Next


While Not KeyHit(1)

If KeyHit(88)=True Then enable=1-enable

WireFrame enable 

	If KeyDown(16)=True Then TurnEntity Cam1,.9,0,.9
	If KeyDown(18)=True Then TurnEntity Cam1,0,.9,.9
	If KeyDown(30) TurnEntity Cam1,0,9,0 
    If KeyDown(32) TurnEntity Cam1,0,-9,0 
    If KeyDown(31) MoveEntity Cam1,0,0,-.09
    If KeyDown(17) MoveEntity Cam1,0,0,.09

UpdateWorld 
RenderWorld 
Text 280,0,"Turn Right with D Letter"
Flip 
Wend 
End 


I just did that quickly - not checked the array positioning for accuracy - but you see the idea I am creating here.