LWJGL - How to get started with animation?

Hey everyone, this is my first post on this forum, and I hope to hang around a bit, and maybe in the future, share the project I’m working on :slight_smile:

I’m currently developing my first 3D game in Java. I’ve developed 2D games before, and worked with JME as well, but this is my first “real” attempt at rendering and sculpting a 3D world. I’ve familiarized myself with things like “vertices and indices” and “transformation matrices” which seemed very foreign at first, but have proven very easy to understand. I’m following a series of tutorials written by a Youtuber called “ThinMatrix”

Link:

My current code:
https://github.com/Ritsu95/3D-Game-Engine-ThinMatrix/commit/4519c85a9c5c29770bd74aa317e61d815f41cc57

Though, I seem to have run flat up against a wall! I have absolutely no idea on how to start with model animations. I’ve heard terms such as “rigging” before, but the concept is quite intimidating, being that I’ve got very little experience with things like Blender or any other modeling/animation software, and have even less experience actually writing the code to handle the animations themselves.

Would it be possible to provide me with a loose example based on the code provided, or some relevant literature that would guide me along my path?

Thanks,
Genome

Someone likely will help you better than I, but while you wait, this example seems like a really good first look at 3D work in LWJGL3. (To be clear, you may need the entire support library that class comes with this, but the other examples are nice too.)

As for rigging, I’ve only rigged in Autodesk Maya, but it was less hard than the actual modeling. That is merely to say, try not to be too intimidated. :wink:

Thanks for the example, it’s interesting to see how other people handle it. I’ve found that ThinMatrix’s tutorials are very helpful, but his code doesn’t ever look like anyone else’s and the only other library I’m using is Slick. It’s nice to be reliant on few external libs, but it really leaves me wondering what I’m missing out on.

I’ve also looked into JBullet for assistance with collisions and transformations, but I was never really able to grasp the concept.

Oh, I expected you’d get another response by now. I’ve gotten a lot of help so far for 2D stuff, tho the 2D crowd is probably bigger than 3D? Just by virture of 2D being 33% easier ;).

I wanted to read your post’s responses as I plan one day to do 3D with OpenGL too. I already do the modeling part. Would be really cool to get my models in a game world.

For rigging, I’d recommend you get your hands on a copy of a 3D modeler. In my experience, if you know one of them, you know them all (roughly). If you make a simple model, a cylinder for instance even, you can learn some things about rigging (ex. an arm rigging tutorial or a snake rigging tutoial). You understanding what is happening with rigging conceptually surely will aid you in properly programming whatever is related to it.

Edit: I want to add, if you know an arm rigging tutorial well enough, you know almost a full human already. You can loosely think of legs as 2 more arms. Torso is nothing but a bendy cylinder. A head has less huge movements, but the face rig is a big deal. However, if you understand weights and weight mapping (which you can see with an arm tutorial), and you understand handles (you should now too), you can learn to make a fine face rig. A good arm tutorial will get you a firm start in rigging. Your next hurdle after properly rigging a human would be properly animating a walk cycle.

I’ve rigged models before, with really loose tutorials I’ve found on Youtube for Blender, but I don’t quite understand how that correlates with the OBJ I’m rendering, and how to handle it in code. That’s my real issue, to be honest. After I figure out anims, I’ll move onto collisions which I imagine is going to force me to learn even more uncomfortable math haha.