PDA

View Full Version : Viewpoint displace


Andrey
06-22-2007, 10:04 AM
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.

farshizzo
06-22-2007, 10:26 AM
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: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

Andrey
06-22-2007, 10:45 AM
Thanks. And how to do that with Vizard 3.0?

farshizzo
06-22-2007, 11:04 AM
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:viewLink = viz.link(tracker,viz.MainView)
viewLink.preTrans(LED_CAMERA_OFFSET)

Andrey
06-22-2007, 12:02 PM
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?

farshizzo
06-22-2007, 12:11 PM
Hi,

Try the following 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.

Andrey
06-22-2007, 12:27 PM
Thank you, the offset works. But how to "incline" viewvector (cameras orientation differs from InertiaCube orientaion)?

farshizzo
06-22-2007, 12:32 PM
Hi,

You can apply a offset rotation to the intersense by adding the following code:viewLink.preEuler([0,-5,0],target=viz.LINK_ORI_OP) #Tilt intersense 5 degrees up

Andrey
06-22-2007, 01:01 PM
Thanks a lot. Problem is solved.