Skip to content

Display lines in Fyne using linear algebra! A simple demo of how linear algebra can be used for computer graphics.

License

Notifications You must be signed in to change notification settings

Jacalz/linedisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linedisp

Using coordinate matrices and linear algebra, we can project a 3D model on screen. A linear map using rotation and scale matrices allows support for both rotation and zoom. The lines are drawn entirely using the regular canvas.Line objects in Fyne.

matrix-display.webm

How it works

Multiple points are added together to form a coordinate matrix. We then tell Fyne to draw lines between all of the positions within the columns of the coordinate matrix. We can then simply use matrix transformations to modify the coordinate matrix and thus also the view on screen.

For rotation with the mouse, it uses two threedimensional rotation matricies, those for X and Y rotation, multiplied together to a single matrix. This allows the view to be roteted only by multiplying one coordinate matrix (instead of two times) and then telling Fyne to re-draw it.

For scaling with the scroll whell, it uses a scaling matrix to make the view larger or smaller on the screen. Again, it is as simple as multiplying the the coordinate matrix and telling Fyne to re-draw it.

Built using

This project is built using the following projects:

License

Linedisp is licensed under the BSD 3-Clause License and freely avaliable to all of those that wish to use it.

About

Display lines in Fyne using linear algebra! A simple demo of how linear algebra can be used for computer graphics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Languages