WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-08-2013, 12:33 PM
jpriede jpriede is offline
Member
 
Join Date: Dec 2012
Posts: 10
vizcave not working properly - coordinate systems

Hello.

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?
Reply With Quote
  #2  
Old 01-08-2013, 04:10 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Can you post the code for your script? Have you looked at the vizcave documentation, specifically the powerwall example? This is a very minimal example that goes over the basic steps for setting up a cave in Vizard.
Reply With Quote
  #3  
Old 01-10-2013, 12:07 PM
jpriede jpriede is offline
Member
 
Join Date: Dec 2012
Posts: 10
PowerWall example (modified)

Using the example from:
http://docs.worldviz.com/vizard/vizcave_powerwall.htm

I added the line:
cave.drawWalls()

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.
Reply With Quote
  #4  
Old 01-10-2013, 12:47 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #5  
Old 01-11-2013, 10:05 AM
jpriede jpriede is offline
Member
 
Join Date: Dec 2012
Posts: 10
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

viz.go()
viz.add('gallery.ive')
height = 3
width = 4
depth = 3

A=-width/2,height,depth
B=width/2,height,depth
C=-width/2,0,depth
D=width/2,0,depth

cave = vizcave.Cave()
FrontWall = vizcave.Wall(
upperLeft=A,
upperRight=B,
lowerLeft=C,
lowerRight=D,
name='Front Wall')

cave.addWall(FrontWall)
cave.drawWalls()

viewTracker = viztracker.Keyboard6DOF()
cave.setTracker(viewTracker)
Reply With Quote
  #6  
Old 01-11-2013, 10:26 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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:
Code:
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:
Code:
viz.link(viewTracker,viz.MainView,mask=viz.LINK_POS)
Both the code snippets above are functionally equivalent. The CaveView class just provides the added magic carpet functionality, which is purely optional.
Reply With Quote
  #7  
Old 01-14-2013, 09:27 AM
jpriede jpriede is offline
Member
 
Join Date: Dec 2012
Posts: 10
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!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any working 3D Vision - quadro systems? Jerry Vizard 0 10-20-2010 12:19 PM
Properly aligning the intersense with the PPT Systems Z Axis shivanangel Precision Position Tracker (PPT) 0 11-10-2009 11:35 AM
CAVE, navigation, tracked wand, coordinate systems JimC Vizard 6 10-09-2009 12:43 PM
creating multiple coordinate systems and making them visible jalvarez Vizard 1 02-27-2009 12:36 PM
Transforming coordinate systems. v-Salik Vizard 1 09-19-2007 07:45 PM


All times are GMT -7. The time now is 01:33 PM.


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