WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 04-10-2014, 11:36 AM
Alex Miranda Alex Miranda is offline
Join Date: Mar 2014
Posts: 21
Set Size ViewPoint by Keyboard

Firstly, i would like to thanks everyone that helped me, and I have more one question. How can I set the size of window using keyboard?

For example: I've defined "upLeftWindow.setSize(.436, .93)", but for using the correct size, i need to do many tests to find it. If i wanted use to any button to set it in real time, would be possible?
Reply With Quote
Old 04-11-2014, 06:12 AM
Erikvdb Erikvdb is offline
Join Date: May 2013
Posts: 63
Sure, <window>.setSize() works during runtime as well, so for finding the right window size by tweaking it step-by-step you can have a little code like this:

x = 0.5 #initial size window X
y = 0.5 #initial size window Y

upLeftWindow = viz.addWindow()

def onKeyDown(key):
	global x, y
	if key == '-': 
		x -= 0.05 #step size
	elif key == '=':
		x += 0.05 #step size
	print x, y


Pressing - or = will increase or decrease the X size of the window, you can map other keys for the Y size in a similar fashion.
Reply With Quote
Old 04-15-2014, 07:21 AM
Alex Miranda Alex Miranda is offline
Join Date: Mar 2014
Posts: 21

Thank for help me! The code run!
Reply With Quote

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
How to track the actual viewpoint Jerry Vizard 3 05-25-2016 09:44 AM
Unexpected Change of Window Size javadi Vizard 7 07-23-2013 02:56 PM
Intermittent orthographic stereo projection problems AySz88 Vizard 10 02-17-2012 12:50 PM
Avatar w/ hat cannot look at viewpoint TrashcanPatrol Vizard 5 08-19-2008 08:26 AM
VRML Viewpoint error bstankie Vizard 1 03-11-2003 02:10 PM

All times are GMT -7. The time now is 10:55 AM.

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