-3

What is the easiest way to add shadows to a 3d Object?

I have objects information(vertices, texCoordinates, normals, indices) stored in arrays.

There are some frameworks like isgl3d for iOS that allow users to load 3d .obj files and add shadows, but they adds a lot of unuseful stuff and aren't multiplatform(iOS + android)

What would be the easiest way to add shadow to a 3d object?
Could you show/link to a working example(iOS/Android)?

mxg
  • 20,946
  • 12
  • 59
  • 80

1 Answers1

2

Easiest way, you find a library or some implementation that you can compile to your platform. Shadowing in 3d is not obvious and as I know, OpenGL does not implement it.

Techniques I'm aware of are Shadow volumes http://en.wikipedia.org/wiki/Shadow_volume and probably the easier one is (for which I could not find a link) is when you map your object's vertices to a plane, for example to the ground and draw the object again in black.

  • the second one is called 'projected geometry' and is described here: http://www.slideshare.net/stefan_b/advanced-lighting-for-interactive-applications – D-rk Jul 05 '12 at 11:34