WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Modify tracker position before next frame (https://forum.worldviz.com/showthread.php?t=6410)

apenngrace 10-26-2022 02:39 PM

Modify tracker position before next frame
 
Is there a way to set the position of the "head" when vizconnect is running? If glasses are out of range, and the tracker value is 0,0,0, the frustrums of our CAVE displays are kind of off. I have to walk into the CAVE space and wave glasses around so that vizconnect gets a more reasonable tracker value.

When the glasses are out of range, I'd like to set a default head position value.
I'd like to be able to test for the tracker being near 0,0,0, and then provide a default head position higher up like (0.208, 1.682, -0.339). When I access the tracker with vizconnect.getTracker(), I see that there is a getPosition() method but no setPosition() method.

Is there some way to register a call-back or something to be able to review and modify the tracker position value before the next frame gets displayed?

sado_rabaudi 05-12-2023 02:02 PM

The head is usually parented to the transport, so you may try transportNode = vizconnect.getTransport('main_transport').getNode3 d()
then transportNode.setPosition (where "main_transport" is the name of your transport).

Best,
Sado

apenngrace 08-22-2023 06:37 AM

Thanks for the reply. I tried that. It seems that vizconnect calls the transport "wandmagiccarpet". So I am able to get at the node with thisTransport = vizconnect.getTransport("wandmagiccarpet").getNode().

However, when I do something like thisTransport.setPosition(0,10,0), I see the scene translate, but it does not affect the frustums in the CAVE. What ends up happening is that because the tracker values are out of range, the floor screens do not display any of the scene. They only display the clear color on the floor screens. I am guessing that it is an edge case when the frustum has zero volume (only on the floor screens).

I am wondering how I could test for the tracker to be out of range, provide default values if it is, or otherwise use real-time tracker values if they are in range.

apenngrace 09-08-2023 07:32 AM

Surprise! I finally figured out how to solve my issue! Our issue was that every time that we tried to test something in our CAVE, only a few screens would display an image and our floors would just show the clear color only. We would have to get up and wave the 3D glasses around every time we wanted to restart our program and see results.

We use Dtrack for our tracking system and VRPN to serve the data. I observed that when the glasses are out of range, it outputs [0,0,0] for the head position. I suspected that perhaps if the frustum top and bottom are on top of each other, the volume is 0 and not rendered.

I tried many things, such as digging through the cave objects, window objects, trying to mess with cave.update(), trying to look at getMatrix().getFrustum(). Nothing worked, especially since I could not get data from vizconnect regarding the windows on the remote system connecting over network with cluster master. I could not even get data when using maskedcontext and asking the client nodes to save data to disk.

Solution:
The thing that finally worked was messing with the tracker. The solution is to create a fake tracker, replace the "wrapped" tracker's reference to "raw" tracker to the fake tracker.

Code:

myGroup = viz.addGroup()
myGroup.setPosition([0,1,0])
wrapped = vizconnect.getTracker("dtrack_head")
raw_vrpn = wrapped.getRaw() # holding onto this to test if it changes from 0,0,0
wrapped.setRaw(myGroup)

I later wrote a class that starts a timer that watches if the VRPN value ever changes from [0,0,0] to other values. When that finally happens, it swaps the fake tracker and the raw vrpn tracker back.


Side Note:
I still do not quite know what the difference in terminology between the wrapped object and the raw object. They both seem like wrapped objects to me, so I was confused by this.

So apparently, there is a more generic "wrapped" tracker object, and the "raw" object is an object with characteristics specific to the particular hardware. It is VRPN and Dtrack in our case.


All times are GMT -7. The time now is 09:28 AM.

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