This commit is contained in:
2026-02-24 15:58:17 +01:00
parent d6d7ed02bb
commit 497e218eb9
10 changed files with 105 additions and 57 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef DELTA_GLOBALS
#define DELTA_GLOBALS
const int SIMULATED_WIDTH = 1200;
const int SIMULATED_HEIGHT = 800;
const int SIMULATED_WIDTH = 1920;
const int SIMULATED_HEIGHT = 1000;
const int FOCAL = 300;
#endif
+2
View File
@@ -36,6 +36,7 @@ class DeltaVector3 {
float dotProduct(const DeltaVector3 &vec) const;
float angleTo(const DeltaVector3 &vec) const;
float length() const;
DeltaVector3 crossProduct(const DeltaVector3 &vec) const;
};
@@ -59,6 +60,7 @@ struct DeltaModelConnector {
struct DeltaRenderTriangle {
DeltaVertex a, b, c;
std::string texID;
DeltaVector3 normal;
};
struct DeltaModel {
+1 -1
View File
@@ -8,7 +8,7 @@
// void rasterizeTriangle(SDL_Renderer *renderer, const DeltaVector2 &a, const DeltaVector2 &b, const DeltaVector2 &c);
void rasterizeTriangleFast(SDL_Surface* surface, const DeltaVector2& v0, const DeltaVector2& v1, const DeltaVector2& v2, uint32_t color);
void rasterizeTriangleSurface(DeltaAssetLoader& assets, std::vector<float>& depthbuffer, SDL_Surface* surface, const DeltaVector3& v0, const DeltaVector3& v1, const DeltaVector3& v2, const std::string& textureID, float u0, float v0_uv, float u1, float v1_uv, float u2, float v2_uv);
void rasterizeTriangleSurface(DeltaAssetLoader& assets, std::vector<float>& depthbuffer, SDL_Surface* surface, const DeltaVector3& v0, const DeltaVector3& v1, const DeltaVector3& v2, const std::string& textureID, float u0, float v0_uv, float u1, float v1_uv, float u2, float v2_uv, float shade);
void setPixel(SDL_Surface* surface, int x, int y, uint32_t color);
uint32_t getPixel(SDL_Surface* surface, int x, int y);
#endif