WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-05-2015, 07:01 AM
Thummi Thummi is offline
Member
 
Join Date: Aug 2015
Posts: 3
How to call viz.go() from a GUI

Hey,

currently i am working on the GUI for a project and i got stuck on a stupid problem.
If i try to call viz.go() via a button it does not work as it should. I get stuck in the loading animation


If i call viz.go() in an otherwise empty script it works as it should.

I created the GUI with pyQT and qt Designer and the button is connected to a method which calls the method of an other object, which contains the viz.go() call.

Code:
	def __init__(self):
		super(MainWindow, self).__init__()
		uic.loadUi('ballconfig.ui', self)
		self.application = Application.application()
		self.show()

		.....
		
		#Connect the buttons.
....
		self.start_Button.clicked.connect(self.onStartSimulation)
.....

def onStartSimulation(self):

	self.application.start()

def start(self):
		#Video settings
		#viz.setMultiSample(4)
		#viz.fov(110)

		viz.go()
                '''
                 rest
                '''
That is the way the code looks like currently. I currently don't have the slightest clue why it does not work. Did i forget anything(i hope) or is this a known issue(i hope not) ?
Reply With Quote
  #2  
Old 08-05-2015, 03:25 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The PyQt article in our knowledge base shows how to embed the Vizard graphics window inside a PyQt application
Reply With Quote
  #3  
Old 08-06-2015, 11:32 AM
Thummi Thummi is offline
Member
 
Join Date: Aug 2015
Posts: 3
Hey,

thanks for the information. Now i can view the running Simulation in an embedded window.

Now if you dont mind, i have two follow up questions.

1. Is there a way to use a method provided by the vizard libraries to display the simulation in fullscreen mode or do i have to use methods provided by the qt-framework? I assume the later, but i´m pretty new to working with QT/Viz, so sorry if it is a stupid question.

2. How do GUIs interact with a hmd, or an oculus rift to be more specific, in vizard ? Does
Code:
hmd = oculus.Rift()
work as normal or is theresomething else i have to consider ?
Reply With Quote
  #4  
Old 08-06-2015, 02:30 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
1. Try changing the size in the following line of the PyQt example script to match your screen resolution:

Code:
self.resize(800,600)
2. Take a look a the oculusExample.py script included with Vizard. That uses a GUI canvas to place GUIs in the world at a fixed distance from the viewpoint.
Reply With Quote
  #5  
Old 08-06-2015, 07:15 PM
Thummi Thummi is offline
Member
 
Join Date: Aug 2015
Posts: 3
Ok, thx for the answer for the first question.

And sorry, i formulated the second question badly.
What i meant was:
Can i display the simulation on an oculus rift, if i start it via a GUI that was designed with pyqt ?
What we want to to is configure some settings of the simulation with the GUI and then start and display it on an oculus rift.
Reply With Quote
  #6  
Old 08-07-2015, 04:40 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Yes, it should work. I just tested the sample PyQt script with Direct HMD mode in the Oculus and the PyQt menu only appears in the mirrored window. Just make sure to add the oculus rift command:

Code:
viz.go(viz.EMBEDDED,window=int(self.widget.winId()))

import oculus
hmd = oculus.Rift()
viz.link(hmd.getSensor(), viz.MainView)
Vizard also has a number of built-in GUI libraries (vizinfo, vizdlg, vizconfig, vizmenu) that you could use to select options before the simulation starts.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Call STL files kk88 Vizard 0 11-24-2010 01:12 PM
Pspice Call jassel41 Vizard 1 10-08-2010 11:16 AM
Call objects created within definitions lilio Vizard 4 07-13-2009 11:13 AM
Director call not working vizmaster Vizard 1 08-21-2008 10:08 AM
Fading/lightening-Problem and viz.go in module Johannes Vizard 6 09-02-2005 04:28 PM


All times are GMT -7. The time now is 05:11 AM.


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