Open Noobly-Walker opened 5 months ago
1st one is an immediate no, it seems you just haven't noticed one small detail.
You can add those semi-absolute with the coordinates of their parents. Boom, you get fully absolute coordinates.
2 and 3 is also entirely possible and I don't see a problem. I mean, the sun is always at 0 0 0 coords, that's kinda how solar systems work. the other two coordinates you also have in the form of vievCenterCoords and coords of the object. There is absolutely no information in there you can't already get.
Maybe next time it would be good to consider asking me about this kind of stuff so that I can explain what you can use to get things you need, instead of just assuming there is no way to get them.
It is true, however, that you don't get really easy access and you'd need to do some method overriding to get the effects you need, so I'll just adjust the getUV method in such a way that you can get all the info you need directly from there.
Calved from #5 and elaborated upon.
This is a list of changes that should be made to OrbitingCelestialObject and Planet in order to overhaul lighting and phases.
(using degrees) where point A is the observer, point B is the observed body, and point S is the sun, the angle p of the phase can be obtained via the equation p = 90 - angle(B). angle B can be obtained from sin(angle(S))/ length(AB) = sin(angle(B))/length(AS). which, solving for angle B, is angle(B) = arcsin(sin(angle(S)*length(AS)/length(AB)). angle(S) is equivalent to the difference in phi between A and B. This gives us the final equation p = 90 - arcsin(sin(angle(S)*length(AS)/length(AB)). technically you could avoid the calculation of AS by using BS and angle A instead. this would have the benefit of not needing to calculate the distance of the observer to S in the case of a non- orbiting A or you could change it to be p = 90 - arccos((BS^2 + AB^2 - AS^2)/(2*BS*AB)) which cuts down on the trig operations either way, you also would need to determine which direction the triangle is going i think (two cases)