Texturing a Mesh? How?

Blitz3D Forums/Blitz3D Programming/Texturing a Mesh? How?

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.

Why doesn't the following code texture a mesh?

  side = CreateMesh() 					

  sideTexture = LoadTexture("c:\blitz\bright.bmp")
  sideBrush = CreateBrush()                            
  BrushTexture(sideBrush, sideTexture)
    	
  sideSurface = CreateSurface(side, sideBrush)
  
  AddVertex sideSurface,-1,-1,-1             
  AddVertex sideSurface, 1,-1,-1 
  AddVertex sideSurface, 1,-1, 1 
  AddVertex sideSurface,-1,-1, 1

  AddTriangle sideSurface,0,1,2             
  AddTriangle sideSurface,0,2,3

  ; Paint the mesh with the textured brush?
  PaintMesh(side, sideBrush)