I wrote a small application which uses a stand-alone-viewer, just like in your tutorial ViewerFromScratch, but is there any way to use keyboard-input for the avatar-navigation (like WASD-keys for navigation with fixed y-axis)? I'm not able to find any hint on this topic but it works fine in the applications, that uses the vr-viewer...
thx for your help!
edit:
I was able to add a keylistener in my viewer-class, like this:
Code: Select all
Component comp = ((Component) this.getViewingComponent());
comp.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent input) {
switch(input.getKeyCode()) {
case KeyEvent.VK_W:
edit:
I was able to handle translation about all 3 directions with this:
Code: Select all
m = camNode.getTransformation().getMatrix();
m[3]-=0.1;
camNode.getTransformation().setMatrix(m);