MCPcopy Create free account
hub / github.com/defold/defold / Matrix4_Orthographic

Function Matrix4_Orthographic

engine/script/src/script_vmath.cpp:1537–1547  ·  view source on GitHub ↗

creates an orthographic projection matrix * Creates an orthographic projection matrix. * This is useful to construct a projection matrix for a camera or rendering in general. * * @name vmath.matrix4_orthographic * @param left [type:number] coordinate for left clipping plane * @param right [type:number] coordinate for right clipping plane * @param bottom [type:num

Source from the content-addressed store, hash-verified

1535 * ```
1536 */
1537 static int Matrix4_Orthographic(lua_State* L)
1538 {
1539 float left = (float) luaL_checknumber(L, 1);
1540 float right = (float) luaL_checknumber(L, 2);
1541 float bottom = (float) luaL_checknumber(L, 3);
1542 float top = (float) luaL_checknumber(L, 4);
1543 float near_z = (float) luaL_checknumber(L, 5);
1544 float far_z = (float) luaL_checknumber(L, 6);
1545 PushMatrix4(L, Matrix4::orthographic(left, right, bottom, top, near_z, far_z));
1546 return 1;
1547 }
1548
1549 /*# creates a perspective projection matrix
1550 * Creates a perspective projection matrix.

Callers

nothing calls this directly

Calls 2

luaL_checknumberFunction · 0.85
PushMatrix4Function · 0.85

Tested by

no test coverage detected