cbaggers / varjo

Lisp to GLSL Language Translator
BSD 2-Clause "Simplified" License
220 stars 23 forks source link

Matrices cannot be constructed from a single scalar #206

Closed mfiano closed 6 years ago

mfiano commented 6 years ago

(mat4 1.0) should create an identity matrix, but there is no applicable method for creating a matrix from a scalar.

The OpenGL wiki states:

If a matrix is constructed with a single scalar value, then that value is used to initialize all the values along the diagonal of the matrix; the rest are given zeros. Therefore, mat4(1.0) is a 4x4 identity matrix.
mfiano commented 6 years ago

This gist addresses issues #205 #206 and #207 if you want to copy/paste and ensure I didn't make any mistakes: https://gist.github.com/mfiano/78628dfa7251aba5aef89d7ac587c791

cbaggers commented 6 years ago

Thanks for the report. Merging these matrix type constructor issues into https://github.com/cbaggers/varjo/issues/209