Hi!
The MD2 importer seems ready :
Cool, how much work was it? Does it support animation?
Itâs actually easy to support hardware accelerated keyframe animation. Just push your vertex data into two texcoord arrays, and lerp between those in the vertex shader. Keep in mind that youâll have to match every vertex of your indexed geometry in all keyframes. It gets really funny when the vertex-count in the keyframes do not match up.
Actually, I ported the MD2 importer of JMonkeyEngine to Ardor3D, I had to reorganize the whole source code because Renanse found it too dirty and he would have preferred rewriting it from scratch like the OBJ importer. I made some regression tests with several animated models, it works at least as much as the original MD2 importer. I tested the serialization too in order to be able to convert the MD2 model into Ardor3D binary format.
I worked on this about 10 hours. I could have rewritten it from scratch but it would have been useless as the MD2 importer of JME 2.0 was already quite reliable.
I have to update the game itselfâŚ
I cannot implement this with shaders as I still rely on OpenGL 1.3. Do you think my current port is not very efficient?
You have to change your point of view. You donât want to think about todays low-end, but what low-end gfx hardware will be around when you release your game. Donât focus on supporting a quickly diminishing group of users. Some smartphones (with latest OpenGL ES) donât even have a fixed function pipeline anymore. Use shaders, everywhere.
I donât want to choose, that is why I use an engine that works both on very low-end graphics cards and on high-end graphics cards.
I have nothing against shaders but I donât want to use features of Ardor3D requiring them and I donât want to implement features requiring them. Currently I implement my features without shaders; if it becomes unavoidable, I will make an effort. JOGL 2 includes some nice fixed function emulation
What do you mean exactly? I donât use immediate rendering and I rarely use functions that have been deprecated.
I was right, Ardor3D does not use old things like glTranslate, etc⌠but it still uses gl*Pointer instead of glVertexAttribPointer. Therefore, Iâm on the good road.
Hi!
I fixed my problem with Blender by doing this:
ln -s ~/path/to/blender/.blender ~/.blender
Now I can convert almost all formats to Collada format except the blend format and I have still the same problem, only the first frame of any animated model is exported.
Iâm aware of the limitations of the MD2 format but Iâm stuck to this, I donât want to spend my time in writing or porting some other loaders to Ardor3D except maybe for MD3.
Iâm going to spend some time on an optimization about that I spoke there:
http://www.java-gaming.org/index.php/topic,16094.msg183388.html#msg183388
Edit.: Iâve found a small bug but it should not be difficult to fix because I have commented a lot this part of the source code, it really helps. I advise everyone here and especially the beginners to get accustomed to comment their source code because it is really helpful and it is more pleasant for one self, you can spend much time in it when it is pleasant to read, you have less chances to get bored or to be fed up by your own code if you really understand it. It allows me to be able to resume programming after several months without worrying not to understand what I did.
Why not write a Wavefront obj importer that can import a list of files, and convert them into keyframes?
as blender has no problems exporting Wavefront as animation.
edit: or rather, simple modify the current OBJ importer to support an array of files.
Youâre right, it might be a solution, thanks.
Those files get horrendously huge if you have any amount of vertices. I tried that once and my app size was massive.
In that case, maybe make a universal array of files to -> keyframes (regardless of filetype). that way if you can only get a single frame at a time from any exporter, you can at least import all of them into ardor3D via an array.
Maybe I can convert .blend files to MD2, canât I do it with Blender?
yeah, as long as you have set up keyframes in blender.
then you should be able to export to .md2
Actually I donât think you need to set keyframes (though you obviously will set some if you want to see something moving) .
Each frame (not keyframe) in Blender Animation View corresponds to a keyframe in the MD2 format . Thatâs what I observed from the models I imported. And they work pretty fine, actually. I gave up looking for some other format since MD2 can do what I need .
I was debating on writing a tool that would load a bunch of OBJ files, compare vertices, and then spit out changed vertices each frame. It would theoretically take up less memory, but after thinking about it more I realized that it would be a pretty minor difference - most animations will move almost every vertex in the model. That being said, not storing normals and textures more than once will still reduce it to 1/3 size at the very least.
But overall itâs probably best to just implement a format that allows animation.
I agree on texcoords, but normals?!
The export from Blender format to MD2 does not work, it says âSelected Object must be a mesh to output as MD2â
In Blender: I just applied a texture to the default cube, and then unwrapped it. I didnt have any problems exporting it to â.md2â
you may need to make sure that you only selected the model you want to export, not the whole scene.
On the topic of writing your own model type, for my current engine I actual convert a list of objs to a openGL friendly format, saves alot of space and loading time.
basic process:
I go to the menu âSelectâ -> âSelect all by typeâ -> âMeshâ but I still have the same problem.