View Single Post
Old 09-18-2014, 08:34 AM
performlabrit performlabrit is offline
Join Date: Oct 2013
Posts: 77
Copy scene1 into scene2? Useful for copying HMD window to experimental monitor.

Simple question, followed long explanation that should make this thread helpful to users of HMDs. Especially those that use eye trackers.

Simple question: How do I copy the contents of scene 1 into scene 2? Note that I will want to make additions to scene 2 that will not effect scene 1. I hope there is a computationally efficient solution.


Here's the long version:

I use eye trackers and HMDs. I want to duplicate the HMD display on a monitor that can be viewed by the experimenter. Note that HMDs require distorting the render account for the helmet optics/geometry. I do not want this distortion on the experimenter's display.

I also want to add additional information to the experimenter display (for example, the point of regard from an eyetracker).

I've made some progress already. I span a window across both displays, splitting the window into 2 views, view 1 on display 1 (experimenter) and view 2 on display 2 (HMD). The HMD display will display the root scene. The Exp display will show a copy, with some changes.

Note that, in my current setup with an NVIS SX111, I actually render across 2 displays for the HMD, and only want the EXP display to copy the left eye. For this reason, I improt the NVIS SX111 module, and multiple the width of the window by 2:

So, that's this code:

# In extend()
viz.MainWindow.setSize([monitorSizes_m[hmdMon][0]*2, monitorSizes_m[hmdMon][1]], mode=viz.WINDOW_PIXELS)
# after viz.go()
import nvis
hmd = nvis.nvisorSX111()

This had made things just a bit more complicated. I hope to switch entirely to the Oculus DKII as soon as an eye-tracker mod is available SMI!?!?)

I'll past my current progress below.
Note that this code draws upon an older thread

def extend(primaryMon = 2,leftEyeMon = 0):
	monitors = viz.window.getMonitorList()
	monitorSizes_m = []
	for m in monitors:
	ctrlwndw = viz.addWindow()
	# Position ctrlwndw on the primary monitor
	ctrlwndw.setSize(monitorSizes_m[primaryMon], mode=viz.WINDOW_PIXELS)
	ctrlwndw.setPosition(0,monitorSizes_m[primaryMon][1], mode=viz.WINDOW_PIXELS)
	viz.MainWindow.setSize([monitorSizes_m[leftEyeMon][0]*2, monitorSizes_m[leftEyeMon][1]], mode=viz.WINDOW_PIXELS)
	text1 = viz.add(viz.TEXT3D,'HMD',parent=viz.SCREEN,scene=viz.Scene1)
	text2 = viz.add(viz.TEXT3D,'EXP',parent=viz.SCREEN,scene=viz.Scene2)

extend = extend()



import nvis
hmd = nvis.nvisorSX111()

#scene1Children = viz.Scene1.getChildren()

Last edited by performlabrit; 09-18-2014 at 08:41 AM.
Reply With Quote