WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-21-2006, 03:04 PM
bjgold bjgold is offline
Member
 
Join Date: Jul 2006
Posts: 19
Center Viewport on Object (5DT Glove)

All:

Some time ago, you wrote us some code to display and capture data from a 5DT DataGlove 5 Ultra. I am now experimenting with the code, and would like to be able to center the viewport around the glove initially (the glove and viewport will not move subsequent to the initial centering), but cannot figure out how to accomplish this. Attached is some sample code.

Thanks,
Brian
Code:
#	MAIN Start
#				
viz.go()
viz.fov(65,1.3)
#viz.fov(114,1.3)
#viz.get(viz.MAIN_VIEWPOINT).translate( STARTING_VIEWPOINT_POS )
#viz.get(viz.MAIN_VIEWPOINT).lookat(0,.3,0)

phase = SHOULDER_CALIBRATION

#Setup instructions
instructions = viz.add( viz.TEXT3D, SHOULDER_CALIBRATION_INSTRUCT, viz.SCREEN )
instructions.translate( .5, .5 )
instructions.scale( INSTRUCTION_SIZE, INSTRUCTION_SIZE )
instructions.alignment( viz.TEXT_CENTER_CENTER )

#Setup videoObject
#Create a texture quad to display video texture
videoQuad = viz.add( viz.TEXQUAD, viz.SCREEN )
videoQuad.translate( .5, .5 )
videoQuad.scale( VIDEO_SCREEN_SIZE, VIDEO_SCREEN_SIZE )
#Create a transform to scale coordinates to size of video
xform = viz.Transform()
xform.setScale(640,480,1)
#Apply texture matrix to quad
videoQuad.texmat(xform)
videoQuad.visible( viz.OFF )

view = viz.get(viz.MAIN_VIEWPOINT)

#Add sensors
handSensor = viz.add('patriot.dls')
armSensor = viz.add('patriot.dls')

#Add 5DT glove
PORT_5DT_USB = 0
gloveSensor = viz.add('5dt.dls')
#viz.gloveSensor()
#gloveSensor.reset()
print gloveSensor.get()
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 06:07 PM.


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