I think
yes.
But you will need an elevation function.
I suggest that it might work like an
Universal joint, but that means you somehow need to combine the functions with xyz.
You should be able to do the same as for x,z for y,x and y,z.
But at the moment i don't have the time for exploring this as i have to write a test in latin next week.
Try to get the direction working with sin and cos for y,x and y,z. The idea is very simple:
if you have 360° in radians the sin or cos will give values between 1 and -1.
for x,z this means, (for direction=90) x is 0 and z is 1. For 45° both are equal.
Explore this and make the same including y for z and x and you might find a way to combine these 3 results to get a direction and heading result.
It should be easy as you always get values between -1 and 1.
The plane problem might be solvable with this and some other functions.
like "if x,z is between fu;bar scalar=bla*0" and this multiplied with a vector determined by the heading and elevation function.
But a fake shadow would be possible for sure.
ok, this sounds a little bit confused; i had some beers, sry. If i find the time tomorrow evening (in 24 hours) i'll try to explain.