c+WINAPIで3DCGの理屈その4
さて、前回のグーローシェーディング付きテクスチャーマッピングとフォンシェーディング付きテクスチャーマッピングはバグがあったのがなんとなく推察できたかもしれないですが、作者こと自分の理解度不足があったことが全ての原因です。という訳で今回はテクスチャーのグーローとフォンが治るまでシャドウを作ります。#include"DXLib.h"#include<math.h>#include<stdlib.h>#include<windows.h>#include<utility>using namespace std;#define CELL 1.0fconst float FOV_F = 600.0f;const int HEIGHT = 240;const int WIDTH = 320;struct VTX { float x, y, z; float u, v;};struct Camera{ float x, y, z; float yaw; // 左右回転のみ float height;};enum WallDir{ WALL_NORTH, WALL_SOUTH, WALL_WEST, WALL_EAST};struct Vec3{ float x; float y; float z;};float ZBuf[HEIGHT][WIDTH];#define RAD (3.14159265/180.0)Camera cam;// ==================
0