WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   How can I link MainView with HMD and a 3d node? (https://forum.worldviz.com/showthread.php?t=3656)

Salvar 03-19-2011 01:07 PM

How can I link MainView with HMD and a 3d node?
 
Hi all,

I've hit a technical snag in the research project I'm currently working on.

I have a virtual environment, containing a 3d node (car). The car is controlled by a custom action class I wrote for it.

To keep the viewpoint in tandem with the car, I have viz.MainView linked with the car. Everything works well and good. I move the car, mainview moves with it.

Now, I want to add HMD head-tracking into the mix. And that seems to be tricky. If I link the mainview with the HMD tracker after linking to the car, the car link breaks and it doesn't move with the car anymore. And vice versa.

How can I get these two things to work together?

farshizzo 03-21-2011 09:23 AM

Is the tracker on the HMD 6DOF or 3DOF orientation? Either way, to integrate HMD tracking you should just need to use the .preMultLinkable command. After you have setup the link between the car and the viewpoint, just add the following code:
Code:

view_link.preMultLinkable(tracker)
The HMD tracker data should now be applied relative to the car orientation.

Salvar 03-22-2011 12:13 PM

Quote:

Originally Posted by farshizzo (Post 12287)
Is the tracker on the HMD 6DOF or 3DOF orientation? Either way, to integrate HMD tracking you should just need to use the .preMultLinkable command. After you have setup the link between the car and the viewpoint, just add the following code:
Code:

view_link.preMultLinkable(tracker)
The HMD tracker data should now be applied relative to the car orientation.

Thanks for the response.

I was hoping for the solution to be something simple as this, but it gives me an error saying that the tracker object (added with the command "polhemus = viz.add('polhemus.dle')") is not a linkable.

Is there any way to make it linkable?

farshizzo 03-22-2011 12:20 PM

That is because the polhemus object is not linkable, it is an extension. Have a look at the documentation for the polhemus plugin on how to connect to a polhemus tracker. You never mentioned which tracker you are using, but the documentation page should describe how to connect to all supported polhemus trackers.

Salvar 03-22-2011 12:31 PM

Oh, wait. I was trying to link to the extension, not the liberty tracker itself. Awkward.

I don't have access to the tracker to test this now, but it runs without the linking error now. Here's hoping.

Thanks for the help.

Salvar 03-22-2011 08:14 PM

Just to close this thread, I tried the preMultLinkable call you suggested and it worked perfectly. I had to apply a preEuler command to the link first, but after that it was gravy.

Thanks!


All times are GMT -7. The time now is 01:26 AM.

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