Skip to content

Versatile rendering widget implemented in C++ using the Qt framework and is built using CMake and use it to draw elementary shapes and functionality

Notifications You must be signed in to change notification settings

SarahAbuirmeileh/ComputerGraphics

Repository files navigation

Computer Graphics 💡

Overview

Welcome to the Table Lamp project, developed at Palestine Polytechnic University. This project provides a versatile rendering widget implemented in C++ using the Qt framework and is built using CMake. The widget is designed to facilitate the drawing of various geometric shapes, including lines, circles, ellipses, and arcs. Using these basic shapes I used them to draw a simple Lamp.

Whether you're a student exploring computer graphics or a developer seeking a lightweight graphics rendering tool, RenderWidget aims to meet your needs and goals. 🎯🔥



Features 💻

  1. Drawing Lines 📈
    The Render Widget supports two efficient functions for drawing lines - the Bresenham algorithm (draw Line) implementing in two ways , providing flexibility in line rendering.

  2. Drawing Circles ⚪️
    Efficiently draw circles using the incremental method.

  3. Drawing Arcs 🌈
    Specify the center, start angle, end angle, and radius to draw precise arcs using the drawArc method.

  4. Drawing Ellipses 🥚
    Create ellipses by specifying the center and major and minor axes with the drawEllipse method.

  5. Clipping Lines 📏
    Added functionality for clipping lines using the Cohen-Sutherland algorithm

  6. Filling Convex Polygons 🎨🖌
    Filling convex and H-convex polygons using scanline filling technique.



Drawing a Table Lamp 💡🛋️

The following picture show the table lamp that we draw using the simple functionality provided above.



Drawing a Car 🚗✨

The following picture show the car that we draw using the simple functionality provided above.



Note 📝

Dimensions of the level in which the drawing is made are like this:


But if you want to use this dimension ⬇️ you can call the functinn mapPoint(x,y) to map it to the original dimension