Giter Club home page Giter Club logo

computer-graphics's Introduction

Computer-Graphics

Assignment 2: Robotic Body and Camera movement

Table of Contents

About the Project

Assignment 2: Robotic Body and Camera movement

-It's required to use the robotic arm designed in assignment 1 and draw a whole body with cubes and sphere for the head, implement all type of movements, and set up camera to move around the body using a mouse or keyboard keys.

Changes in code

  • Designed the body, head, knees, feet, shoulders, elbows, and hips; starting with glPushMatrix(); and ending with glPopMatrix(); for separation purposes:
    
    //Draw Body
    glPushMatrix(); //original push

    glRotatef(angle2, 1.0, 0.0, 0.0);
    glRotatef(angle, 0.0, 1.0, 0.0);
    glTranslatef(-1.0, 0.0, 0.0);
    glTranslatef(1.0, 1.0, -2.0);

    glPushMatrix(); //1
    glScalef(1.0, 2.0, 0.5);
    glutWireCube(2.0);
    glPopMatrix(); //1

    // Draw Head
    glPushMatrix(); //2

    glTranslatef(-1.0, 3.0, 0.0);
    glTranslatef(1.0, 0.0, 0.0);

    glPushMatrix(); //3
    glScalef(1.0, 1.0, 1.0);
    glutWireSphere(0.5, 10, 8);
    glPopMatrix(); //3

    glPopMatrix(); //2
  • Adjustments to glTranslatef() for each block to fit as a robotic body.

  • Added extra constraints to keyboard() for all keys to prevent unrealistic motion.

  • Added camera zoom in/out keys to keyboard(), keys of rotations about the horizontal direction and vertical direction to specialKeys() for each block to fit as a robotic body.

Issues encountered

  • After adding the camera keys, we encountered a weird movement and the body disappeared after a couple of rotations. The problem solved by revising the code and making sure we were working on the correct view and the camera-related functions were correctly implemented.

  • One of our friends "Youssef Mohamed" suggested creating a default case for the camera angles and link it with a keyboard key, it was a good idea and now key '0' is responsible for resetting the view angle.

  • Moreover, We Struggled a bit to understand and visualize the whole body with its rotations correctly.

Members

  • Name: Hassan Fathi Shelkami Sec: 1 | BN: 28

  • Name: Ammar Elsaeed Mohamed Sec: 1 | BN: 51

  • Name: Mostafa Mohamed Essam Sec: 2 | BN: 27

  • Name: Mostafa Mahmoud Abbas Sec: 2 | BN: 28

  • Name: Yasser Nasser Ahmed Sec: 2 | BN: 45

computer-graphics's People

Contributors

mostafaabbas-git avatar ammar-elsaeed avatar yasser1412 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.