I am attempting to create a Doom style 8-directional sprite material for a plane that changes based on viewing angle. I was following a 6 years old question from here: How do I change between different images based on the rotation of the camera The link for the project file in that post is not working and being almost 7 years old probably makes it obsolete anyway. I think I got the idea from the answers there but still don't understand the math enough to get it working properly.
I'm pretty sure the problem is in the processing of the
arctan2() output or changes in how some nodes work. Also the person answering is using the Blender Game Engine.
This is my shader setup. The output from
arctan2 is used to shift the spritesheet and the texture actually lines up but it makes around 6 full texture ''rotations'' for one actual rotation of the camera and it doesn't seem linear.
The spritesheet should make one ''rotation'', corresponding to the octagon. The plane is always facing the camera, did that with geometry nodes. I'm adding my blender file in case some wonderful blenderer would be so kind as to help me figure this out. https://drive.google.com/drive/folders/1xcd-GSxfRQonObPbpn8gsREUgFcmDQdI?usp=sharing