WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 01-12-2016, 08:25 AM
bbb bbb is offline
Join Date: Nov 2015
Posts: 46
getPosition and getEuler using oculus with xbox or keyboard


I'm trying to find a function like viz.MainView.getPosition and
viz.MainView.getEuler for a combination of oculus DK2 with keyboard or xbox.

For example, if i have a link between oculus and keyboard like this:

# Key commands
KEYS = { 'forward' : viz.KEY_UP
,'back' : viz.KEY_DOWN
,'left' : viz.KEY_LEFT
,'right' : viz.KEY_RIGHT
,'reset' : 'r'
,'camera' : 'c'
,'help' : ' '
# Setup navigation node and link to main view
navigationNode = viz.addGroup()
viewLink =, viz.MainView)

# Setup arrow key navigation
def UpdateView():
yaw,pitch,roll = viewLink.getEuler()
m = viz.Matrix.euler(yaw,0,0)
dm = viz.getFrameElapsed() * MOVE_SPEED
if viz.key.isDown(KEYS['forward']):
if viz.key.isDown(KEYS['back']):
if viz.key.isDown(KEYS['left']):
if viz.key.isDown(KEYS['right']):
navigationNode.setPosition(m.getPosition(), viz.REL_PARENT)

how do i get position and orientation?

Reply With Quote
Old 01-12-2016, 08:34 AM
bbb bbb is offline
Join Date: Nov 2015
Posts: 46
I mean how do i get x,y,z position and orientation? I need to write the changes in position and orientation every 0.1 ms into a file for analaysis.
Reply With Quote
Old 01-12-2016, 01:14 PM
haohaoxuexi1 haohaoxuexi1 is offline
Join Date: Sep 2015
Posts: 81
you can define a function to get the position of the sensor

and use "ontimer" to run the function every frame

the command should be getPosition and getEuler

hope it can help you
Reply With Quote
Old 01-13-2016, 06:52 AM
bbb bbb is offline
Join Date: Nov 2015
Posts: 46
Thanks for your answer, i thought about it myself but the problem with that as far
as i understand is it only give me position and orientation from the HMD sensor but not from keyboard/xbox movememt or HMD&keyboard/xbox movement togethere.
Reply With Quote

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

All times are GMT -7. The time now is 08:26 AM.

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