multiple textures on one cube

Blitz3D Forums/Blitz3D Programming/multiple textures on one cube

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.

ok im still having a problem with this code.


Graphics3D 640,480
camera=CreateCamera()
PositionEntity camera,0,0,-5

tex1=LoadBrush("double bar.jpg")
tex2=LoadBrush("double bar.jpg")
tex3=LoadBrush("double bar.jpg")
tex4=LoadBrush("double bar.jpg")
tex5=LoadBrush("double bar.jpg")
tex6=LoadBrush("double bar.jpg")


cube=CreateMesh()
surf1=CreateSurface(cube,tex1)
surf2=CreateSurface(cube,tex2)
surf3=CreateSurface(cube,tex3)
surf4=CreateSurface(cube,tex4)
surf5=CreateSurface(cube,tex5)
surf6=CreateSurface(cube,tex6)

AddVertex(surf1,1,1,1)
AddVertex(surf1,1,-1,1)
AddVertex(surf1,-1,-1,1)
AddVertex(surf1,-1,1,1)
AddTriangle(surf1,2,1,0)
AddTriangle(surf1,3,2,0)

AddVertex(surf2,1,1,-1)
AddVertex(surf2,1,-1,-1)
AddVertex(surf2,-1,-1,-1)
AddVertex(surf2,-1,1,-1)
AddTriangle(surf2,0,1,2)
AddTriangle(surf2,0,2,3)

AddVertex(surf3,1,1,1)
AddVertex(surf3,1,-1,1)
AddVertex(surf3,1,-1,-1)
AddVertex(surf3,1,1,-1)
AddTriangle(surf3,0,1,2)
AddTriangle(surf3,0,2,3)

AddVertex(surf4,-1,1,1)
AddVertex(surf4,-1,-1,1)
AddVertex(surf4,-1,-1,-1)
AddVertex(surf4,-1,1,-1)
AddTriangle(surf4,2,1,0)
AddTriangle(surf4,3,2,0)

AddVertex(surf5,1,-1,-1)
AddVertex(surf5,-1,-1,-1)
AddVertex(surf5,-1,-1,1)
AddVertex(surf5,1,-1,1)
AddTriangle(surf5,2,1,0)
AddTriangle(surf5,3,2,0)

AddVertex(surf6,1,1,-1)
AddVertex(surf6,-1,1,-1)
AddVertex(surf6,-1,1,1)
AddVertex(surf6,1,1,1)
AddTriangle(surf6,0,1,2)
AddTriangle(surf6,0,2,3)


While Not KeyDown( 1 )

TurnEntity cube,7,0,0


UpdateWorld
RenderWorld

count_surf=CountSurfaces(cube)
Text 0,0,"This mesh has "+count_surf+" surface(s)"
Flip

Wend

End



When i run this the texture i want does not show up on the cube. its just grey. Could anyone tell me what is wrong.

Thanks

ps sorry i dont know how to put it in a code box.