#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
Thanks. And how to do that with Vizard 3.0?
|
#4
|
|||
|
|||
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) |
#5
|
|||
|
|||
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? |
#6
|
|||
|
|||
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) |
#7
|
|||
|
|||
Thank you, the offset works. But how to "incline" viewvector (cameras orientation differs from InertiaCube orientaion)?
|
#8
|
|||
|
|||
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 |
#9
|
|||
|
|||
Thanks a lot. Problem is solved.
|
|
|