I am not good on 3D and OpenGL or even in JOGL. Do you have a ready-to-run example and some animated model file to try this out. I was just able to tip you on java io streaming, but its nothing to do with 3d
Ive always thought a 3d model stuff is something out of my league, but browsing through your loader.java its actually a quite understandable and simple. Well, im sure there are a lot more behing the corner, but still…
What happens to the textures, I did not see any bindtexture commands. Or do MD model file even contain any texture file information?
Very minor “fix” or more like a syntax sugar fix.
public void draw(GL gl) {
// Get first frame or iterpolated anim frame
animFrame frame;
// Animate?
if (animate) {
createInterpolatedFrame();
frame = interpolatedFrame;
} else {
frame = frames[startFrame];
}
..continue..
}
Then few comments about the java coding style.
-
use FirstUpperProperCase for class names, even for nested classes:
private class AnimFrame
private class Face
-
java starting brackets to the line, not c/c++ style. This is Sun’s java style:
private class AnimFrame {
…
}
private int readByte {
…
}
for(int i…) {
…
}