The specified textureID is null - error =>help!

Just starting out? Need help? Post your questions and find answers here.
bernardfrancois
User
User
Posts: 47
Joined: Tue Sep 02, 2003 9:17 am
Location: Belgium
Contact:

The specified textureID is null - error =>help!

Post by bernardfrancois »

Hello,

I'm new to PB, so in my first program I want to show a 3d model of a tank (in two parts - the bottom half and top half).

This is the code:



InitEngine3D()
InitSprite()
OpenScreen(800,600,32,"Tank")

Add3DArchive("data\",#PB_3DArchive_FileSystem)

LoadMesh(1,"bottom.mesh")
LoadMesh(2,"top.mesh")
LoadTexture(1,"tex.bmp")
CreateMaterial(1,TextureID(1))
CreateEntity(1,MeshID(1),MaterialID(1))
CreateEntity(2,MeshID(2),MaterialID(1))

CreateCamera(1,0,0,100,100)
CameraLocate(1,-10,-10,-10)
CameraLookAt(1,0,0,0)

CreateLight(1,RGB(150,150,150),0,0,15)

Repeat

RenderWorld()
a=a+1

Until a=10000




It gives an error in the creatematerial function: The specified textureID is null


Greetz,

Bernard
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yes, BMP textures are not supported. Use JPEG, PNG or TGA, as you like.
bernardfrancois
User
User
Posts: 47
Joined: Tue Sep 02, 2003 9:17 am
Location: Belgium
Contact:

Post by bernardfrancois »

thanks, the textureID-error is solved now (-:

but now I still dont see anything, just a black screen
whats wrong? the model should be in the range of the camera
it cant be a problem with the mesh file, coz I also tried a mesh file from the examples...

this is the slightly changed source code:

InitEngine3D()
InitSprite()
OpenScreen(800,600,32,"Tank")

Add3DArchive("data\",#PB_3DArchive_FileSystem)

LoadMesh(1,"bottom.mesh")
LoadMesh(2,"top.mesh")
LoadTexture(1,"tex.tga")
CreateMaterial(1,TextureID(1))
CreateEntity(1,MeshID(1),MaterialID(1))
CreateEntity(2,MeshID(2),MaterialID(1))

CreateCamera(1,0,0,100,100)
CameraLocate(1,-20,10,-20)
CameraLookAt(1,EntityX(1),EntityY(1),EntityZ(1))

CreateLight(1,RGB(250,250,250),0,30,0)

Repeat

RenderWorld()
a=a+1

Until a=30000
bernardfrancois
User
User
Posts: 47
Joined: Tue Sep 02, 2003 9:17 am
Location: Belgium
Contact:

Post by bernardfrancois »

coma helped me out: I had to add flipbuffers()
Post Reply