View Single Post
  #1  
Old 09-02-2016, 07:23 AM
dcnieho dcnieho is offline
Member
 
Join Date: Feb 2011
Posts: 59
purpose of distance parameter in setRenderWorldOverlay

I have been experimenting with the distance parameter in setRenderWorldOverlay, while viewing a scene through an Oculus DK2. As i understand it, changing the distance should change the stereo-defined depth at which objects on the overlay appear (in my case just a dot, vizshape.addSphere). The manual literally says that this is "the distance in front of the viewpoint to projection the canvas onto", but i do not understand what that means. The distance in front of the focal plane perhaps (so how much closer to the observer)?

In any case, changing this distance by means of repeated calls to setRenderWorldOverlay does not seem to work. I used the ChangeOverlayDistance function below to try this. I perceived no change in depth of my object on the overlay So, does the distance parameter do anything? And what does distance in front of the viewport mean?

Thanks!

Code:
overlayCanvas = None
def setupScreenOverlay():
	global overlayCanvas
	overlayCanvas = viz.addGUICanvas()
	overlayCanvas.alignment(viz.ALIGN_CENTER)
	overlayCanvas.setRenderWorldOverlay(params.resolution,params.FOVy,params.aspectr,1.) # params.resolution,params.FOVy,params.aspectr are same as an oculus eye, so [1920, 1080], 106.18877140224711, and 0.8076826795303448
	overlayCanvas.setPosition([0,0,0])

distances = [1.,0.,-1.,-3.,-5.] # negative is perhaps behind the focal plane?
didx = 0
def ChangeOverlayDistance():
	global overlayCanvas, didx
	didx += 1
	print float(distances[didx%len(distances)])
	overlayCanvas.setRenderWorldOverlay(params.resolution,params.FOVy,params.aspectr,float(distances[didx%len(distances)]))

vizact.onkeydown ('d', ChangeOverlayDistance)
Reply With Quote