I don't think it's a very hard thing to do. Just draw a cone with the tip as the light source. Draw 4 lines connecting the light source (which I assume is a dot) to the 4 points (sometimes you will have more points) which encompasses the exterior top view of the rectangular cube then continue to extend the lines until it touches the XY plane.
Then you can calculate the surface area encompassed by the first four nearest points. Note the calculation of the area here since you are dealing with a rectangular cube. You can use the length of the line from the light source to each of the point to then calculate the planar area of the furthest point away from the light source. That will be the shape of the shadow down on XY plane.
After that, use simple scaling method to pinpoint the position of the 4 points down on the XY plane, and draw the 4 dots and connect them, then fill them with color. That's what I can think of when I hear your problem.