zeux / niagara

A Vulkan renderer written from scratch on stream
MIT License
1.33k stars 75 forks source link

Simple Flycam #11

Closed firesgc closed 4 years ago

firesgc commented 4 years ago

Hi Zeux,

Thank you very much for this awesome example! How much effort it would take to implement a simple flycam (like WASD + mouse support)? I would love it to see the scene from different angles.

Thank you!

zeux commented 4 years ago

Probably not too much. Feel free to implement it in a fork! If the code is simple and clean I'd be happy to incorporate it.

firesgc commented 4 years ago

I will try, but don't expect too much, I'm a beginner :) I only have a rough overview of the code. Will it be enough to modify the projection matrix directly in line818?

Like: mat4 projection = perspectiveProjection(glm::radians(70.f), float(swapchain.width) / float(swapchain.height), znear) * viewMatrix;

or are there any assumptions in the shader(s) that the camera is at 0,0,0 and looks along the zaxis?