WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-21-2006, 11:39 AM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Multiple Viewports in Vizard, Utilizing keyboard callback

Hi,

I tried to create 4 viewports on the screen at once.
I have the main viewport, and then
3 viewports on the side.

I used a simple keyboard callback function to
turn the viewports on and off.

Below is the code I am using.

Everything works fine up until I press a,s, or d 4 times. After
the fourth press, Vizard will crash.

Is this just sloppy implementation on my part?

Also, the next thing I will be working on when these
viewports stop crashing is making the viewport
lock in on whatever the previous view was.

Can I simply set the
viewpoint of the window
to the main cameras view
and update it every time there
is a keyboard event (which in my
case will only make the viewports
turn on and off).

~~Thanks,

George

Code:
################################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Keyboard
################################################

def mykeyboard(key):
	view = viz.add(viz.VIEWPOINT)
	if key == 'a':
		window1.visible(viz.TOGGLE) # Hide the window

	elif key == 's':
		window2.visible(viz.TOGGLE) # Hide the window

	elif key == 'd':
		window3.visible(viz.TOGGLE) # Hide the window

		
		
		
################################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Objects
################################################


viz.add('outersphere.IVE')
viz.add('innersphere.IVE')
viz.add('plane.IVE')

window1 = viz.add(viz.WINDOW)
window1.position(0,1)
window2 = viz.add(viz.WINDOW)
window2.position(0,0.25)
window3 = viz.add(viz.WINDOW)
window3.position(1,0.25)



################################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Callback
################################################


viz.callback(viz.KEYBOARD_EVENT,mykeyboard)
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


All times are GMT -7. The time now is 04:53 AM.


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