-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How hard would be to implement a “light” object? #11
Comments
Hi Davi! Thebes isn't really 3D, more 2.5D, and it's a bit of a con, really 😃 By changing the colours of 3D planes according to the angles of their surface normals, we can give the illusion of lighter and darker surfaces. Using the eyepoint as the basis for measuring these angles works for this example ... so if you had a different point other than the eyepoint for calculating the colours, the illusion would work for that point, I think, but you would keep the calculations for hidden-surface removal the same. It might work. But "casting shadows" suggests that there's some interaction between different objects - at the moment, everything is completely independent of everything else. I sometimes wonder whether developing some kind of output function to Makie or Blender would be more productive than pursuing realistic images: making shapes is easier than developing a ray-tracing rendering function. But then, why not go straight to Makie or Blender? 😃 |
Hmm, now I understand the idea a bit better. I didn't actually thought about "casting shadows", only about the color gradient stuff you just described, in order to give the illusion of 3D. So, is the gradient functionality already implemented under the hood for the eyepoint? I mean, do I need to personally implement the gradient functionality if I wish to plot a sphere? |
I realized that my question was wrongly posed for what I actually meant. I'm not interested in actually having a light that creates shadows, but in this nifty implementation of rendering according to eyeypoint, in order to perceive objects are 3D. |
Yes, you’d have to write a rendering function that determines how you want to draw the faces. The default ones are quite basic. If you just want to colour them with random Julia colours, that’s fine 😂 - but you still have to work out which ones are hidden… If you also want to adjust the colours according to the angle the surface points in, then that example code should be a good start. Ray-tracing - why not!? |
I saw that in the example of the Julia like spheres, you’ve coded in a way that the spheres have shadow. I was wondering how hard would be to implement a sort of “light pole” such that a shadow could be caste in the correct direction. For example, if I wish to perceive a sphere, I’d need a shadow like the one you hard coded.
The text was updated successfully, but these errors were encountered: