The Purebasic documents say: "Loads a new #Mesh from the disk. Mesh has to be in the OGRE .mesh format. To create or convert existing meshes into this format, some exporters exist (Milkshape, Lightwave, 3DS Max). More informations can be found directly on the OGRE website."
This is incorrect. No exporter exists for Milkshape (and don't argue with me about Milkshape, I've downloaded everything and installed it where it needs to be and the exporter doesn't work. Check your Milkshape.log file and you can see that it attempts to load the exporter.dll and then fails.)
Fred, is there anyway you can tweak the OGRE .dll engine to allow for the .x format and the .3ds format? Those who are making the OGRE 3D engine have made a serious mistake in not allowing these 2 model formats to be loaded into OGRE. Any serious 3D engine can at least load these models. Is there any way you can add these without trying to convince the OGRE project they should? Just sorta leave them in the dust on this 3D engine for Purebasic?
Creating Models
8OThis is incorrect. No exporter exists for Milkshape (and don't argue with me about Milkshape...
download this:
http://www.garyw.uklinux.net/3D/OgreMil ... porter.zip
copy all *.dll's into your Milkshape folder and then start Milkshape.
No exporter? tsk tsk!
I would love to see a more reliable exporter written though, this one crashes sometimes.
@Fred: Any chance of adding more formats to OGRE? or rewarding us with a *.x to *.mesh convertor?
If it still doesn't work you might want to copy the dll's (from the exporter) to your windows\system directory.. (can't exactly remember their names, but it was something like "devil.dll" or something..)
-Lars
-Lars
AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
Hmmm
Hmmm... the only thing that did was add the OGRE export option to Milkshape. I tried making a simple cube and exporting it as a .mesh file and Milkshape crashed and the .mesh file was not exported.
I re-booted my computer and using brute force tactics
I managed to export what I thought was a cube.mesh file (about 1K), but Purebasic was unable to read and kept giving the error "Terminate!" from C++ library.
Worse, if you open the .mesh file with notepad, it's not like the .x format where you can see the vertices data.
Basically, the most promising avenue at this time seems to be the file called MeshManual.pb which shows how to create a .mesh file by reading in data statements. We may be able to write a .mesh editor that exports these data statements. These data statements look alot like a .x file that you open with notepad. For example, this is the data of a cube.mesh file from the MeshManual file:
And here is the data of a cube.x:
Look at the Mesh Normals section above, it's practically identical to the Purebasic code, here are both the sections: first Purebasic:
And now the .x code:
I re-booted my computer and using brute force tactics
Worse, if you open the .mesh file with notepad, it's not like the .x format where you can see the vertices data.
Basically, the most promising avenue at this time seems to be the file called MeshManual.pb which shows how to create a .mesh file by reading in data statements. We may be able to write a .mesh editor that exports these data statements. These data statements look alot like a .x file that you open with notepad. For example, this is the data of a cube.mesh file from the MeshManual file:
Code: Select all
CubeVertices:
Data.f 0, 0, 0 ; Vertex index 0
Data.f 1, 0, 0 ; Vertex index 1
Data.f 1, 0, 1 ; Vertex index 2
Data.f 0, 0, 1 ; Vertex index 3
Data.f 0, 1, 0 ; Vertex index 4 - Note: exactly the same as above, but with 'y'
Data.f 1, 1, 0 ; Vertex index 5
Data.f 1, 1, 1 ; Vertex index 6
Data.f 0, 1, 1 ; Vertex index 7
CubeFacesIndexes:
Data.w 0, 1, 2 ; bottom face (clockwise as it's reversed...)
Data.w 2, 3, 0
Data.w 6, 5, 4 ; top face
Data.w 4, 7, 6
Data.w 1, 5, 6 ; right face
Data.w 6, 2, 1
Data.w 7, 4, 0 ; left face
Data.w 0, 3, 7
Data.w 5, 1, 0 ; back face
Data.w 0, 4, 5
Data.w 2, 6, 7 ; front face
Data.w 7, 3, 2
CubeTextureCoordinates:
Data.f 0 , 0.33 ; Vertex 0
Data.f 0.33, 0.33 ; Vertex 1
Data.f 0.33, 0 ; Vertex 2
Data.f 0, 0 ; Vertex 3
Data.f 0.66, 1 ; Vertex 4
Data.f 1, 1 ; Vertex 5
Data.f 1, 0.66 ; Vertex 6
Data.f 0.66, 0.66 ; Vertex 7
Code: Select all
xof 0303txt 0032
template XSkinMeshHeader {
<3cf169ce-ff7c-44ab-93c0-f78f62d172e2>
WORD nMaxSkinWeightsPerVertex;
WORD nMaxSkinWeightsPerFace;
WORD nBones;
}
template VertexDuplicationIndices {
<b8d65549-d7c9-4995-89cf-53a9a8b031e3>
DWORD nIndices;
DWORD nOriginalVertices;
array DWORD indices[nIndices];
}
template SkinWeights {
<6f0d123b-bad2-4167-a0d0-80224f25fabb>
STRING transformNodeName;
DWORD nWeights;
array DWORD vertexIndices[nWeights];
array FLOAT weights[nWeights];
Matrix4x4 matrixOffset;
}
Frame Scene_Root {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;
}
Frame Box01 {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;
}
Mesh {
24;
-0.700000;1.125000;-1.300000;,
-0.700000;-1.475000;-1.300000;,
1.725000;1.125000;-1.300000;,
1.725000;-1.475000;-1.300000;,
1.725000;1.125000;-1.300000;,
1.725000;-1.475000;-1.300000;,
1.725000;1.125000;1.300000;,
1.725000;-1.475000;1.300000;,
1.725000;1.125000;1.300000;,
1.725000;-1.475000;1.300000;,
-0.700000;1.125000;1.300000;,
-0.700000;-1.475000;1.300000;,
-0.700000;1.125000;1.300000;,
-0.700000;-1.475000;1.300000;,
-0.700000;1.125000;-1.300000;,
-0.700000;-1.475000;-1.300000;,
-0.700000;1.125000;-1.300000;,
1.725000;1.125000;-1.300000;,
-0.700000;-1.475000;-1.300000;,
1.725000;-1.475000;-1.300000;,
-0.700000;1.125000;1.300000;,
1.725000;1.125000;1.300000;,
-0.700000;-1.475000;1.300000;,
1.725000;-1.475000;1.300000;;
12;
3;0,2,1;,
3;1,2,3;,
3;4,6,5;,
3;5,6,7;,
3;8,10,9;,
3;9,10,11;,
3;12,14,13;,
3;13,14,15;,
3;20,21,16;,
3;16,21,17;,
3;18,19,22;,
3;22,19,23;;
MeshNormals {
24;
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;;
12;
3;0,2,1;,
3;1,2,3;,
3;4,6,5;,
3;5,6,7;,
3;8,10,9;,
3;9,10,11;,
3;12,14,13;,
3;13,14,15;,
3;20,21,16;,
3;16,21,17;,
3;18,19,22;,
3;22,19,23;;
}
VertexDuplicationIndices {
24;
20;
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
12,
6,
13,
7;
}
}
}
}
}
Code: Select all
Data.w 0, 1, 2 ; bottom face (clockwise as it's reversed...)
Data.w 2, 3, 0
Data.w 6, 5, 4 ; top face
Data.w 4, 7, 6
Data.w 1, 5, 6 ; right face
Data.w 6, 2, 1
Data.w 7, 4, 0 ; left face
Data.w 0, 3, 7
Data.w 5, 1, 0 ; back face
Data.w 0, 4, 5
Data.w 2, 6, 7 ; front face
Data.w 7, 3, 2
Code: Select all
3;0,2,1;,
3;1,2,3;,
3;4,6,5;,
3;5,6,7;,
3;8,10,9;,
3;9,10,11;,
3;12,14,13;,
3;13,14,15;,
3;20,21,16;,
3;16,21,17;,
3;18,19,22;,
3;22,19,23;;


