• Create Account

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1noobnerd  Members

128
Like
0Likes
Like

Posted 20 December 2012 - 03:15 PM

Hi

im trying to work out how to get the "shadow" of a sphere which is positioned on a plane. The light is a point somewhere above the sphere. The shadow will be a cone/plane intersection that is a ellipse or maybe a parabola/hyperbola in weird cases. what i would like is the 2 radii for the ellipse and the points where the ellipse "starts" and "ends" so i might stretch a pre made "shadow" image to the right size and just place it there. Has anyone encountered this before?

### #2max343  Members

346
Like
0Likes
Like

Posted 20 December 2012 - 04:56 PM

I've encountered it. Why?

### #30r0d  Members

1573
Like
0Likes
Like

Posted 20 December 2012 - 05:45 PM

You might want to look up the math for conic sections:

http://en.wikipedia....i/Conic_section

### #4MrRowl  Members

2313
Like
1Likes
Like

Posted 21 December 2012 - 06:09 AM

Look up texture projection. You should be able to create a projection matrix (based on the light source and the sphere positions) that, when applied to the world space position of each vertex of the surface you're projecting onto, generates a texture coordinate for that vertex.

### #5Álvaro  Members

20254
Like
1Likes
Like

Posted 21 December 2012 - 06:49 AM

The projection of a sphere on a plane is an ellipse. I can think of several strategies to compute exactly what ellipse it is. For instance, you can compute the lowest and highest ray that are tangent to the sphere, intersect them with the ground plane and that will give you the major axis of the ellipse. The point where the sphere touches the ground is a focus of the ellipse. That's already enough information to recover the ellipse exactly.

Edited by Álvaro, 21 December 2012 - 06:50 AM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.