TUER: Truly Unusual Experience of Revolution, FPS using JOGL

Hi!

The MD2 importer seems ready :

http://www.ardor3d.com/forums/download/file.php?id=300

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 :slight_smile:

What do you mean exactly? I don’t use immediate rendering and I rarely use functions that have been deprecated.

OpenGL ES:


http://www.jeffwofford.com/?p=698

OpenGL (non-ES) is moving in this direction too.

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” :frowning:

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:

  • create groups per material
  • remove any duplicate verticies
  • save only a single list of indicies for all key frames
  • have an option to calculate or store normals (smooth-solid-store)
  • store as dataOutput rather than text
  • also helps to group materials with alpha channels (aswell as 32bit textures) so they can be rendered last.

I go to the menu “Select” -> “Select all by type” -> “Mesh” but I still have the same problem.