CGMM Practical lab program written in Go
This repo contains variety of intersting agorithms I found in my Computer Graphics course I took in 5th semester (2021). For the purpose of plotting I am using raylib-go; Go bindings for original Raylib library written in C.
Make sure you have installed go, and specified GOPATH
.
-
You need C compiler as raylib depends on that, like Mingw-w64 or TDM-GCC. You can also build binary in MSYS2 shell.
-
Install raylib-go by typing in terminal.
go get -v -u github.com/gen2brain/raylib-go/raylib
-
Run Test functions written in
CGMM_test.go
using your text editor or using command line:go test -run <test_function_name> CGMM_programs
The command Line invocation may only respond with Pass/Fail if the test function don't initialize any GUI, ignoring any print statement.
In that case resort to running tests using your text editor or create a main function and invoke the test function.
-
📜
line.go
- DDA (Digital Differential Analyzer)
- Breseham algorithm
-
📜
clipping.go
- Cohen Sutherland clipping algorithm
-
📜
circle.go
- Bresenham circle drawing algorithm
- Mid point circle drawing algorithm
-
📜
fill.go
- Flood fill algorithm
- Boundary fill algorithm
The CGMM_test
also contains a test animation function (a mini-game).
utils.go
: Contains Utility functions used across the project.config.go
: Conatins global variables like max height and width of application window.go.mod
: Module file listing all other libraries the project depends upon.