Download

[Material] Rotate about local Y or X axis

Howdy folks,

Been trying to rotate about the local X or Y axis of a spherical mesh using material’s WPO as such:


The issue is that if you rotate the actor/mesh, it is ignored since it focuses on the world’s Y axis.
My question is what can i do to make it rotate along the mesh’s local Y axis instead.

Fyi, I am trying to make a rotating boulder. I don’t need to calculate physics so this is purely aesthetic.

I tried to make it local using the transform vector nodes however it ends up rotating around a world axis of sorts instead of locally…
Any tips or clues?

Thank you!

Pre-skinned Local Normal (and Position), but it makes things a bit more complex in the graph:

Not saying it requires the same setup as the graph in the example. But it might require masking the G channel (Y axis) from the pre-skinned node(s), or using that Breakout Float3 to isolate the Y axis so…maintaining local space from the pre-skinned nodes…it’s prepared to be an input to the Rotator function.

I wish i had the technical knowledge to understand what you said but holy moly that looks way more complicated than what I was looking into achieving.
A few other threads mentioned using WPO and worked for them however I am not able to reproduce it :confused:

Put a Local->World transform between your Y vector and your RotateAboutAxis


I know you said you already tried transforming it but I have to assume you were doing something wrong, because this works perfectly for me. If you’re still having issues you’re going to need to post a video or something explaining what the issue is exactly.

You’re right, i was doing something wrong and i am not sure what that was either.
Copied yours and it worked perfectly.

Thank you!

Why is it Local > World rather than World > Local? If I’m trying to do the rotation in local (object) space, wouldn’t I need to convert to Local space from World? Yet there’s not World > Local transform node in the material editor. It’s why I suggested Pre-skinned Local Normal/Position, but that apparently requires a complex setup.

When you go from world to local you are generating a vector that is pointing down the world Y axis, relative to the local position.

But that isn’t what you want, you want the local Y axis relative to the World, which is why you go Local->World.

There’s no Local to World either. There are only generic “Transform” nodes, one for position and one for vectors. You have to specify how you are transforming it using the dropdowns in the details panel and yes you can go from World to Local (but that won’t work in this case as noted above)

Yeah I saw, but I don’t understand what you were getting at. Pre-skinned local data is all per-vertex (I assume?) so I am not sure how that would be helpful here.

I was thinking that the pre-skinned local nodes would return the local data for the rotating boulder, both normal and position. That way it would rotate about local Y axis to avoid it looking odd or wrong if its position and normal are different from the world space reference. OP stated that it was focusing on the world Y-axis, so it was rotating around that axis rather than its own. I didn’t know it could be performed by using only one world axis and less than a 3-vector.