WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   World Transformations (https://forum.worldviz.com/showthread.php?t=3057)

c4am95 10-31-2010 02:08 PM

World Transformations
 
Hello. I'm using an HMD and intersense tracker. Code-wise, I use methods like "link.postTrans", etc. to apply virtual world transformations when using the HMD directly. However, I want to use the environment for testing as well, so I'm trying to find an easy way to apply world transformations without the tracker. It's surprisingly not as easy as I thought it would be. How could I, for example, rotate the entire world 180 degrees so that the camera is situated in the same position and now facing the other way, but the virtual subject it represents hasn't physically turned around?

Jeff 11-02-2010 12:32 PM

You can link the viewpoint to a mouse/keyboard tracker and apply a link operator to that:
Code:

import viz
viz.go()

gallery = viz.addChild('gallery.ive')

import viztracker
tracker = viztracker.KeyboardMouse6DOF()

link = viz.link(tracker,viz.MainView)
link.postEuler([180,0,0])

Does this do what you want?

c4am95 11-07-2010 11:53 AM

this could work. but how do you change the properties of viztracker? for example, if i only want movement in x and z (no flying), how do i reduce the degrees of freedom?

Jeff 11-08-2010 09:10 AM

Does the following work for you?

Code:

import viz
import vizact

viz.go()

gallery = viz.addChild('gallery.ive')

import viztracker
tracker = viztracker.KeyboardMouse6DOF()

fixedTracker = viz.addGroup()

link = viz.link(fixedTracker,viz.MainView)
link.postEuler([180,0,0])

def updateView():
        x,y,z = tracker.getPosition()
        fixedTracker.setPosition(x,1.8,z)
        fixedTracker.setEuler(tracker.getEuler())

vizact.ontimer(0,updateView)


c4am95 11-09-2010 12:50 PM

yeah that works well. albeit, it made the eyeheight incredibly high for some reason. when i used instead:
fixedTracker.setPosition(x, 0, z)
it looked normal. bizarre?


All times are GMT -7. The time now is 01:51 AM.

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