Page 1 of 1

wont work

Posted: Fri Jul 02, 2004 12:07 am
by thefool
Hi. This is my very first attempt to do 3d programming in PB.
But it always says that "#mesh is not intiaziled".
What do i do wrong?:

Code: Select all

If InitEngine3D()
Add3DArchive("data\",#PB_3DArchive_FileSystem)
InitSprite()
InitKeyboard()

OpenScreen(1024,768,32,"3d test")

LoadMesh(1,"mymesh.mesh")
LoadTexture(1,"mytex.jpg")
mymesh=MeshID(1)
CreateEntity(1,mymesh,CreateMaterial(1,TextureID(1)))

CreateLight(1,RGB(0,0,255),100.0,0,0)

CreateCamera(1,0,0,100,100)
CameraLocate(1,0,0,100)

Repeat
ClearScreen(0,0,0)

RenderWorld()
FlipBuffers()
ExamineKeyboard()

Until KeyboardPushed(#PB_Key_All)

EndIf
in the data\ dir i have 2 files:
Cube.mesh
mytex.jpg

Posted: Fri Jul 02, 2004 12:17 am
by Moonshine
"LoadMesh(1,"mymesh.mesh") "

and you say in your dir you have "cube.mesh". Is this the problem?

Posted: Fri Jul 02, 2004 8:32 am
by thefool
This was an very stupid mistake :oops:
but it still wont work.

Posted: Fri Jul 02, 2004 10:59 am
by Moonshine
Ive never messed with 3d in PB, Im just going off what I remember because im at college now, but isnt there a 3DScreenRequester command or something similar to that? Maybe thats your problem.

Posted: Fri Jul 02, 2004 11:00 am
by thefool
maybe.
anyone?

Posted: Fri Jul 02, 2004 12:02 pm
by GreenGiant
I put a mesh and a jpeg in a folder, changed the file names on your code and ran it and it displayed the mesh with the texture fine for me. I think there must be a problem with your file names, or maybe your cube.mesh is corrupt. The code's fine as long as the paths to the files are right.

Posted: Fri Jul 02, 2004 3:08 pm
by thefool
thanks.
I will look at the mesh.

Posted: Fri Jul 02, 2004 3:17 pm
by thefool
could it be a problem that my meshes are made to a newer version of ogre?

My modeller generates an ogre.xml.
I downloaded the official ogre command line tools, that have a converter.
It runs without errors.

But if i open the robot.mesh (from PB examples) in notepad the header says "MeshSerializer_v1.00" and my mesh has "MeshSerializer_v1.20"?

the mesh file seems to be ok.

Posted: Fri Jul 02, 2004 3:22 pm
by thefool
My ogre cmd tools generate meshes that are too new for pb's ogre.
It cant read them. How to deal with this?

(i also posted this in beginners section--)

Posted: Fri Jul 02, 2004 3:58 pm
by Comtois
while waiting for the update of the 3d, you can use old tools from ogre , it is compatible with PB.

http://perso.wanadoo.fr/comtois/sources ... 0.11.1.zip

Posted: Fri Jul 02, 2004 4:32 pm
by thefool
thanks