; BrushTexture Example ; -------------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() light=CreateLight() RotateEntity light,45,45,0 ; A crate to paint. A brush is a 'paint recipe' applied with PaintEntity. crate=CreateCube() PositionEntity crate,0,0,5 tex_logo=LoadTexture("media/b3dlogo.jpg") tex_moss=LoadTexture("media/MossyGround.BMP") ; Give the brush its starting texture (the optional frame,index default to 0) brush=CreateBrush() BrushTexture brush,tex_logo PaintEntity crate,brush tex_name$="tex_logo" While Not KeyDown(1) ; Keys 1/2 choose the brush texture, then repaint the crate If KeyHit(2) BrushTexture brush,tex_logo PaintEntity crate,brush tex_name="tex_logo" EndIf If KeyHit(3) BrushTexture brush,tex_moss PaintEntity crate,brush tex_name="tex_moss" EndIf TurnEntity crate,0,1,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"1: logo texture 2: moss texture Arrows: camera Esc: exit" Text 0,20,"BrushTexture brush,"+tex_name Flip Wend End