Computer graphic mathematical modelling question

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 3K views
Liquid7800
Messages
76
Reaction score
0
Hi,

I am just finished my Calc II class and a programming class and I am trying to write a computer graphics shader...

My goal is to model this scenario:
"Imagine a brick wall standing on a plane --- a shadow will be cast depending on the light source" ---my goal is to model the dispersion of the shadow (area?) at the point of intersection between the wall and ground plane.

Eventually I want to eliminate the light source from the equation and control through variables the amount of shadow dispersion...a kind of faux shadow shader based on object intersections.

Problem is I've learned how to solve a lot of calculus problems and math problems in general...but I've had trouble modelling them (especially in 3 dimensions)...and this is the area I really want to break into, and where I think an example could really help me get started.

Can anyone help me get started or at least point me in the right direction with the mathematics I may need? Thanks in advance...
 
Mathematics news on Phys.org
Eventually I want to eliminate the light source from the equation and control through variables the amount of shadow dispersion...a kind of faux shadow shader based on object intersections.

What I am trying to describe when I say "shadow dispersion" is I am attempting to fill a given area (the shadow area--blob shape at the object intersections) with pixels of a different color (say black at 75% opacity...that disperse and fade out in a gradient-like falloff from the intersection).
My units of measure would be the amount of pixels to fill that area...which are basically points in computer screen space.

This is not 'physically accurate' but would be very efficient in real-time applications.
 
Well, obviously a straight line from your light source to the top of the wall will hit the floor at the edge of the shadow. And that's a simple "proportion" problem. If the light is at height "H" above the floor and distance "d" from the wall, while the wall has height "h", then, letting "x" be the distance to the edge of the shadow on the other side of the wall, x/h= (x+d)/H so Hx= hx+ hd, (H- h)x= hd and x= hd/(H-h).
 
Thanks for the reply!
This is great I needed to see this kind of example.
I like that nice little equation...I was way off;...getting way too complex and researching things that were much more complex than needed to be (looking at things like differential geometry, vector calculus etc.)
I guess these subject areas would be used more for accurate physical modeling of light and shadow behavior.
Again, I appreciate your contribution...