I’m new on jmonkeyengine development and I’m creating an augmented reality Android app.
So, 3D objects are displayed and move depending on their own position and phone position (gps + sensor).
I want to move directionalLight (sun) to get a realistic result.
For example, if phone date is 2pm, the sun is up, if it 5pm the sun is to the west, etc.
So I need to take care of phone date and phone compass.
I already got those two parameters, but I need a few help to set sun position.
The sun position (and the direcitonal light) is set in the 3D-world coordinate system. The compass is used to set where the camera is pointing (so nothing to do with the sun position). As pspeed suggests the compass is irrelevant to setting the sun position.
I though OP was asking for math to calculate the sun position given a lat/long and datetime.