Hey guys,
I have a material that has various animated parts using panners and rotators. The specific problem I am having is with a rotating disc-like element. I want the outer segmented ring to rotate around the inner solid ring:
I can't get the correct rotation down. I've tried using specific masks but I cannot get it to work properly, the ring just rotates outside the model.
If anyone could lend a hand or maybe point me in the right direction, I would greatly appreciate it. Thanks!
Replies
Exactly. I will go back and tweak around then. I guess I was making this more complicated than it should be hehe.
If you'd use a smaller texture and offset its position, you would not need to change the pivot, because the pivot is the center of that texture automatically, regardless of resolution.
Thanks for that bit of info, Hourences. I switched to a smaller image for the rings but I am having a hard time understanding whether it has to be uv dependent with the texture or aligned to the center. I have tried different positions but I have yet to get the perfect pivot without having to adjust the rotation center.
Close but not quite:
0.5 (if both numbers are the same) is exactly in the middle of the UV.
0.0 is (if I'm not mistaken) left corner of the UV (origin point).
1.0 is the top right corner (which is near what you're looking for).
So try and use small values on you Rotator's number, change from 0.5 for both to something like 0.95, 0.9, 0.85, etc. until you find the sweetspot you need.
Things to remember:
Uv space is infinite.
Your texture has options for how it is mapped across that infinite space. (find the texture in the editor and double click it to bring them up)
Looks like you may have this working already, but for an image like this you want to ensure that it is set to Clamp. That will essentially isolate your image as only ONE image in all of UV space. No repeating when the UV coordinate values get below 1 or above 1.
What you're doing here is transforming the SPACE the image is MAPPED to. Not transforming the image itself. (subtle distinction but it may help you visualize whats up since you can already think in 3d enough to model things) Think of it like having a giant plane that the image is on, and you're manipulating that plane.
The coords node represents UV space itself. A rotator rotates your texture plane in space about a point you specify either in the rotator node itself, or through its coordinates input.
Also just like in XYZ space, transformation order is important.
The good news is, you're pretty close here.
Assuming your texture for the animated element is
Set your rotator's center to 0.0,0.0. Don't have anything in the coords node. This will make sense in a minute.
Hook up a texcoord node to an add node. Plug in a constant -0.5 to the add. This will re-center your texture at the origin of space.
Next, hook this into a multiply node, and hook up a scalar parameter to the other multiply input. this will be the scale of your graphic on the other texture.
Hook this chain into the rotator's coordinates node.
If you hook this into a texture's UV channel, it will rotate and scale around its center, but be stuck in the upper left corner.
To allow you to position it we'll need 2 add nodes.
The first add node should have the rotator plugged into one input. The second add node should have the MULTIPLY node from just before the rotator plugged into one of its inputs. Now hook up a SINGLE Vector2 parameter into those add nodes. It should be the same vector2 parameter for each add node.
Hook up the add node with the rotator plugged into it into the UV's for the outer ring, and the one without the rotator into the UV's for the static portion.
This vector 2 will control the positioning in UV space for your rotating graphic. by using it into both add nodes, you'll be moving all the parts of your graphic together.
The network should look something like the attached (Pardon the generic diagram. I don't have UDK available right now)
I was having issues with getting the position down with just the one vector 2 parameter as it seemed to only affect the pivot of the rotation. In the end I ended up replacing the constant (-.05) node with another constant 2 vector allowing me to control the x and y positions.
I'm not sure if I did something wrong here or not but it's working! I've learned so much in the process of getting this to work and I appreciate everyone's help. Please feel free to chime in if you guys see something that isn't technically correct or ass backwards. Thanks!
You didn't do anything wrong if it looks right. Chaining together afine transformations is always tricky when it involves a rotation. I wasn't 100% sure I had those in the right order, but it looks like you figured it out.
Oh dur, I see where I went wrong. It's like I said about transforming the space. (Forgot that partway through the mental math.) The origin is still at the corner of that image, but the addition at the rotator moves the rotation center like you found.