The points of the lunar crescent always point away from the sun, just like in Real Life. For them to be “aligned vertically” the sun would need to be near the horizon.
The SkyControl project has a GUI application named “TestSkyControl” that might be helpful for determining the astronomical circumstances (such as latitude, solar time, and lunar phase) you wish to portray.
You can set the phase of the moon directly, as follows:
skyControl.setLunarPhase(newPreset);
This allows you to set one of 6 pre-defined phases, such as WANING_CRESCENT or FULL.
For more precise control, there’s an alternative setter that requires an off-screen renderer for the Moon:
GlobeRenderer moonRenderer = new GlobeRenderer(
moonMaterial, format, equatorSamples, meridianSamples, resolution);
stateManager.attach(moonRenderer);
skyControl.setMoonRenderer(moonRenderer);
skyControl.setPhase(phaseAngle, 0f);
Here phaseAngle is in the range 0 to 2π, with 0 producing a new moon and π producing a full moon.
Precise calculation of the moon’s phase is rather complicated. You can obtain the actual phase of the moon for a particular day using various web services such as: