cgmath icon indicating copy to clipboard operation
cgmath copied to clipboard

Left-handed perspective matrix

Open jminer opened this issue 9 years ago • 1 comments

It'd be nice if cgmath could create both left and right-handed perspective matrices. Currently it only does right-handed. Direct3D has different functions: D3DXMatrixPerspectiveLH and D3DXMatrixPerspectiveRH. As far as I know, everything else in cgmath works for both left and right-handed systems.

jminer avatar May 02 '16 02:05 jminer

This would be pretty easy to implement, but it would be important to be really clear about the convention to avoid confusion

something like this maybe?

{
let mut mat = cgmath::perspective(...);
mat[2][2] *= -1;
mat
}

(not sure if I got the correct matrix index there)

mhintz avatar May 03 '16 22:05 mhintz