проведи рефакторинг кода. вот такое расположение файлов
Simple3DViewer [cgvsu]
│
├── src
│   └── main
│       └── java
│           └── com
│               └── cgvsu
│                   ├── math
│                   ├── model
│                   │   ├── Model
│                   │   └── Polygon
│                   ├── objreader
│                   │   ├── ObjReader
│                   │   └── ObjReaderException
│                   ├── render_engine
│                   │   ├── Camera
│                   │   ├── GraphicConveyor
│                   │   └── RenderEngine
│                   ├── GuiController
│                   ├── Main
│                   └── Simple3DViewer
│
├── resources
├── target
├── tests
│   └── cgvsu.iml
├── pom.xml
└── Simple3DViewer.iml

вот код который нужно подправить


package com.cgvsu.render_engine;

import javax.vecmath.Matrix4f;
import javax.vecmath.Point2f;
import javax.vecmath.Vector3f;


import javax.vecmath.*;

import com.cgvsu.model.Model;
import com.cgvsu.model.Polygon;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.paint.Color;

import static com.cgvsu.render_engine.GraphicConveyor.*;

public class RenderEngine {

    public static void render(
            final GraphicsContext graphicsContext,
            final Camera camera,
            final Model mesh,
            final int width,
            final int height) {
        // Инициализация Z-буфера
        float[][] zBuffer = new float[width][height];
        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++) {
                zBuffer[x][y] = Float.MAX_VALUE;
            }
        }

        Matrix4f modelMatrix = rotateScaleTranslate();
        Matrix4f viewMatrix = camera.getViewMatrix();
        Matrix4f projectionMatrix = camera.getProjectionMatrix();

        Matrix4f modelViewProjectionMatrix = new Matrix4f(modelMatrix);
        modelViewProjectionMatrix.mul(viewMatrix);
        modelViewProjectionMatrix.mul(projectionMatrix);

        final int nPolygons = mesh.polygons.size();
        for (int polygonInd = 0; polygonInd < nPolygons; ++polygonInd) {
            Polygon polygon = mesh.polygons.get(polygonInd);

            // Координаты и глубины трёх вершин треугольника
            Point2f[] resultPoints = new Point2f[3];
            float[] zValues = new float[3];

            for (int vertexInPolygonInd = 0; vertexInPolygonInd < 3; ++vertexInPolygonInd) {
                com.cgvsu.math.Vector3f vertex = mesh.vertices.get(polygon.getVertexIndices().get(vertexInPolygonInd));

                javax.vecmath.Vector3f vertexVecmath = new javax.vecmath.Vector3f(vertex.getX(), vertex.getY(), vertex.getZ());
                Vector3f transformedVertex = multiplyMatrix4ByVector3(modelViewProjectionMatrix, vertexVecmath);

                resultPoints[vertexInPolygonInd] = vertexToPoint(transformedVertex, width, height);
                zValues[vertexInPolygonInd] = transformedVertex.z;
            }

            // Растеризация треугольника
            rasterizeTriangle(resultPoints, zValues, zBuffer, graphicsContext);
        }
    }

    private static void rasterizeTriangle(Point2f[] points, float[] zValues, float[][] zBuffer, GraphicsContext graphicsContext) {
        // Цвета вершин треугольника
        Color colorA = Color.RED;
        Color colorB = Color.BLACK;
        Color colorC = Color.BLUE;

        // Bounding box треугольника
        int minX = Math.max(0, (int) Math.floor(Math.min(Math.min(points[0].x, points[1].x), points[2].x)));
        int maxX = Math.min(zBuffer.length - 1, (int) Math.ceil(Math.max(Math.max(points[0].x, points[1].x), points[2].x)));
        int minY = Math.max(0, (int) Math.floor(Math.min(Math.min(points[0].y, points[1].y), points[2].y)));
        int maxY = Math.min(zBuffer[0].length - 1, (int) Math.ceil(Math.max(Math.max(points[0].y, points[1].y), points[2].y)));

        for (int x = minX; x <= maxX; x++) {
            for (int y = minY; y <= maxY; y++) {
                // Вычисление барицентрических координат
                float lambda0 = ((points[1].y - points[2].y) * (x - points[2].x) + (points[2].x - points[1].x) * (y - points[2].y)) /
                        ((points[1].y - points[2].y) * (points[0].x - points[2].x) + (points[2].x - points[1].x) * (points[0].y - points[2].y));
                float lambda1 = ((points[2].y - points[0].y) * (x - points[2].x) + (points[0].x - points[2].x) * (y - points[2].y)) /
                        ((points[1].y - points[2].y) * (points[0].x - points[2].x) + (points[2].x - points[1].x) * (points[0].y - points[2].y));
                float lambda2 = 1.0f - lambda0 - lambda1;

                if (lambda0 >= 0 && lambda1 >= 0 && lambda2 >= 0) {
                    // Интерполяция z-координаты
                    float depth = lambda0 * zValues[0] + lambda1 * zValues[1] + lambda2 * zValues[2];

                    if (depth < zBuffer[x][y]) {
                        zBuffer[x][y] = depth;

                        // Интерполяция цвета
                        Color color = interpolateColor(lambda0, lambda1, lambda2, colorA, colorB, colorC);
                        graphicsContext.getPixelWriter().setColor(x, y, color);
                    }
                }
            }
        }
    }

    // Функция интерполяции цвета
    private static Color interpolateColor(float lambda0, float lambda1, float lambda2, Color colorA, Color colorB, Color colorC) {
        double red = lambda0 * colorA.getRed() + lambda1 * colorB.getRed() + lambda2 * colorC.getRed();
        double green = lambda0 * colorA.getGreen() + lambda1 * colorB.getGreen() + lambda2 * colorC.getGreen();
        double blue = lambda0 * colorA.getBlue() + lambda1 * colorB.getBlue() + lambda2 * colorC.getBlue();

        return new Color(red, green, blue, 1.0);
    }
}