Writing a custom model file format

Aidan Knight
  • Writing a custom model file format Aidan Knight

    I am using Ogre for my rendering engine, and I planned on just using the .mesh format that is setup by default with Ogre. However, I recently purchased a large number of 3d assets from a company, only to find out that they use 7 blend weights where as Ogre has a max limit of 4.

    I don't know much about modeling and animation (which is why I purchased the art) but just from thinking, it is probably fairly difficult to change something like this in the model without having to reanimate it.

    So this led me to think about a custom model format. I know the basics of what is stored, verts/polygons/etc, but I am wondering if this is something I am right in thinking I probably need to do? If so, are there any good resources on developing a custom model format? Tutorials/samples/anything would be great. So far all I have found is http://www.falloutsoftware.com/tutorials/gl/gl6.htm which is helpful but not complete.

  • Google returned this result on the GD.Net forums.

    Then again, could you use another existing mesh format with Ogre instead?

  • In OgreConfig.h you can find the OGRE_MAX_BLEND_WEIGHTS option. It is set to 4 by default and I never tried setting it to anything else myself, but it is worth a try. (You have to recompile Ogre afterwards of course.)

    The Ogre mesh file format itself has no limit for the number of bone assignments per vertex. The binary format simply stores bone assignment as arrays of {unsigned int vertexindex; unsigned short boneindex; float weight;}

    On the other hand, seven blend weights seems like overkill, so another way is to leave out the three assignments with the smallest weights and adjust the other four bone assignments.

c++ ogre file models
Related questions and answers
  • I am trying to get more experienced with Ogre 3D and I am following the basic tutorials on the website. All the code samples compile just fine. The first time I encountered an "error" was in Basic Tutorial 3. The code line where Visual Studio says something is not right is mTerrainGroup = OGRE_NEW Ogre::TerrainGroup(mSceneMgr, Ogre::Terrain::ALIGN_X_Z, 513, 12000.0f); Visual Studio compiles... the argument list" or if I mouse hover over Ogre::TerrainGlobalOptions() it says "Error: expected a type specifier I searched on Google but couldn't find my answer. I got about a year C++ experience

  • I'm fairly new to game development, played around with xna before and just learning OpenGL & c now and I'm interested to know which c/c++ based model animation libraries are out there and which you would recommend? I don't have any particular model format in mind yet but probably a format that is supported by a free modelling tool like Blender.

  • physics properties. I know there will be errors here as I get the items colliding with the ground but not with each other properly. So I would appreciate some input on what I am doing wrong. void...::toString(m_pNumEntities), "cube.mesh"); entity->setCastShadows(true); Ogre::AxisAlignedBox boundingB = entity->getBoundingBox(); // The ogre bounding box is slightly bigger so I am reducing... this on what I had done there, but modifying it to fit with Ogre. It is working but not correctly and I would like some help to understand what it is I am doing wrong. I have a state system and when

  • I am using Ogre3D, and have been using it for a while. Also lately, I have been using the Opengl Rendering system that is included in Ogre, only because Directx will not compile correctly(Will post errors on request through comment). But as of now the main problem is when i render my model(it is a plane with simple, unblended pixelated texture), it looks like this on my Laptop(Left Image... to be moved then so be it), but i felt it would fit here just a bit, since its a game-dev type question. Anyways, My compiler is MinGW that uses the IDE Code::Blocks. also the operating system that im

  • I was thinking about making smaller structures with the fTime variable each so I can have attribute keyframes, light keyframes and buffer keyframes, then make the node structure look like... that make really hard to work with when coding some functions that use them. I was thinking of making ie. SimpleMesh and HierarchyMesh objects, which will also require that the renderer can deal with different types of objects in the same scene. I was also thinking about making a MeshNode class and then make a Mesh object that contains them, but then I have some conflict on where to store some data

  • I have a simple question. For people that know and built ogre3D from source as a Static library, what is the order of which the libraries should be linked? The libraries I need to be organized are: Ogre Plugins 'libOgreMain.a' Ogre RenderSystems Boost(version 1.47)link Ogre's Dependencies The reason I'm asking is because in the Ogre forums, I have asked about this and didn't get a good reply... yet. The other reason is because even though I link to the boost library, I get this error: undefined reference to '_imp___ZN5boost6thread20hardware_concurrencyEv' My compiler is MinGW

  • Hey so i just learned about the i/o part of the STL, more specifically fstream. Although I can now save binary info and classes i've made to the hard drive, i am not sure how to define how the info should be read. I saw the answer for making a file format from [this][1] post: Typically you would define a lot of records/structures, such as BITMAPINFOHEADER, and specify in what order... (indicating structure begin, structures end, etc.) and strings in a custom-defined format. What i want to know specifcally is how to do this with the STL and C++... Since the format is meant

  • I am quite new to OpenGL, I have managed after long trial and error to integrate Nehe's Cel-Shading rendering with my Model loaders, and have them drawn using the Toon shade and outline AND their original texture at the same time. The result is actually a very nice Cel Shading effect of the model texture, but it is havling the speed of the program, it's quite very slow even with just 3 models on screen... Since the result was kind of hacked together, I am thinking that maybe I am performing some extra steps or extra rendering tasks that maybe are not needed, and are slowing down the game

  • I'm trying to find a solid architecture for authenticating users against a database. I have a game client, which I plan to serve up a request with. The transport doesn't really matter, but at this point I'm thinking HTTP and leveraging either SSL or WS-Security to ensure the encryption of data over the wire. I'd like to avoid middle-man attacks if possible so I'm leaning towards WS-Security even... it happen. Would something as simple as HTTP digest authentication work here? One constraint I have is access to libraries. If it's not free and can't be used in a commercial product then I can't

Data information