Skip to content

snk467/Bezier

Repository files navigation

Bezier

drawing PL

Autor: Sławomir Nikiel

Tematem projektu jest aplikacja z graficznym interfejsem użytkownika posiadająca następujące funkcjonalności:

  • Losowe generowanie krzywych Beziera
  • Zapisywanie i wczytywanie krzywych Beziera
  • Manipulowanie krzywymi Beziera
  • Wczytywanie obrazów z dysku
  • Animacja ruchu obrazu po zadanej krzywej
  • Animacja obrotów obrazu wokół środka
    • Obroty naiwne(macierz obrotów)
    • Obroty z filtrowaniem
  • Wyświetlanie obrazu w kolorze lub w odcieniach szarości

Projekt zrealizowany w ramach przedmiotu "Grafika Komputerowa" na wydziale MiNI Politechniki Warszawskiej.

Rozwiązanie

Program zrealizowany jest w języku C#, z użyciem WPF i .NET Framework 4.7.2. Do rysowania krzywych Beziera został wykorzystany algorytm de Casteljau[1], a zaawansowane obroty zrealizowane zostały metodą przycinania[2] (ang. roation by shearing). Interfejs aplikacji składa się z dwóch podstawowych elementów. W lewej części okna znajduje się menu pozwalające na ustawianie parametrów programu, natomiast w prawej przestrzeń na której wyświetlana jest aktualna krzywa oraz obraz. Podstawowy widok programu

Sterowanie

Pole "Number of points" określa liczbę punktów łamanej definującej krzywą Beziera. Przycisk "Generate" powoduje generowanie losowej krzywej o zadanej liczbie punktów kontrolnych. Checkbox "Visible polyline" określa czy łamana jest widoczna. Przyciski "Load a polyline" i "Save the polyline" odpowiadają odpowiednio za wczytywanie i szapisywanie krzywej. Kształ krzywej Beziera może być modyfikowany poprzez przesuwanie myszą czerwonych punktów kontrolnych.

Modyfikacja krzywej

Image

Przycisk "Load" odpowiada za wczytywanie obrazu z dysku komputera. Obraz pojawia się na początku wyświetlanej krzywej. Natomiast checkbox "Grey colors" definuje sposób wyświetalnia obrazu.

Rotating

Sekcja składa się z dwóch radiobutton'ów "Naive" i "With filtering" odpowiadających odpowiednio za obroty obrazka w sposób naiwny lub z filtrowaniem.

Obrót obrazu

Animation

Radiobutton'y "Rotation" i "Moving on the curve" odpowiadają za wybór rodzaju animacji. Przyciski "Start" i "Stop" odpowidnio uruchamiają lub zatrzymują animację.

Ruch obrazu

drawing ENG

Author: Sławomir Nikiel

The subject of the project is an application with a graphical user interface having the following functionalities:

  • Random generation of Bezier curves.
  • Saving and loading of Bezier curves.
  • Manipulating Bezier curves.
  • Load images from disk.
  • Animation of the image movement along a given curve.
  • Animation of image rotation around its centre.
    • Naive rotations (rotation matrix).
    • Rotations with filtering.
  • Image display in colour or in shades of grey

Project carried out as part of the "Computer Graphics" course at the MiNI Faculty of Warsaw University of Technology.

Solution

The program is realized in C# language, using WPF and .NET Framework 4.7.2. The de Casteljau algorithm was used to draw Bezier curves[1], and advanced rotations were realized as rotation by shearing[2]. The application's interface consists of two basic elements. In the left part of the window there is a menu allowing to set the parameters of the program, while in the right part there is a space where the current curve and image are displayed. Basic program view

Control

The field "Number of points" defines the number of points of a polygonal chain defining the Bezier curve. The "Generate" button generates a random curve with a given number of control points. The checkbox "Visible polyline" defines whether the polyline is visible. The buttons "Load a polyline" and "Save the polyline" are responsible for loading and saving the curve. The shape of the Bezier curve can be modified by moving the red control points with the mouse.

Curve modification

Image.

The "Load" button is responsible for loading an image from the computer disk. The image appears at the beginning of the displayed curve. And the checkbox "Grey colors" defines the mode in which the image is displayed.

Rotating.

This section consists of two radiobuttons "Naive" and "With filtering" which are responsible for rotating the image in a naive or filtered way.

Image rotation

Animation.

The "Rotation" and "Moving on the curve" radiobuttons are responsible for selecting the type of animation. The "Start" and "Stop" buttons start or stop the animation respectively.

Image movement

Translated with www.DeepL.com/Translator (free version)

About

Desktop application for drawing Bézier's curve and its interactive modification. Implemented with the use of C# and WPF.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages