Hi,
 
   I'm writing an application where the user can walk throw the scene using KeyNavigatorBehavior. I need to know the viewer position and the direction he is looking at.
   I've been trying to use bgrp.getLocalToVworld(tmatrix) (where bgrp is my BranchGroup object) to get the Transform3D (tmatrix) object. I wrote these two functions to get viewer's position and viewing direction without success:
 
    public Point3f getUserPosition() {
        userPosition = new Point3f();
        Vector3f transSave = new Vector3f();
        tmatrix.get(transSave);
        userPosition.add(transSave);
        return userPosition;
    }

    public Vector3f getViewDirection() {
        // viewDirIni is the initial viewing direction...
        Vector3f vDirAux = new Vector3f((float)viewDirIni.x,
                                        (float)viewDirIni.y,
                                        (float)viewDirIni.z);
        Matrix3f rotM = new Matrix3f();
        tmatrix.get(rotM);
        rotM.transform(vDirAux);
        return vDirAux;
    }
 
   But when I print the values these functions return I always get the initial values set. Does anybody know what am I doing wrong?
 
   Another doubt is where can I find the javadoc for com.sun.j3d.utils.* classes.
 
   Thanks in advance.
 
   Luis Endo.



Conhe�a o novo Cad�? - Mais r�pido, mais f�cil e mais preciso.
Toda a web, 42 milh�es de p�ginas brasileiras e nova busca por imagens! =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to