Jump to content

  • Log In with Google      Sign In   
  • Create Account

Simple skinning example?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1   Members   -  Reputation: 131


Posted 06 August 2014 - 08:43 PM

I'm using the latest version of OpenGL and SDL 2.0. Here is my current rendering code to render an object:

    for(a=0;a<obj->total_tri;a++) {
        if(!a || obj->tri[a].tex!=obj->tri[a-1].tex) {



This renders objects correctly, but I am going to need to implement vertex buffer objects or whatever the most recent thing is. However, I will also need to implement skeletal animation.


All of the tutorials that I find do not do anything at a low level in C, and they make use of various libraries. Since I am using a custom format, though, these libraries will not be of much use.


Can anyone link to a simple tutorial that can explain this? What must be done is simple. There are two bones. The first bone rotates the entire object, while the second bone rotates half of the object. Skinning is to be used so some vertices from the second object stay at the end of the first object, like a snake.


A simple example using an object composed of two rectangles and with all of the values hard-coded will do. Thanks!

#2   Members   -  Reputation: 830


Posted 08 August 2014 - 02:09 AM

I would say don't bother with skeletal animation for now and just convert what you have already to using VBO's, as this could be a large chunk of work.

Once you have your code in a stable condition using the new approach then start to look at implementing skeletal animation. 



#3   Members   -  Reputation: 131


Posted 08 August 2014 - 02:59 AM

Thanks for the reply! I have been looking into VBOs, but I can't seem to incorporate this code without a crash occurring: http://www.opengl.org/wiki/VBO_-_just_examples


For now, it loads .obj files into a format that can be used to export to any format, so loading into a VBO would be simple if I could find a good VBO example. What I linked to seems to be simple, but it is crashing for me on the "glDrawElements" line. Most of the VBO examples I find are either incomplete code, or ten different header files that utilize over five libraries.


Do you have any links to concise code like this?: http://openglsamples.sourceforge.net/triangle.html



#4   Members   -  Reputation: 830


Posted 08 August 2014 - 03:31 AM

Personally I used http://open.gl/drawing . The tutorials and examples are very well set out and explained thoroughly. 


If you are struggling to get it implemented with your current code then create a much simpler case and maybe just output some predefined triangles as shown on the website.


hope this helps



#5   Crossbones+   -  Reputation: 2162


Posted 08 August 2014 - 01:58 PM

If you are using glVertex3f and friends, then you are *not* using the latest version of OpenGL.  You are, in fact, using legacy OpenGL.  Jordan already beat me to it (darn you sir) and I do recommend his link.


If you prefer to use legacy OpenGL (2.1) over core OpenGL (3.0+), then okay.  Occasionally, there may be a good reason for using legacy OpenGL.  For my latest title, I used legacy OpenGL to keep portability to OpenGL ES 2.0 easy (but it was still a mistake I regret).  


If you need a tutorial on bone animation, check out this these: 





Hope this helps,



Edited by blueshogun96, 08 August 2014 - 02:30 PM.

Follow Shogun3D on the official website: http://shogun3d.net

Posted Image Posted Image Posted Image Posted Image

"Yo mama so fat, she can't be frustum culled." - yoshi_lol

"One objection to a “critique of C#” would be that you can’t talk about C# without talking about the whole “.Net experience”. However, one can approach the topic of Hitler without a complete discussion of Nationalist Socialism, so I feel justified." - Steve White.

#6   Members   -  Reputation: 131


Posted 08 August 2014 - 05:39 PM

Thanks! These are very useful! I actually wrote an animation tool a while back that utilized CPU skinning, which was slow and glitchy, so I'm mostly just looking for skinning examples. This (http://www.codesampler.com/oglsrc/oglsrc_11.htm#ogl_skinning) is exactly what I was looking for recently, thanks! I found it a long time ago, but I couldn't seem to find it again until you linked to it. Thanks!

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.