![]()  | 
	
| 
	 | 
| 
		 
			 
			#1  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
				
				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?  | 
| 
		 
			 
			#2  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
		
		 
			
			Is the tracker on the HMD 6DOF or 3DOF orientation? Either way, to integrate HMD tracking you should just need to use the <link>.preMultLinkable command. After you have setup the link between the car and the viewpoint, just add the following code: 
		
		
		
		
		
		
		
		
	
	Code: 
	view_link.preMultLinkable(tracker)  | 
| 
		 
			 
			#3  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
		
		 Quote: 
	
 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?  | 
| 
		 
			 
			#4  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
		
		 
			
			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.
		 
		
		
		
		
		
		
		
		
	
	 | 
| 
		 
			 
			#5  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
		
		 
			
			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.  | 
| 
		 
			 
			#6  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
		
		 
			
			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!  | 
![]()  | 
	
	
		
  | 
	
		
  |