eliemichel / LearnWebGPU-Code

The accompanying code of the Learn WebGPU C++ programming guide
https://eliemichel.github.io/LearnWebGPU
MIT License
114 stars 30 forks source link

Question about glm integration #27

Closed MPcoreDev closed 1 year ago

MPcoreDev commented 1 year ago

I can see the following in the code:
m_uniforms.viewMatrix = glm::lookAt(vec3(-2.0f, -3.0f, 2.0f), vec3(0.0f), vec3(0, 0, 1));

I wonder why the up vector is (0, 0, 1) instead of (0, 1, 0) ?

(Note that some other examples are using (0, 1, 0) like here)

MPcoreDev commented 1 year ago

In fact that works also as exptexted with (0, 1, 0). That was just a choice.
My bad !

eliemichel commented 12 months ago

There is no consensus about which of the Y (0,1,0) or Z (0,0,1) should be used as the vertical axis, the choice is left to you!

For instance Blender, Unreal Engine and this guide use Z-up, Maya and Unity use Y-up, etc.