Results 1 to 2 of 2

Thread: Giving an object 2 rot. points

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2012
    Posts
    2

    Giving an object 2 rot. points

    Hey everyone , and thank you for taking the time to read this
    (I am very new to Opengl)

    I created a puppet model : Head ,neck,body,2 arms , 2 legs.
    Each arm is made by 2 separate objects ( don't know if i should call them object just 2 stretched cubes).

    No with one button i have to make both parts move , having as a rotating point the <<arm of the puppet>>. After a long struggle i managed this.

    But now with a different button i have to move only the lower part , having as a rotation point the <<elbow of the puppet>>
    I managed that also , but then i couldn't get it to move with the upper part again when the appropriate button was pressed.
    (That is the code you see )
    Here is some of my code :

    glColor3ub(20,50,225); //LEFT UPPER ARM
    glPushMatrix();
    glTranslatef(33.0,-32.0,0.0);
    glRotatef(Upperrot,1.0,0.0,0.0);
    glTranslatef(0.0,15.0,0.0);
    glScalef(0.7,1.9,0.5);
    glutSolidCube(20.0);
    glPopMatrix();



    glColor3ub(20,50,225); //LEFT BOTTOM ARM
    glPushMatrix();

    glRotatef(0,0,0,0);

    glTranslatef(33.0,-72.0,0.0);
    glRotatef(Lowerrot,1.0,0.0,0.0);
    glTranslatef(0.0,-15.0,0.0);


    glScalef(0.7,1.9,0.5);
    glutSolidCube(20.0);
    glPopMatrix();


    With every Trasf and Rot affecting each other , i am losing my sanity.
    The only thing i have to change/add is on the left bottom arm.
    Any suggestions ? i have to add more glRotatef and glTransferf ? Can i even put pushmatix inside another pushmatrix ?

    I would appreciate your help , thank you very much !

  2. #2
    Junior Member Newbie
    Join Date
    Jan 2012
    Posts
    2

    Re: Giving an object 2 rot. points

    Problem solved
    Tried a bunch of different Trans and rotates after another and now it worked

Similar Threads

  1. Replies: 3
    Last Post: 10-30-2013, 02:58 PM
  2. Replies: 3
    Last Post: 01-01-2002, 01:23 PM
  3. get 2D points and create 3D object
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-10-2001, 08:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean