init commit

This commit is contained in:
2025-06-11 22:45:11 +08:00
commit 71307f3e53
115 changed files with 13922 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include "math/dvc_vector3.h"
struct Triangle
{
public:
davinci::fVector3 p0, p1, p2;
davinci::fVector3 pixelColor;
std::vector< std::pair<int32_t, int32_t> > pixels;
public:
Triangle(){}
Triangle(const davinci::fVector3& _p0, const davinci::fVector3& _p1, const davinci::fVector3& _p2) : p0(_p0), p1(_p1), p2(_p2) { }
Triangle(const Triangle& other) : p0(other.p0), p1(other.p1), p2(other.p2), pixelColor(other.pixelColor), pixels(other.pixels) {}
public:
void build(const davinci::fVector3& _pixelColor, int32_t canvasWidth, int32_t canvasHeight, bool debug = false);
};
typedef std::vector<Triangle> TriangleVector;