How to apply two textures to two sides of a cube

Blitz3D Forums/Blitz3D Programming/How to apply two textures to two sides of a 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.

Yes, maybe this example might be helpful:
Graphics3D 800, 600, 0, 2
SetBuffer BackBuffer()

;create texture that contains numbers
SetFont LoadFont("Arial", 20, 1)
tex = CreateTexture(16, 16, 1+8, 10)
For i = 0 To 9
	Color 255, 0, 0
	Rect 0, 0, 16, 16
	Color 255, 255, 0
	Text 8, 8, i, 1, 1
	CopyRect 0, 0, 16, 16, 0, 0, BackBuffer(), TextureBuffer(tex, i)
Next

;create new mesh
mesh = CreateMesh()

;create surface 1
surf1 = CreateSurface(mesh)

;create 4 vertices
v0 = AddVertex(surf1,  0,  1, 0, 1.0, 0.0)
v1 = AddVertex(surf1,  0, -1, 0, 1.0, 1.0)
v2 = AddVertex(surf1, -1, -1, 0, 0.0, 1.0)
v3 = AddVertex(surf1, -1,  1, 0, 0.0, 0.0)

;create 2 triangles
AddTriangle surf1, v0, v1, v2
AddTriangle surf1, v2, v3, v0

;create surface 2
surf2 = CreateSurface(mesh)

;create 4 vertices
v0 = AddVertex(surf2,  1,  1, 0, 1.0, 0.0)
v1 = AddVertex(surf2,  1, -1, 0, 1.0, 1.0)
v2 = AddVertex(surf2,  0, -1, 0, 0.0, 1.0)
v3 = AddVertex(surf2,  0,  1, 0, 0.0, 0.0)

;create 2 triangles
AddTriangle surf2, v0, v1, v2
AddTriangle surf2, v2, v3, v0

;create brush, used for painting on the mesh
brush = CreateBrush()

;create camera
cam = CreateCamera()
MoveEntity cam, 0, 0, -5

;used for delaying counter
nxt = MilliSecs()

;main loop
Repeat

	;w = wireframe
	WireFrame KeyDown(17)
	;turn mesh
	;TurnEntity mesh, 1, 2, 3

	;counter that puts number's digits into 'c1' and 'c2'
	If MilliSecs() > nxt Then
		nxt = nxt + 250
		cc = cc + 1
		c1 = (cc / 10) Mod 10
		c2 = cc Mod 10	
	End If	
	
	;----update texture-----

	;select texture for brush
	BrushTexture brush, tex, c1
	;assign brush to surface 1
	PaintSurface surf1, brush
	;select texture for brush
	BrushTexture brush, tex, c2
	;assign brush to surface 2
	PaintSurface surf2, brush


	;render world
	RenderWorld	
	Flip

;esc = exit	
Until KeyHit(1)

End