PDA

View Full Version : One webcam for AR in HMD


infouser
12-13-2012, 04:02 AM
Hello,

Could you help with the code to use one generic webcam to create augmented reality background for both eyes in HMD?

Thanks.

Jeff
12-17-2012, 09:47 AM
The Display Background Texture (http://kb.worldviz.com/articles/813) article includes an example script that applies a static texture to the background. Just replace the static texture object with your camera texture object.

Replace:
#Create background quad and apply a texture
background = addBackgroundQuad()
texture = viz.add('lake3.jpg')
background.texture(texture)
With:
#Create background quad and apply camera texture
background = addBackgroundQuad()
video = viz.add('VideoCamera.dle')
cam = video.addWebcam()
background.texture(cam)

infouser
12-18-2012, 05:43 AM
Thanks again, it works