WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-08-2009, 02:34 PM
JimC JimC is offline
Member
 
Join Date: Jun 2009
Posts: 42
Question CAVE, navigation, tracked wand, coordinate systems

I have Vizard running on two walls of a CAVE. Head-tracking is working perfectly, and I can use a tracked wand to point and fly around. Here's a code fragment to indicate what I've done so far:

Code:
# SyzygyTracker subclasses viz.VizNode+viz.EventClass
viewtracker = SyzygyTracker( service, matrixIndex=0 )
# Ditto for SyzygyNagivator
navTracker = SyzygyNagivator( service, matrixIndex=1, xIndex=0, zIndex=1, speed=1. )
# Create and configure a Cave object
cave = vizcave.Cave()
makeCAVE( cave )

# Attach the head tracker
cave.setTracker( pos=viewtracker, ori=viewtracker )

# Attach the navigation (wand) tracker.
caveorigin = vizcave.CaveView( viewtracker )
navLink = viz.link( navTracker, caveorigin )
I want to have a virtual object attached to the wand. I defined another tracker object tied to the wand and tried the following:

Code:
wandTracker = SyzygyTracker( service, matrixIndex=1 )
wandRender = viz.add('box.wrl')
wandRender.setScale( .02, .02, 2. )
wandLink = viz.link( wandTracker, wandRender )
...which initially works great, I end up with a virtual rod attached to the wand. However, its position is being set in world coordinates, so as soon as I start flying around it gets left behind. I've tried setting various Src and Dest flags on the link, or add()ing it to the caveorigin, but I don't really understand what I'm doing and the things I've tried so far haven't worked. What's the right way to do this?

Thanks,
-Jim
Reply With Quote
  #2  
Old 10-08-2009, 03:05 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Have you tried setting the cave origin as the parent of the wand object?
Code:
wandRender = viz.add('box.wrl',parent= caveorigin)
This should work as long as your wandtracker/viewtracker objects share the same coordinate system.
Reply With Quote
  #3  
Old 10-09-2009, 09:09 AM
JimC JimC is offline
Member
 
Join Date: Jun 2009
Posts: 42
Not quite, I'm afraid. That is, it may be mathematically correct, but when I set parent=caveorigin, the node's drawImplementation() never gets called (determined by substituting a Python custom node for the Box.wrl).
Reply With Quote
  #4  
Old 10-09-2009, 09:19 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
What version of Vizard are you running? In older versions, nodes parented to CaveOrigin objects would not be rendered, but this should be fixed in newer versions.
Reply With Quote
  #5  
Old 10-09-2009, 09:24 AM
JimC JimC is offline
Member
 
Join Date: Jun 2009
Posts: 42
3.13.0002. Too old?
Reply With Quote
  #6  
Old 10-09-2009, 09:29 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I believe the fix appeared in version 3.14, so you are one version too old. We just released 3.15 last week. Click on Help -> Check for updates in the Vizard menu and it should take you to a download link for the latest version.
Reply With Quote
  #7  
Old 10-09-2009, 12:43 PM
JimC JimC is offline
Member
 
Join Date: Jun 2009
Posts: 42
Thumbs up

Thanks, it's working now. So is wand-based picking, though it took me about an hour to realize that viz.intersect() was always returning the virtual rod that I'd just attached to the wand...
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
navigation in cave environment Andy Vizard 4 03-28-2008 01:32 AM


All times are GMT -7. The time now is 12:02 PM.


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