[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view ViewXY.java,1.2,1.3 ViewXZ.java,1.2,1.
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2005-08-17 08:58:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28192 Modified Files: ViewXY.java ViewXZ.java ViewYZ.java View3D.java Log Message: Moved the grid a little to obtain a better depth feeling Index: View3D.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View3D.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** View3D.java 16 Aug 2005 12:03:26 -0000 1.4 --- View3D.java 17 Aug 2005 08:57:52 -0000 1.5 *************** *** 37,44 **** /** The rotaion about the X axis */ ! private static double rotationX = 0; /** The rotation about the Y axis */ ! private static double rotationY = -30; /** The picking state */ --- 37,44 ---- /** The rotaion about the X axis */ ! private static double rotationX = -30; /** The rotation about the Y axis */ ! private static double rotationY = 130; /** The picking state */ *************** *** 83,99 **** if (aspect < 1.0) { // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(aspect * 60.0, 1.0, 0.0, 50.0); } else { ! glu.gluPerspective(60.0, aspect, 0.0, 50.0); } gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); ! glu.gluLookAt(0.0, 15.0 * getZoomFactor(), 20.0 * getZoomFactor(), ! center[0], center[1], center[2], ! 0.0, 1.0, 0.0); gl.glMultMatrixd(viewTrans); gl.glRotated(rotationX, 1.0, 0.0, 0.0); ! gl.glRotated(rotationY, 0.0, 1.0, 0.0); } --- 83,101 ---- if (aspect < 1.0) { // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(aspect * 60.0, 1.0, 0.5, 50.0 * getZoomFactor()); } else { ! glu.gluPerspective(60.0, aspect, 0.5, 50.0 * getZoomFactor()); } gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); ! glu.gluLookAt(0.0 + center[0], ! 25.0 * getZoomFactor() + center[1], ! 0.0 + center[2], ! center[0], center[1], center[2], ! 0.0, 0.0, 1.0); gl.glMultMatrixd(viewTrans); gl.glRotated(rotationX, 1.0, 0.0, 0.0); ! gl.glRotated(rotationY, 0.0, 0.0, 1.0); } *************** *** 104,110 **** public void translateCenter(double [] mv) { if (mv.length == 3) { ! this.viewTrans[12] -= mv[0]; ! this.viewTrans[13] += mv[2]; ! this.viewTrans[14] += mv[1]; } else { log.error("[translateViewMatrix] Wrong parameter size"); --- 106,112 ---- public void translateCenter(double [] mv) { if (mv.length == 3) { ! this.center[0] -= mv[0]; ! this.center[1] += mv[2]; ! this.center[2] += mv[1]; } else { log.error("[translateViewMatrix] Wrong parameter size"); *************** *** 117,121 **** */ public void translateRotationX(double change) { ! rotationX -= change / height; } --- 119,123 ---- */ public void translateRotationX(double change) { ! rotationX += change / height; } *************** *** 132,138 **** */ protected void grid() { - gl.glLineWidth(1.0f); - gl.glColor3dv(GRID_COLOR); - gl.glBegin(GL.GL_LINES); double size = this.size; if (aspect > 1) { --- 134,137 ---- *************** *** 141,151 **** size /= aspect; } for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, 0.0, -size); ! gl.glVertex3d((double) x, 0.0, size); } ! for (int z = -(int)size; z <= (int)size; z++) { ! gl.glVertex3d(-size, 0.0, (double) z); ! gl.glVertex3d(size, 0.0, (double) z); } gl.glEnd(); --- 140,152 ---- size /= aspect; } + gl.glColor4dv(GRID_COLOR); + gl.glBegin(GL.GL_LINES); for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, -size, -0.001); ! gl.glVertex3d((double) x, size, -0.001); } ! for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size, (double) y, -0.001); ! gl.glVertex3d(size, (double) y, -0.001); } gl.glEnd(); *************** *** 156,160 **** */ protected void coords() { - gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINES); gl.glColor3dv(X_AXIS_COLOR); --- 157,160 ---- Index: ViewXY.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewXY.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ViewXY.java 5 Aug 2005 11:02:31 -0000 1.2 --- ViewXY.java 17 Aug 2005 08:57:52 -0000 1.3 *************** *** 80,86 **** */ protected void grid() { - gl.glLineWidth(1.0f); - gl.glColor3dv(GRID_COLOR); - gl.glBegin(GL.GL_LINES); double size; if (aspect > 1) { --- 80,83 ---- *************** *** 89,99 **** size = this.size * getZoomFactor() / aspect; } for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, -size, 0.0); ! gl.glVertex3d((double) x, size, 0.0); } for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size, (double) y, 0.0); ! gl.glVertex3d(size, (double) y, 0.0); } gl.glEnd(); --- 86,98 ---- size = this.size * getZoomFactor() / aspect; } + gl.glColor4dv(GRID_COLOR); + gl.glBegin(GL.GL_LINES); for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, -size, -90.0); ! gl.glVertex3d((double) x, size, -90.0); } for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size, (double) y, -90.0); ! gl.glVertex3d(size, (double) y, -90.0); } gl.glEnd(); *************** *** 104,108 **** */ protected void coords() { - gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINES); gl.glColor3dv(X_AXIS_COLOR); --- 103,106 ---- Index: ViewXZ.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewXZ.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ViewXZ.java 5 Aug 2005 11:02:31 -0000 1.2 --- ViewXZ.java 17 Aug 2005 08:57:52 -0000 1.3 *************** *** 83,89 **** */ protected void grid() { - gl.glLineWidth(1.0f); - gl.glColor3dv(GRID_COLOR); - gl.glBegin(GL.GL_LINES); double size; if (aspect > 1) { --- 83,86 ---- *************** *** 92,102 **** size = this.size * getZoomFactor() / aspect; } for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, 0.0, -size); ! gl.glVertex3d((double) x, 0.0, size); } for (int z = -(int)size; z <= (int)size; z++) { ! gl.glVertex3d(-size, 0.0, (double) z); ! gl.glVertex3d(size, 0.0, (double) z); } gl.glEnd(); --- 89,101 ---- size = this.size * getZoomFactor() / aspect; } + gl.glColor4dv(GRID_COLOR); + gl.glBegin(GL.GL_LINES); for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, 90.0, -size); ! gl.glVertex3d((double) x, 90.0, size); } for (int z = -(int)size; z <= (int)size; z++) { ! gl.glVertex3d(-size, 90.0, (double) z); ! gl.glVertex3d(size, 90.0, (double) z); } gl.glEnd(); *************** *** 107,111 **** */ protected void coords() { - gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINES); gl.glColor3dv(X_AXIS_COLOR); --- 106,109 ---- Index: ViewYZ.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewYZ.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ViewYZ.java 5 Aug 2005 11:02:31 -0000 1.2 --- ViewYZ.java 17 Aug 2005 08:57:52 -0000 1.3 *************** *** 87,100 **** size = this.size * getZoomFactor() / aspect; } ! gl.glLineWidth(1.0f); ! gl.glColor3dv(GRID_COLOR); gl.glBegin(GL.GL_LINES); for (int y = -(int)size; y <= size; y++) { ! gl.glVertex3d(0.0, (double)y, -size); ! gl.glVertex3d(0.0, (double)y, size); } for (int z = -(int)size; z <= size; z++) { ! gl.glVertex3d(0.0, -size, (double)z); ! gl.glVertex3d(0.0, size, (double)z); } gl.glEnd(); --- 87,99 ---- size = this.size * getZoomFactor() / aspect; } ! gl.glColor4dv(GRID_COLOR); gl.glBegin(GL.GL_LINES); for (int y = -(int)size; y <= size; y++) { ! gl.glVertex3d(90.0, (double)y, -size); ! gl.glVertex3d(90.0, (double)y, size); } for (int z = -(int)size; z <= size; z++) { ! gl.glVertex3d(90.0, -size, (double)z); ! gl.glVertex3d(90.0, size, (double)z); } gl.glEnd(); *************** *** 105,109 **** */ protected void coords() { - gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINES); gl.glColor3dv(Y_AXIS_COLOR); --- 104,107 ---- |