3d-movement
I use "vizcave" and I would like to navigate the vitual viewpoint via keyboard. For the real-position of the user I use a tracking-system and for navigation I would like to use the keyboard.
Code:
#Virtual viewpoint (Translate view origin 1 meter up and back) Code:
def onKeyDown(key): - First, the movement is not very smooth and - If I rotate the viewpoint (origin.setEuler()) the direction of the movement is the same as before (if I rotate -90 degrees yaw, I have to press "go left" to move forward). How can I smoothen the movement? Is there a function to automatically adapt the movement to the current pos? |
For the second "problem" I found a posible solution:
Code:
if key == 'z': #forward Do you know a better way? |
You can use the viztracker.Keyboard6DOF() object to setup keyboard navigation and link it to the CaveView object. Here is sample code:
Code:
import viztracker forward - key for moving forward backward - key for moving backward right - key for strafing right left - key for strafing left turnRight - key for rotating right turnLeft - key for rotating left For example, if you wanted to use the arrow keys for moving around you would use the following code to create the keyboard tracker object: Code:
keyTracker = viztracker.Keyboard6DOF(forward=viz.KEY_UP,backward=viz.KEY_DOWN,left=viz.KEY_LEFT,right=viz.KEY_RIGHT) |
All times are GMT -7. The time now is 05:01 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC