Hi, I have some questions that maybe are more related to game engine design than jPCt, but anyway
I am currently working on a little 3D-engine in Java using LWJGL just for learning purposes, and the last couple of days I have been reading a lot about 3D-mathematics. I have some questions on how jPCT has implemented translation/rotation-matrices.
I got a working Matrix-class to handle basic 4x4-matrix operations and a simple Vector-class. I've built a little polygon-system on top of that, so currently I can load OBJ-files.
My question is how to implement the translation- and rotation-matrices in my "Object3D"-class. I got functions in my Matrix class for transforming the Matrix (translate, rotate XYZ).
Should I store the location in a Vector and have a translationMatrix in the Object-class, and have a Object3D.translate-function something like this:
public void translate(Vector3D trans) {
this.translationMatrix.translate(trans);
this.location.mul(translationMatrix);
}
I am very green on this subject and I haven't found any good books/resouces for this (found A LOT of books on Matrices and 3D-math but none about how you actually implements them in your program). So I just wondered how you experienced programmers would do it