I want to create the following transform by transforming the BLACK layer of the attached gif. I know how to transform the white part (that's how I created the gif). Is this possible? In my production version, the white part is actually an image of the moon which I want to progressively hide, simulating the phases of the moon. The reason I can't transform the white part is that it distorts the image of the moon. The other 3/4ths of the cycle I have figured out, but this one has me stumped.
Based on inspiration from @Scott. Made a layer the same size as the circle. Filled it with black. Moved it 1/2 way to the left (1/2 off screen, 1/2 overlap half circle) Cut out the half circle from the black layer Made 2nd layer, filled it with black and moved it fully off screen to the left. Transformed first black layer using left most middle handle all the way to the right. Moved second black layer to the right simultaneously (needed because the first layer eventually revealed the white circle underneath it since it shrunk toward 0 width.
UPDATE The following gif incorporates the solution above. It is not accurate for the reasons @user287001 points out, but it is sufficient for showing to my class of Sixth Graders.
Figuring out how to transform the rotating moon (while keeping the white part always facing right - toward the sun) was another problem I couldn't solve. I could rotate it perfectly around the center point with the white part always facing in. What is posted has a 3d moon that is manually transformed about 70 time to the approximate position - that is why it is slightly jumpy.
Using a simple black circle, moved to be off the canvas to start. Simply add key markers for
Position at the start and end....
Or.. if you need the opposing, half-circle, sort of mask, create a long shape and a half-circle cut out of the right side, then animate it the same way... (Note the above image is actually more correct as to how the moon phases would appear/hide, but I included this to match your question.)
You could feasibly do either of these with a mask on the Moon layer and then animate the mask. You would simply need a background layer in that case.
And, of course, if you want to merely animate the moon moving right, all you need to do is animate that layer and add an appropriate static background layer which gets "uncovered" as the moon moves...
To get it right geometrically and in time, too, you can work with Illustrators or Photoshop's 3D. The next example is in Illustrator, A half-circle is revolved to sphere with 3D revolution effect and a half-black rectangle is mapped onto it. The other half is cyan to make it visible against my white artboard without shading:
In the next image the mapped "art" is scaled to fit. The viewing angles can be changed to fit with all possible views.
Your example view with apparent poles on the top and bottom needs only one angle to be other than zero. You can change it say 12 degree steps from 0 to 360 to get one full cycle as 30 snapshots. You can copy and paste every version to a different Photoshop layer.
Reopen the view setting dialog by clicking "3D Revolve" in the Appearance panel
I said "right in time, too". If you make the frames with uniform rotation angle steps the apparent velocity of the light-dark edge changes right. It's fastest at half-moon and slowest at full and new moons.
Scientifically this is only a coarse approximation because it doesn't take into the account the full complexity of moon's orbit, not even the orbital motion of the earth. But it's more realistic than any linear movement or scaling with a constant speed.
I'm sure people who use advanced video editors would make this directly as video in their program with the same 3D effect + by defining the rotation. It's out of the scope of this answer.
ADD: This was not asked, but Illustrator can also produce exact orbital motion diagram. Object > Transform > Rotate makes exact and easily repeatable (=Ctrl+D) rotations.
The magenta circle is only for the convenience. It's actually colorless and strokeless, it only is there to make the shape symmetric for consistent rotation without a need to set the center.
The original black shape is duplicated (=Alt+Drag) and placed on each rotated version. It snaps exactly in Illustrator if there's Smart Guides ON.