Search code examples
c3dcoordinatesrenderrenderer

sofeware renderer. In this project, why the x,y,z axis like this?


in this project (https://github.com/skywind3000/mini3d/blob/master/mini3d.c),when I try to change "model" and "view" matrix,I find the x axis pointing out of the screen,the y axis pointing left,and the z axis pointing up.

This is different from the left and right hand coordinate system.But I want to use left or right hand coordinate.How to fix it?


Solution

  • I find the answer.

    When use look_at function to build a "view" matrix,the "world-up" matrix should be {0,1,0,1} but not {0,0,1,1}.

    you can see this answer:Understanding glm::lookAt()