wont work

Advanced game related topics
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

wont work

Post 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
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

"LoadMesh(1,"mymesh.mesh") "

and you say in your dir you have "cube.mesh". Is this the problem?
Mark my words, when you least expect it, your uppance will come...
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

This was an very stupid mistake :oops:
but it still wont work.
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post 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.
Mark my words, when you least expect it, your uppance will come...
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

maybe.
anyone?
GreenGiant
Enthusiast
Enthusiast
Posts: 252
Joined: Fri Feb 20, 2004 5:43 pm

Post 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.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

thanks.
I will look at the mesh.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post 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.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post 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--)
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post 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
Please correct my english
http://purebasic.developpez.com/
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

thanks
Post Reply