GithubHelp home page GithubHelp logo

kodiidok / glut-computer-graphics-2d-primitives-and-basics Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 452 KB

This repository contains a simple C program demonstrating 2D graphics using the OpenGL Utility Toolkit (GLUT). The program creates a window and draws a square that can be manipulated using keyboard input.

License: MIT License

C++ 100.00%
2d-graphics cpp freeglut glut opengl

glut-computer-graphics-2d-primitives-and-basics's Introduction

Computer Graphics 2D Basics with GLUT

This repository contains a simple C program demonstrating 2D graphics using the OpenGL Utility Toolkit (GLUT). The program creates a window and draws a square that can be manipulated using keyboard input. The primary features include:

  • Square Manipulation: Use keyboard inputs ('w', 'a', 's', 'd', arrow keys) to move and scale a green square on the screen.
  • Visual Feedback: A label at the top of the window displays information about the last pressed key and its corresponding action.
  • Rotation Animation: The square rotates continuously, adding a dynamic visual element to the graphics.

2dbasicsglut

Features

  • Square Drawing: Utilizes OpenGL to draw a simple green square on a black background.
  • Circle Drawing: Implements a function to draw a green circle with specified radius and segments.
  • Axes Drawing: Renders red (x-axis) and blue (y-axis) lines to represent coordinate axes.
  • Keyboard Interaction: Responds to both regular and special (arrow keys) keyboard inputs for square movement and scaling.
  • Label Display: Shows a label indicating the last pressed key and its associated action.
  • Rotation Animation: Implements a timer function for continuous rotation of the square.

Usage

  1. Clone the repository to your local machine.

    git clone https://github.com/your-username/computer-graphics-2d-basics-glut.git
  2. Open the project in an OpenGL/GLUT compatible development environment, such as Visual Studio.

  3. Build and run the project to see the 2D graphics window with interactive square manipulation.

Note: Make sure to have the necessary GLUT and OpenGL dependencies installed to run the program successfully.

glut-computer-graphics-2d-primitives-and-basics's People

Contributors

kodiidok avatar

Stargazers

 avatar

Watchers

 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.