Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Simple skeleton in OpenGL using FreeGLUT

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2015
    Posts
    7

    Simple skeleton in OpenGL using FreeGLUT

    Hello, I want to draw simple skeleton of a man using glutSolidSphere and glutSolidCylinder.
    I want to have something like this, but in OpenGL:

    Image link

    So, I want to "connect" spheres using cylinders. I need this for animation. I want to animate those spheres using glTranslatef() and I have no idea how to animate those cylinders. Question is: how to use coordinates of those spheres to animate cylinders? Is it possible?

    P.S.
    Why I can't put a url in my post?
    Last edited by Dark Photon; 01-04-2016 at 06:29 AM.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,509
    Quote Originally Posted by iKubik View Post
    Why I can't put a url in my post?
    New users can't post image links (avoids spam from new users that have no interest in OpenGL). After a few posts you'll be able to post image links.

    To answer your original question, you first compute the two joint locations in some space. You then find the distance between those two points. That becomes your cylinder height. Before drawing the cylinder, you then put yourself in a space where one joint is at the origin and the other joint is oriented along the +Z axis. Then draw the cylinder.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •