How do you occlude moving objects in 3D space?
A little background. I watched and followed Mike Miller's tutorial on creating planets using sphere in Hitfilm. It worked fine. I created earth and the moon. I attached the planet objects to 3d points and had the moon orbiting around the earth. But when the moon was supposed to go behind the earth, it went in front. I switched the layer order, and, as you would expect, the moon went behind when it was supposed to go in front. After much searching through forums, tutorials, etc., I didn't find a solution. I tried Depth Matte, Depth Mask, found references to Depth Map, and Z-Res, but nothing I really understood or found useful.
(Side note: Could someone who understands these depth rendering things create a tutorial for them?)
I tried importing a 3D sphere model and used the same textures as I did for the spheres effect. They looked good, and I even managed to get the transition from day to night earth using a difference key (set matte didn't work in this case). I layered multiple spheres for the earth (day, night, clouds, atmosphere, and matte) and used a single sphere for the moon. Everything looked good so far. I set the spheres as 3D layers and everything looked good. But still no occlusion when the moon went behind the earth.
Attempt 3: I moved the models into composite shots as 3d Layers to preserve the effects I added to them and set the composites to 3D Unrolled in the main comp. This is where all hell broke loose, and I throw my hands up in frustration. The multiple layered models of earth looked good in the initial frame, but then they started doing wonky things. The cloud layer would only display the right half of the hemisphere with a perfect vertical line, then reappear fully, only to stretch to the right. The daytime earth would rotate and then slice itself in half and slowly grow back. Really weird stuff. The moon didn't show up at all as 3D Unrolled. When I changed it to a 3D Layer, it was a 2D Plane the spun around its axis. The good news is, it finally occluded correctly.
Does anyone know what I'm doing wrong, and is there a tutorial or WRITTEN resource that explains how to achieve the effect I'm looking for? I vaguely remember seeing a discussion on occluding planets a long time ago, but I couldn't find it.