WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

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

Hello,

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.link(navigationNode, viz.MainView)
viewLink.preMultLinkable(hmd.getSensor())

# Setup arrow key navigation
MOVE_SPEED = 2.0
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']):
m.preTrans([0,0,dm])
if viz.key.isDown(KEYS['back']):
m.preTrans([0,0,-dm])
if viz.key.isDown(KEYS['left']):
m.preTrans([-dm,0,0])
if viz.key.isDown(KEYS['right']):
m.preTrans([dm,0,0])
navigationNode.setPosition(m.getPosition(), viz.REL_PARENT)
vizact.ontimer(0,UpdateView)

how do i get position and orientation?

Thanks
Reply With Quote
 


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 02:42 PM.


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