WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-11-2016, 09:15 AM
Seadna Seadna is offline
Member
 
Join Date: Nov 2015
Posts: 40
Question

OK I'm struggling with getting this into my code:

Code:
# 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])
                if viz.key.isDown(KEYS['up']):
                                m.preTrans([0,dm,0])
                if viz.key.isDown(KEYS['down']):
                                m.preTrans([0,-dm,0])
                if viz.key.isDown(KEYS['lt']):
                                m.turnLeft                           
                if viz.key.isDown(KEYS['rt']):
                                m.turnRight                            
                navigationNode.setPosition(m.getPosition(), viz.REL_PARENT)

vizact.ontimer(0,UpdateView)
You can see the lines I have put in with m.turnLeft and m.turnRight. These do not work like in the vizconnect example. I'm sure i need to add much more code or replace what I have here but there is so much in there that i dont know what to do with it.

I tried putting in m.preEuler(0,dm,0) and adding navigationMode.setEuler(m.getEuler(), viz.REL_PARENT) but that causes the view to rapidly spin constantly.
Reply With Quote
Reply

Tags
controls, oculus, rotate, turning, view

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
Multiple post-process effects with oculus rift lklab Vizard 2 03-13-2015 02:48 PM
Oculus runtime disrupts clustering to mirror DK2 display performlabrit Vizard 1 01-23-2015 08:00 AM
Problem with navigation trough DK2 Oculus vantsal Vizard 2 12-11-2014 04:18 AM
Oculus DK1 and DK2 in Vizard 5 Jeff Vizard 3 10-02-2014 12:00 PM
oculus rift and inertia cube interaction problems apboone Vizard 4 03-13-2014 11:45 AM


All times are GMT -7. The time now is 09:27 PM.


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