mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Add (low level) functionality to allow rendering 3D Meshes.
- Add love.graphics.setDepthMode(testcomparison, enablewrites). - Add love.graphics.setMeshCullMode. - Add love.graphics.setFrontFaceWinding. Depth testing and depth writes require a depth buffer to work. The mesh cull mode controls whether front/back faces of a mesh are culled. The front face winding determines whether a clockwise or counterclockwise-oriented face in a mesh is considered front facing. --HG-- branch : minor
This commit is contained in:
@@ -382,16 +382,17 @@ Matrix4 Matrix4::inverse() const
|
||||
return inv;
|
||||
}
|
||||
|
||||
Matrix4 Matrix4::ortho(float left, float right, float bottom, float top)
|
||||
Matrix4 Matrix4::ortho(float left, float right, float bottom, float top, float near, float far)
|
||||
{
|
||||
Matrix4 m;
|
||||
|
||||
m.e[0] = 2.0f / (right - left);
|
||||
m.e[5] = 2.0f / (top - bottom);
|
||||
m.e[10] = -1.0;
|
||||
m.e[10] = -2.0f / (far - near);
|
||||
|
||||
m.e[12] = -(right + left) / (right - left);
|
||||
m.e[13] = -(top + bottom) / (top - bottom);
|
||||
m.e[14] = -(far + near) / (far - near);
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user