Skip to content

adhadse/CGMMWithGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Graphics and Multi Media Practical programs in Go

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.

To run the application follow these Intstructions:

Make sure you have installed go, and specified GOPATH.

  1. You need C compiler as raylib depends on that, like Mingw-w64 or TDM-GCC. You can also build binary in MSYS2 shell.

  2. Install raylib-go by typing in terminal.

    go get -v -u github.com/gen2brain/raylib-go/raylib
  3. 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.

Algorithms covered:

  • 📜line.go

    1. DDA (Digital Differential Analyzer)
    2. Breseham algorithm
  • 📜clipping.go

    1. Cohen Sutherland clipping algorithm
  • 📜circle.go

    1. Bresenham circle drawing algorithm
    2. Mid point circle drawing algorithm
  • 📜fill.go

    1. Flood fill algorithm
    2. Boundary fill algorithm

The CGMM_test also contains a test animation function (a mini-game).

Other files:

  • 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.

Releases

No releases published

Packages

No packages published

Languages