View Full Version : vizcave not working properly - coordinate systems

01-08-2013, 12:33 PM

I created a cave, and Keyboard6DOF tracker. I then enabled drawWalls, to debug.

When I press arrow keys to move the eyes closer to the CAVE wall, the field of view widens, as expected; however, the eyes do not move within the cave, and results in seeing the SIDE walls as well as the front wall.

It appears to me, that rather than moving the eyepoint within the CAVE, this is moving the actual cave environment, but keeping the eyes stationary within the world.

This results in the correct relative field of views for the eyes, but doesn't make any sense in terms of tracking.

Clearly, a tracking system is tracking a moving eyepoint within a stationary cave, not tracking a moving cave with stationary eyepoint.

This is making it rather confusing to create a properly functioning CAVE environment. Can anyone shed some light on this? Is there some obscure reason it is implemented in this way that I am not aware of?

01-08-2013, 04:10 PM
Can you post the code for your script? Have you looked at the vizcave documentation, specifically the powerwall example (http://docs.worldviz.com/vizard/vizcave_powerwall.htm)? This is a very minimal example that goes over the basic steps for setting up a cave in Vizard.

01-10-2013, 12:07 PM
Using the example from:

I added the line:

I then ran it, and moved around with the WASD keys, and the powerwall appeared static, with the view frustrum changing (exactly as a cave should behave).

However, looking at the code there is a spot I don't understand:

Create CaveView object for manipulating the virtual viewpoint.
cave_origin is a node that controls the position of the cave within the virtual world.
For example, if you wanted to simulate the cave user flying through an environment,
you would apply the transformation to the cave_origin node.
cave_origin = vizcave.CaveView(head_tracker)

Why would the cave origin rely on where a head tracker is located? Is that not what the above line implies? Wouldn't the cave origin be static, regardless of where a users head location is?

I tried commenting out the cave_origin associated lines

#cave_origin = vizcave.CaveView(head_tracker)
#origin_tracker = viztracker.KeyboardMouse6DOF()
#origin_link = viz.link(origin_tracker, cave_origin)

To me, I wold expect this to still work properly, as I have a cave whose origin is static, I have a head tracker, and my head tracker can move.

However, if I run it without the cave_origin tied to head tracker, it doesn't appear to work properly.

It seems to me, that this means that behind the scenes, what is happening if the head-tracker position updates, is that the camera stays in the same place, but the FOV changes, instead of moving the camera, as well as adjusting the FOV.

From this, it looks to me like the origin of the CAVE co-ordinates is based on where the current head tracker is located... I think?

I'm just having trouble understanding why the cave_origin is linked to the head tracker location, since in practice, the CAVE does not move when a user moves around their head.

01-10-2013, 12:47 PM
The CaveVisualizer.py example script (File -> Quick Open -> type "cavevisualizer") that comes with Vizard should help visualize how the head_tracker and cave_origin objects are used to construct the final rendered viewpoint. If you haven't already had a look at it, I would recommend you do so.

The Cave class only uses the head_tracker object to update the projection matrix. The projection matrix is computed using the users physical eye location relative to each wall. It does not update the virtual viewpoint (i.e. viz.MainView).

The CaveView class is used to modify the virtual viewpoint. The final viewpoint will be composed of the cave origin and the users physical head location. Think of the cave as a flying carpet in this virtual world. The cave_origin is the carpet, and the head_tracker is the user standing on the carpet.

Hope this clears things up.

01-11-2013, 10:05 AM
Thanks farshizzo. What you explained is exactly what I expect. I expect cave_origin to be a magic carpet, and head_tracker to be the user standing on said carpet.

In the below code, I am trying to make a head_tracker, without a magic carpet, but I must be doing something wrong because it doesn't behave as such.


import viz
import vizcave
import viztracker

height = 3
width = 4
depth = 3


cave = vizcave.Cave()
FrontWall = vizcave.Wall(
name='Front Wall')


viewTracker = viztracker.Keyboard6DOF()

01-11-2013, 10:26 AM
The reason your script does not behave properly is because it is not setting up any link between the head tracker and the main viewpoint. As I mentioned previously, the CaveView class is used to setup such a link. If you don't need the magic carpet functionality, then simply ignore the cave_origin object, which defaults to [0,0,0] anyway. Adding the following code to your script should fix the issue:vizcave.CaveView(viewTracker)
If you insist on not using the CaveView class, then you can manually create the link between the head tracker and main view using the following code:viz.link(viewTracker,viz.MainView,mask=viz.LI NK_POS)Both the code snippets above are functionally equivalent. The CaveView class just provides the added magic carpet functionality, which is purely optional.

01-14-2013, 09:27 AM
Aha! I figured if I gave the cave object the viewTracker with setTracker, it would do all things necessary with the viewTracker. Adding vizcave.CaveView(viewTracker) makes everything behave as I would expect.

Thank you for the support - much appreciated!