WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Html and vizlink on Oculus HMD (https://forum.worldviz.com/showthread.php?t=4850)

mshukun 10-16-2013 07:05 AM

Html and vizlink on Oculus HMD
 
We have been developing research applications for the Oculus and zSight HMDs. We would kindly like to ask two questions regarding the Oculus HMD.

The first question is that html using vizhtml does not show on full screen mode. How might we accomplish this?

The second question regards the code below:
viz.link( viz.Mouse , viz.addTexQuad(viz.SCREEN,texture=viz.add('crossha ir.png')) )

Using the Oculus HMD, we see two 'crosshair' images (one for the left eye and the other for the right eye). How could we get a single correct 'crosshair' image using the Oculus HMD?

We very much appreciate your assistance in this regard. Thank you in advance.

Jeff 10-17-2013 03:19 PM

You can set the position and size of the html form:
Code:

vizhtml.displayCode(html,pos=[0,0],size=[800,600])
Try placing the texture quad in world coordinates:
Code:

import viz
import vizmat
import vizact
viz.go()

viz.add('dojo.osgb')

quad = viz.addTexQuad(texture=viz.add('crosshair.png'),scale=[0.03,0.03,0])
quad.disable(viz.DEPTH_TEST)
quad.drawOrder(10)
quad.billboard()

def updateCrosshair():
        line = viz.MainWindow.screenToWorld(viz.mouse.getPosition())
        worldPos = vizmat.MoveAlongVector(line.begin,line.dir,0.2)
        quad.setPosition(worldPos)
       
vizact.onupdate(0,updateCrosshair)


mshukun 10-18-2013 10:19 AM

Dear Jeff,

Thank you so much for your response. We have tested the provided code for the Oculus HMD. Thank you so much for your help, the html problem is solved; however, we still see two 'crosshair' images when We tested your provided code (adding the code below):

import oculus
hmd = oculus.Rift()
viz.link(hmd.getSensor(), viz.MainView)

The same issue was also displayed when we tested vizinfo. We did not have this issue with zSight. We are guessing that the problem may be because the images for left eye and right eye are mirrored positions and consequently the left and right images are required to be slightly different (for a stereoscopic view), but we are not sure. We appreciate your assistance again in this regard.

Thank you in advance.

Jeff 10-30-2013 09:56 AM

GUIs and texture quads need to be placed in world space in order to get fused correctly with the Oculus.

Try adjusting the value of the crosshair distance in the line below:
Code:

worldPos = vizmat.MoveAlongVector(line.begin,line.dir,0.2)
to:
Code:

worldPos = vizmat.MoveAlongVector(line.begin,line.dir,0.5)


All times are GMT -7. The time now is 01:29 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC