سؤال

I have a simple skeletal mesh created with Blender and I'm trying to export it in order to render it in OpenGL.

My question is: what is the simplest export format to use in order to analyze the mesh (especially the armature/bones) and render it in a C/C++ program?

I managed (without too many problems) to render the object in the mesh, so this is not a problem. I searched a lot and I tried different formats, but actually I'm facing difficulties with all of them. It would be great to use .obj but, according to my researches, it does not support bones.

Thus, what format should I use to (easily) parse bones?

هل كانت مفيدة؟

المحلول

The best solution is to write a custom script to export the mesh in a very easy-to-parse format.

Blender has a Python interpreter and it's quite easy to write a script, especially if you just want to export your mesh and don't have any desire to provide the community a new exporting script.

A nice place where to start is Blender 3D: Noob to Pro/Python Scripting

Unfortunately Blender API changed a lot from version 2.4x to 2.5 and above, thus that tutorial is no more up to date (even if still may be useful).
Thus the best place (until the moment I write I didn't find many good tutorials on Blender 2.6x scripting) where to find material is Blender documentation.
Besides, it's Python, so everyone can rely on Python's syntax and constructs and the web is full of Python's tutorials.

نصائح أخرى

The DirextX .X format supports bones.

I do not know if the Blender exporter supports the bones.

In general people tend to write their own file formats to tightly fit their requirements.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top