0

I've been working on an FPS style camera using wgpu. My code is here: https://github.com/Barbacamanitu/particle_curl

I'm sending a view, projection, and inverse view matrix to my shaders. So far, I can look around the scene fine, but when I move the camera, it seems to stay fixed at the origin. I'm currently printing out the view matrix, and I can see it changing when my camera's position changes. However, I'm not seeing these changes reflected in my scene.

Particles closer to the camera seem to be larger, and my billboarding code using the inverse view matrix seems to work correctly. Is there an obvious reason why the translational aspect of my camera isn't working correctly? I suspect it has something to do with the w component of the vectors in clip space since most of my issues thus far have some from there.

I'm using the cgmath function look_at_rh to generate my view matrix. I adapted my code from: https://sotrh.github.io/learn-wgpu/intermediate/tutorial12-camera/#the-projection

The only real differences between that code and mine is that I split the view and projection matrices into two matrices that I send to my shader code. I did this so that I could easily billboard my particles using the inverse view matrix.

Barbacamanitu
  • 61
  • 1
  • 4

0 Answers0