Re: Perspective Projection

2023-07-28 Thread Ruby The Roobster via Digitalmars-d-learn

On Friday, 28 July 2023 at 16:20:26 UTC, Dennis wrote:
On Friday, 28 July 2023 at 16:08:43 UTC, Ruby The Roobster 
wrote:
Everything displays fine (with orthographic projection, of 
course) if you leave the projection as the identity matrix, 
but setting it as I have done results in a blank screen.


How do you pass the matrix to OpenGL? Be careful that gl3n uses 
row major matrices, but OpenGL uses column major matrices, so 
you either need to transpose it yourself, or pass `true` to the 
`transpose` argument in `glUniformMatrix4fv`.


Thank you very much!  Changing GL_FALSE to GL_TRUE in all of the 
`glUniformMatrix4fv` calls resulted in something being displayed, 
though very incorrectly.  As it turns out, there is an 
inconsistency in the gl3n API, that you write a rotation matrix 
in radians, but you must write the FOV in degrees.  After that, 
it worked as it was supposed to.


Re: Perspective Projection

2023-07-28 Thread Dennis via Digitalmars-d-learn

On Friday, 28 July 2023 at 16:08:43 UTC, Ruby The Roobster wrote:
Everything displays fine (with orthographic projection, of 
course) if you leave the projection as the identity matrix, but 
setting it as I have done results in a blank screen.


How do you pass the matrix to OpenGL? Be careful that gl3n uses 
row major matrices, but OpenGL uses column major matrices, so you 
either need to transpose it yourself, or pass `true` to the 
`transpose` argument in `glUniformMatrix4fv`.