1
0
Fork 0
2018-soft-3d-renderer/include/geometry.h

49 lines
750 B
C
Raw Normal View History

2018-09-05 02:50:27 +00:00
#ifndef GEOMETRY_H
#include "point.h"
#include <cstdint>
2018-09-05 02:50:27 +00:00
#include <vector>
// STRUCTURES
2018-09-05 02:50:27 +00:00
struct Face
{
unsigned int vertIndex[3];
};
struct Mesh
{
inline Mesh(void)
{
position.x = 0.0f;
position.y = 0.0f;
position.z = 0.0f;
rotation[0] = 0.0f;
rotation[1] = 0.0f;
rotation[2] = 0.0f;
scale = 1.0f;
}
Point position;
float rotation[3];
float scale;
2018-09-05 02:50:27 +00:00
std::vector<Point> verts;
std::vector<Point> vertsTransformed;
2018-09-05 02:50:27 +00:00
std::vector<Face> faces;
};
// PUBLIC FUNCTIONS
void FillTriangle(
uint32_t *buffer, int width, uint32_t color,
float x0, float y0,
float x1, float y1,
float x2, float y2);
2018-09-05 02:50:27 +00:00
#define GEOMETRY_H
#endif