View Single Post
  #1  
Old 04-17-2019, 08:05 AM
performlabrit performlabrit is offline
Member
 
Join Date: Oct 2013
Posts: 77
Fill the Vive's FOV with textures from a rendernode attached to mainview

Hi folks,

I'm using the Vive and can't seem to calculate the field of view used by vizard for the stereo rendering. I need this along the binocluar and vertical directions.

Ultimately, I would like to render textures passed from a rendernode attached to the mainview onto a screen/rectangle that fills the person's FOV.

Success would look very much like the original stereo projection, except that the viewer is really viewing a monocular display similar to a rear-projected screen that is stable within the head's frame of reference. Togglign the alpha of the screen would have no major effects except add/remove stereo disparity information.

Example code below (for use with a Vive) that is lacking in two important ways:

- I must set the camera's field of view to match the binoc field of view used when rending for the vive

- I must set the height/width of the screen so that it matches the binc. field of view, overlapping with the stereoscopic field of view inside the Vive.


Code:
# Create render node for camera
cam = viz.addRenderNode()
#cam.fov = 100.0
#cam.setFov(100,1.5,.1,50)
#cam.setSize(1280,720)
cam.setProjectionMatrix(vizconnect.getRawTracker('head_tracker').getMatrix())
cam.setRenderTexture(video)
cam.setMultiSample(viz.AUTO_COMPUTE)
cam.setRenderLimit(viz.RENDER_LIMIT_FRAME)

#cam.setProjectionMatrix(hmd.getMatrix())

# Get handle to screen object and apply video feed to it
screen = vizshape.addBox([1,1,0,])#,top=False,bottom=False,left=False,right=False,back=False)
#screen.setScale([1.845,1.155,1])
screen.texture(video)
cam.renderOnlyIfNodeVisible([screen])
screen.setReferenceFrame(viz.RF_VIEW)

#screen.setPosition([0,0,1])
screen.setPosition([0,-.12,1])
screen.renderToAllRenderNodesExcept([cam])
screen.alpha(0.7)
Reply With Quote