WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-22-2007, 10:04 AM
Andrey Andrey is offline
Member
 
Join Date: Apr 2007
Posts: 21
Viewpoint displace

Hello,
We use HMD with cameras on the front side. The cameras location/orientation differs from the location of HMD LED and the orientation of InertiaCube. How to displace the viewpoint and to incline the viewvector while automatic tracking in order to coincide them with cameras location and orientation?

Thank you.
Reply With Quote
  #2  
Old 06-22-2007, 10:26 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

If you want to offset the viewpoint from the tracker, then you cannot use automatic head tracking with Vizard 2.5. If you are willing to use Vizard 3.0, it comes with built-in features to do just this. With 2.5 you will have to manually compute the tracker matrix and apply the LED/Camera offset yourself. The code would be something like this:
Code:
m = computeTrackerTransform() #You must implement this
LED_CAMERA_OFFSET = [0,-0.01,0.01] #Position offset of camera relative to LED
m.preTrans(LED_CAMERA_OFFSET)

print m.getTrans() #Camera position
Reply With Quote
  #3  
Old 06-22-2007, 10:45 AM
Andrey Andrey is offline
Member
 
Join Date: Apr 2007
Posts: 21
Thanks. And how to do that with Vizard 3.0?
Reply With Quote
  #4  
Old 06-22-2007, 11:04 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Vizard 3.0 has an entirely new interface for linking trackers to views and nodes. To link the tracker to the viewpoint with the specified offset you would do something like the following:
Code:
viewLink = viz.link(tracker,viz.MainView)
viewLink.preTrans(LED_CAMERA_OFFSET)
Reply With Quote
  #5  
Old 06-22-2007, 12:02 PM
Andrey Andrey is offline
Member
 
Join Date: Apr 2007
Posts: 21
Please take a look at the code:

view = viz.get(viz.MAIN_VIEWPOINT)
led1 = viz.add('vizppt.dls')
PORT_INTERSENSE = 2
gyro = viz.add('intersense.dls')
LED_CAMERA_OFFSET = [0,-0.15,0.25]
viewLink = viz.link(gyro,viz.MainView)
viewLink.preTrans(LED_CAMERA_OFFSET)
viz.tracker()

What is wrong?
Reply With Quote
  #6  
Old 06-22-2007, 12:11 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Try the following code:
Code:
led1 = viz.add('vizppt.dls')
PORT_INTERSENSE = 2
gyro = viz.add('intersense.dls')
LED_CAMERA_OFFSET = [0,-0.15,0.25]
viewLink = viz.link(viz.mergeLinkable(led1,gyro),viz.MainView)
viewLink.preTrans(LED_CAMERA_OFFSET)
You do not need to use viz.tracker() when using links. Also, you need to combine the ppt and intersense tracker into a single 6DOF object. This is what the viz.mergeLinkable command does.
Reply With Quote
  #7  
Old 06-22-2007, 12:27 PM
Andrey Andrey is offline
Member
 
Join Date: Apr 2007
Posts: 21
Thank you, the offset works. But how to "incline" viewvector (cameras orientation differs from InertiaCube orientaion)?
Reply With Quote
  #8  
Old 06-22-2007, 12:32 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

You can apply a offset rotation to the intersense by adding the following code:
Code:
viewLink.preEuler([0,-5,0],target=viz.LINK_ORI_OP) #Tilt intersense 5 degrees up
Reply With Quote
  #9  
Old 06-22-2007, 01:01 PM
Andrey Andrey is offline
Member
 
Join Date: Apr 2007
Posts: 21
Thanks a lot. Problem is solved.
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


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


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