![]() |
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||
|
|||
|
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])
|
|
#3
|
|||
|
|||
|
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?
|
|
#4
|
|||
|
|||
|
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)
|
|
#5
|
|||
|
|||
|
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? |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| why is time faster in my virtual world? | billjarrold | Vizard | 1 | 11-24-2009 06:33 PM |
| What are the options for making a movie of a Vizard world? | Karla | Vizard | 1 | 05-13-2008 11:56 AM |
| Pre/Post transformations | pattie | Vizard | 5 | 10-02-2006 05:20 PM |
| General Questions about Vizard: World Viz | dav | Vizard | 5 | 08-28-2006 04:44 PM |
| Avatar bone rotations respect to world | MiamiTodd | Vizard | 3 | 02-14-2006 11:41 AM |