I wish to be able to render any Plane (Defined by a Normal and a distance from the origin).
The closest answer state to use 'Direction' (4D vectors with w = 0) with the Lengyel infinite matrix, but unfortunately it does not render anything with my implementation:
const float FOV = glm::radians(55.0f);
const float e = 1.0f / std::tan(FOV / 2.0f);
const float a = height / width;
const float n = 0.1f;
this->projection = glm::mat4{
e, 0, 0, 0,
0, e / a, 0, 0,
0, 0, -1.0f, -2.0f * n,
0, 0, -1, 0
};
std::vector<Vertex> vertices =
{
Vertex{glm::vec4( 0.0f, 0.0f, 0.0f, 1.0f), Vector::Up()},
Vertex{glm::vec4( 1.0f, 0.0f, 0.0f, 0.0f), Vector::Up()},
Vertex{glm::vec4( 0.0f, 1.0f, 0.0f, 0.0f), Vector::Up()},
Vertex{glm::vec4(-1.0f, 0.0f, 0.0f, 0.0f), Vector::Up()},
Vertex{glm::vec4( 0.0f, -1.0f, 0.0f, 0.0f), Vector::Up()}
};
std::vector<GLuint> indices = {0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 1};
// Render by indices
...