As part of a larger problem I’m trying to solve, I need to project a texture from the camera plane to each of the geometry faces of an object.
The way I’m, currently, approaching this is by setting the
uv of each vertex in the geometry to the
xy position on clip space. This works as intended when the face normal is aligned with the camera’s focal axis, but the projection breaks as those are no longer aligned.
I’m not entirely sure why this happens, I would greatly appreciate any help.
notes: I’m aware that the live code provided suffers from a lot of problems. Namely using
Geometry instead of
BufferGeometry, and it’s also unnecessarily re-calculating vertices projections. I understand those problems exist, the live example was just meant to illustrate the behavior
I believe the same effect can be easily achieved making use of the stencil buffer, but I need to actually re-calculate the uvs for use in a later stage. So, I can’t make use of stencil rendering techniques