CreateTexture()

Blitz3D Forums/Blitz3D Programming/CreateTexture()

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

The example in the online docs works, but when I tried to texture a Plane with this, the colour doesn't work. It's all grey.

Graphics3D 1024,768,32,0
SetBuffer BackBuffer()
cam=CreateCamera()
CameraViewport cam,0,0,1024,768

PositionEntity cam,0,10,-20

light=CreateLight(1)
LightColor light,200,200,200
enemy=CreateCone(50)
EntityColor enemy,205,100,100
EntityShininess enemy,0.7

player=CreateCone(50)
EntityColor player,100,205,200
EntityShininess player,0.7

PointEntity cam,player
EntityParent cam,player

AmbientLight 100,100,100

Grid=CreatePlane(16)
GridT=CreateTexture(256,256,1)

SetBuffer TextureBuffer(GridT)
ClsColor 0,0,0
Cls
Color 200,200,255
Rect 32,32,213,213,1
Color 50,50,75
Rect 64,64,128,128,1
SetBuffer BackBuffer()

EntityTexture Grid,GridT

Espeed#=0.1
PSpeed#=0.1

While Not KeyDown(1)

Espeed#=Espeed#+0.01
Pspeed#=Pspeed#+0.01

MoveEntity enemy,0,0,Espeed#
MoveEntity player,0,0,Pspeed#

UpdateWorld
RenderWorld

Flip
Wend