WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-20-2017, 03:39 AM
rajnishv rajnishv is offline
Member
 
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
Smile Regarding switching between viewpoints of 2 different vizconnects files

Hi Jeff,
I am using 2 vizconnect in my vizard script.
I am able to switch between 8 viewpoints of the same 1 single vizconnect.
But i am having problem to switch between viewpoint from 1st vizconnect to the viewpoint of the 2nd vizconnect.

I have tested and changed the viewpoints using a single vizconnect using the following code for 8 different viewpoints for same vizconnect:

Code:
import viz
import vizact
import vizconnect
import viztask


# start the vizconnect session stored in the given directory
vizconnect.go("vizconnect_config.py")

# oriMode sets what the viewpoint is resetting to. For example...
# vizconnect.VIEWPOINT_MATCH_DISPLAY
# matches orientation of the display to the orientation of the viewpoint
# 
# vizconnect.VIEWPOINT_MATCH_FEET
# matches orientation of the feet to the orientation of the viewpoint
# 
# vizconnect.VIEWPOINT_MATCH_BASE
# matches orientation of the base object (transport, avatar, tracker) to the orientation of the viewpoint
#
# Similar for posMode
oriMode = vizconnect.VIEWPOINT_MATCH_DISPLAY
posMode = vizconnect.VIEWPOINT_MATCH_FEET

# Add a viewpoint.
vp1 = vizconnect.addViewpoint(	pos=[-13.24803, 12.28260, 8.83578],
								euler=[90, 0, 0],
								posMode=posMode,
								oriMode=oriMode,
								constant=False,
								)
vp2 = vizconnect.addViewpoint(	pos=[-17.24803, 4.28260, 5.83578],
								euler=[90, 0, 0],
								posMode=posMode,
								oriMode=oriMode,
								constant=False,
								)
# Displays are added to viewpoints, the viewpoint will traverse the scenegraph to
# determine if the display is attached to an avatar, tracker, etc in order to
# perform the requested resets.
#vp1.add(vizconnect.getDisplay())



# add an environment
viz.add('piazza.osgb')

display = vizconnect.getDisplay()

def viewTask():
	
	while True:
		vp1.add(display)
		vizconnect.resetViewpoints()
		print'before 1st waitkeydown '
		yield viztask.waitKeyDown(' ')
		vp1.remove(display)
		vp2.add(display)
		vizconnect.resetViewpoints()
		print'before 2nd waitkeydown '
		yield viztask.waitKeyDown(' ')
		vp2.remove(display)
	
viztask.schedule( viewTask() )

For Ex:

1st Vizonnect - vizconnect.go('vizconnectfile 1') with viewpointFirst=vizconnect.addViewpoint(..)


2nd Vizonnect - vizconnect.go('vizconnectfile 2') with viewpointSecond=vizconnect.addViewpoint(...)


Now i have to switch between viewpoints 'viewpointFirst' and 'viewpointSecond' and vice versa.

Note:I am loading a single Vizconnect one at a time using a def function():

Pls assist further

Last edited by rajnishv; 03-20-2017 at 03:43 AM.
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 edit the skin tones of the complete characters' cfg files? vEsotu Vizard 3 09-23-2008 12:07 PM
Which software can be used to edit .cfg (CAL3D) files luakt Vizard 4 09-12-2008 07:18 AM
Error when playing wav files...? vjonshih Vizard 1 05-23-2005 12:21 PM
loading large wav files in vizard tommahhh Vizard 1 05-16-2005 03:23 PM
Including Files that Include Other Files vjosh Vizard 1 09-21-2004 04:44 PM


All times are GMT -7. The time now is 02:11 PM.


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