Archive Pages Design$type=blogging

Robot Computer Graphics Program in C

Presenting Robot Computer Graphics Program in C OpenGL. The robot look more a human touch with colorful clothes.

OpenGL is amazing, it have potential of great stuffs from creating a small triangle to big structures. We have seen many robot program in OpenGL. Here we come with another robot computer graphics program in C with the use of OpenGL API.


  • A human features with hands,legs, neck, head and face drawn with simple approach.
  • A colorful robot with animation made.
  • A dat file created that used as input for certain restrictions which we can't hard code in program.
  • Four header files used -
    1. vars.h - It contains all the global variables used in the program. Also have dimension for the body if the robot.dat is unreadable or not present.
    2. file.h -  This header used for reading input from robot.dat file.
    3. keyboard.h -  As name suggests it contains keyboard input functions.
    4. mouse.h - Same as keyboard.h, it also have mouse input functions.
  • Program uses selection buffer to determine what body part was selected, the judging by button pushed and mouse movement, the proper transformation is executed.

Main Functions

main();                            read data file, initialize glut stuff
     init();                              lighting and material stuff, initialize matrices to identity
     display();                        glut display function (calls display_robot(rendermode))
     display_robot(mode);    call each of the body part functions
     reshape_window();       glut reshape function

     draw_body(mode);        draw the torso and neck
     draw_head(mode);        draw the head and face
     draw_leftarm(mode);     draw all of the left arm
     draw_rightarm(mode);    draw all of the right arm
     draw_leftleg(mode);     draw all of the left leg
     draw_rightleg(mode);    draw all of the right leg

Mouse Interface:
   To translate the robot (x, y direction): click the right mouse button on the torso,
      and drag it around the screen.  Once the button is released, the robot will move (in
      the direction of the vector from where the button was pushed to where it was released)
   To move the robot forward and backward (z direction):
      right click once on the torso to move it forward
      left click once on the torso to move it backward
      note: the amount which the robot moves in the z direction for each click can be
        adjusted using the '-' and '+' keys.  (default == 0.2), each adjustment is by 0.2
   To rotate body parts or the torso(about x or y axis):
      left click on the body part you want to rotate. (hold in the button)
        then drag the mouse the direction you want the robot to rotate.
        upon release of the button, the rotation will occur.
        (the amount of rotation is the distance of the drag (in pixels) mod 360)
   To rotate about the z axis:
      click and drag with the middle button.  the amount of rotation is determined
        by the horizontal change (mode 360)

Keyboard Interface:
   Rotations:  push 'q' for x axis, 'w' for y, 'e' for z
               push 'Q' for -x, 'W' for -y, 'E' for -z
               then choose the body part with, 0-9, 'o','p','[',']'
                  0-torso, 1- head, 2-leftupperarm, 3-leftlowerarm, 4-leftwrist
                  5-rightupperarm, 6- rightlowerarm, 7- rightwrist,
                  8-leftupperleg, 9- leftlowerleg, 'o'- left foot,
                  'p'-rightupperleg, '['-rightlowerleg, ']'-right foot
               use same q,w,e and Q,W,E for axis/direction selection
               then push 't' to translate
               use + and - to adjust the amount of translation



3D Bi-Cycle 3D Game 3D Laptop 3D Objects 3D Projects 3D Zoo Algorithm Android Aquarium Bellman-Ford Algorithm B├ęzier curves Block Breaker Blockshooting Bucket Sort C# Chess Clock Code Blocks Colors Complex Project Complex Projects Crab Pong Cross Zero Doll DSAV Escapa Fighter Jet First Come First Serve Flag Flag Hoisting flag of usa Fluids Font Demo Games Gear Motion GlutDino Glutplane Graphics Editor iOS iPhone Java Java OpenGL Graphics Programming Light Torus Linked List Ludo Board Game Mancala board games Martyr’s Monument Memory blocks game Memory Game Menu Mickey Mouse Minesweeper Miniature Steam Engine moth Motion Blur MoveLight moving car Moving Ship Multiplex Networking Based Project Nuclear Power Plant Olympic opengl c++ examples OpenGL ES OpenGL Programming OpenGL Tutorial Origami OS Based Projects Paint Paper Folding Particles Drop Path Finding ping pong Pong Game Project Report Projects Report Puzzles qix like Queuqe Random Flowing lines Ray Rigid Body Rings Robot sample c++ opengl code Screen Saver Screen Saver Ship Shadow Cube Shadowfun Shaheed Minar Ship Iceberg Simple Drawing Simple Haloed Lined Wireframe Simple Move Light Simple Project Simulation SNAKE XENZIA GAME Solar system Sorting Space Invaders Sphere Spot Light Swing Stack Stars Taj Mahal The Edge Game Tic Tac Toe Tower of Hanoi Traffic Signal Transformation Triangular Animation Trippy Tutorial water ripple effects Whirlpool
OpenGL Projects: Robot Computer Graphics Program in C
Robot Computer Graphics Program in C
Presenting Robot Computer Graphics Program in C OpenGL. The robot look more a human touch with colorful clothes.
OpenGL Projects
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago