P
P
PeroPero2017-02-22 20:42:25
C++ / C#
PeroPero, 2017-02-22 20:42:25

What is animation and how to eat it if OpenGL?

Hello. I deal with loading models, how to load obj files and what they represent, I figured out the little things. As I know obj format does not cope with animation, or rather it is not there.
So the question is what is the model with animation? What is the simplest model + animation format there is?
And as I understand it, OGL needs to feed the ready-made array of the "frame" before that, having calculated everything myself like this?
I'm new in this thread, I dug up a couple of articles on regular models on Google, but with animation it's more difficult. When requesting with #animation and #model, 90% of requests lead to models or all sorts of maxes.
Help whoever can. Maybe someone has some lessons, articles in the stash. Or just throw in #-tags to search.
Thank you all in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Shatunov, 2017-02-23
@PeroPero

Spine C runtime.
https://github.com/EsotericSoftware/spine-runtimes...
This is not a silver bullet or ideal practices. Perhaps, in terms of code, this is an example of the opposite, how you definitely don’t need to write code.
But in terms of implementing animations, this turnip will help you a lot.
The point is this. There is a model, it is static. There is a time interval (timeline), on this segment there are points - key frames. The key frame carries information about which part of the model and how to shift. The simpler the instruction in the keyframe, the more convenient. Many people like to separate scale, rotation and offset into different timelines.
OGL is not needed in this case, for the time being.
With the help of SRT timelines, you can animate objects in space as a whole, but if you want to animate parts of a model mesh in the same way, then difficulties will await you ahead.
Mesh animation is best implemented based on the skeleton. This case can no longer be described in a nutshell, it is better to read articles here.
www.gamedev.ru/code/terms/SkeletalAnim
www.gamedev.ru/code/articles/skeletal_animation
https://habrahabr.ru/post/219509/
https://habrahabr.ru/post/304042/
www.gamedev. en/code/articles/?id=4182
The essence of skeletal animation is that the model remains a model, only the bones of the skeleton are animated. And it is the bone animation that causes the mesh fragment to move.
Only one skeletal animation will not get you far anyway. When it is required to simultaneously use several skeletal animations on one model, if done in the forehead, the mesh will float in all directions.
To mix various skeletal animations, so-called Blend Trees are used (there are no links at hand, so sorry).
In general, this is what the animation looks like. We animate in the update cycle, we transform the vertices at the moment the frame is formed. We need OGL, in fact, to draw a mesh that has been stretched by animation.
You will only need OGL to directly animate meshes when you dive deep enough into animation, at which point you will fully understand what OGL is needed for this.

K
KickMicro, 2017-02-24
@KickMicro

A very good guy. In terms of ogl, I grew up on it. Yes, not on the pluses, but some exotic topics that are only available in Java are not covered there.
Watch and enjoy:
Part 1
https://www.youtube.com/watch?v=f3Cr8Yx3GGA
Part 2
https://www.youtube.com/watch?v=F-kcaonjHf8
Yes, in English, but who cares

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question