# Computer graphic mathematical modelling question

1. Dec 29, 2009

### Liquid7800

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 Ive learned how to solve alot of calculus problems and math problems in general...but Ive 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...

2. Dec 29, 2009

### HallsofIvy

What do you mean by "dispersion of the shadow"? What is it measured by?

3. Dec 29, 2009

### Liquid7800

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.

4. Dec 30, 2009

### HallsofIvy

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).

5. Dec 30, 2009