This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import numpy as np | |
from clip import cohen_sutherland_clip | |
from colors import COLORS | |
WIDTH, HEIGHT = 600, 600 | |
run = True | |
clock = pygame.time.Clock() | |
pygame.init() | |
WIN = pygame.display.set_mode((WIDTH, HEIGHT)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Constants for outcodes | |
LEFT = 0b000001 # x < -w | |
RIGHT = 0b000010 # x > w | |
BOTTOM = 0b000100 # y < -w | |
TOP = 0b001000 # y > w | |
NEAR = 0b010000 # z < -w | |
FAR = 0b100000 # z > w | |
# Function to compute the outcode for a point | |
def compute_outcode(x, y, z, w): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Those that have Legacy instead of EFI can go to step 4) | |
For EFI there is one extra step: Mount your EFI partition | |
mount /dev/sda1 /mnt/boot/efi | |
Sometimes errors like this can result: mount: /mnt/boot/efi: mount point does not exist. | |
To solve it create the efi directory in /mnt/boot/ using this command: | |
mkdir /mnt/boot/efi |