0
$\begingroup$

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 image is from the person asking the question, who got it running in Cycles. This image was my only clue in setting up the node tree. Cycles node tree from old post

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.

my shader setup

sry for the quality

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

$\endgroup$

1 Answer 1

0
$\begingroup$

I found these questions that have very good answers: How to use the vector of another different object as information for material node? -and a follow up: How to switch beetwen two or more textures with material nodes? Everything is there, I thought about deleting my question but the posts above are pretty confusingly named, which prevented me from finding them. I will keep this post up so people can find them more easily.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .