Interfacing OpenGL with a Webcam...

Does anybody know of an Webcam API (under windows) that could be used to interface with OpenGL so that the captured images could be used as texture maps?

-Rebel_Legend

I suppose those webcams come with a SDK that enable you to get pictures from them (actually, the SDK might be provided by Microsoft so have a look on their site !).

Then, you just grab the picture, glTexImage2D it and use it as a texture !

If you can grab the picture, you can use it in OpenGL !

Regards.

Eric

I did something like this with FireWire cameras once - it’s quite fun to see your own face reflected in a computer-generated teapot
FireWire cameras have a standardized interface, but I don’t think the same goes for your average run-of-the-mill USB webcam.

That said, you can try either the old-skool Video for Windows SDK or DirectShow. Both should get the trick done, provided your webcam has the proper drivers. I think DirectShow would be the way to go, because I’m not sure if the old VFW stuff is still officially supported.

Then, like Eric said, all you need is for it to dump pixel data to a block of memory somewhere - texturing will take care of the rest.

  • Tom