texture a model

Blitz3D Forums/Blitz3D Programming/texture a model

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.

Figgered it out (maybe) but I still cant see the results of my works... Program no longer halts though!
; JUST to see if the card thing works... RWD
Graphics3D 800,600,32,1
SetBuffer BackBuffer()


camera=CreateCamera()
PositionEntity camera,0,10,0
;setup lighting
light=CreateLight()
RotateEntity light,45,0,0
AmbientLight 48,48,48    ; was 32,32,32

EntityType camera,1

card=LoadMesh("card.b3d") ; card b3d is a mesh with two faces FRONT and BACK labeled

texture=LoadAnimTexture("spades0-64.jpg",1,64,32,1,13) ; this texture exists and is in proper dir

cface=CreateBrush() ; example in b3d shows this is necessary

BrushTexture cface,texture,1,2 ; this is where the program halts!!!!!!!!!!!!!!!!!!!!!!!!!

plog=CountSurfaces(card) ; tells how many surfaces in b3d model
a=GetSurface (card,1) ; a becomes a surface name
b=GetSurface(card,2) ; b becomes a surface name
PaintSurface a,cface ; put texture cface on a

While Not KeyHit(1)


  UpdateWorld()
  RenderWorld()

Text 0,10,"SURFACES: "+plog
Text 0,20,"A: "+a
Text 0,30,"B: "+b


Flip
Wend
End
Well if someone wants the stuff I would gladly email it to them!
-RZ