[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl AbstractViewListener.java,1.1.1.1,1.2
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2005-07-18 10:44:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv671 Modified Files: AbstractViewListener.java Log Message: Added default methods for movement and rotation Index: AbstractViewListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/AbstractViewListener.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AbstractViewListener.java 14 Jul 2005 09:49:59 -0000 1.1.1.1 --- AbstractViewListener.java 18 Jul 2005 10:44:33 -0000 1.2 *************** *** 32,35 **** --- 32,41 ---- protected static double size = 25.0; + /** The view transformation matrix (it is shown transposed) see p. 187 [GL BIBLE]*/ + protected static double[] viewTrans = new double[] {1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0}; + /** * The initialization part of the 3D view *************** *** 80,86 **** --- 86,143 ---- /** + * Overwrite the view matrix + * @param m The new ViewMatrix + */ + public void setViewMatrix(double[] m) { + this.viewTrans = m; + } + + /** + * Thanslate the view matrix center not relatively + * mv[0] is along x, mv[1] along y and mv[2] is along z + * @param mv the move vector + */ + public void translateViewMatrix(double [] mv) { + if (mv.length == 3) { + this.viewTrans[12] += mv[0]; + this.viewTrans[13] += mv[1]; + this.viewTrans[14] += mv[2]; + } else { + log.error("[translateViewMatrix] Wrong parameter size"); + } + } + + /** + * Change the rotation about the x axis. Only usable in 3D + * @param change The change in R+ (is divided with the window height) + */ + public void translateRotationX(double change) { + } + + /** + * Change the rotation about the y axis. Only usable in 3D + * @param change The change in R+ (is divided with the window height) + */ + public void translateRotationY(double change) { + } + + + /** + * Change the zoom factor of the camera take only R+ + * 1-oo is increase zoom and 0-1 decrease 1 keep the current zoom + * @param zoom the zoom factor change + */ + public abstract void zoom(double zoom); + + /** * The drawing function * @param gld The GLDrawable object */ public abstract void display(GLDrawable gld); + + /** + * Move the center left/right, up/down, forward/backward + * @param mv the move vector + */ + public abstract void translateCenter(double [] mv); } |