Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8392
Modified Files:
ViewXY.java
Log Message:
The grid is can be seen in this view now, and selection works with gl
Index: ViewXY.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewXY.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ViewXY.java 17 Aug 2005 08:57:52 -0000 1.3
--- ViewXY.java 23 Aug 2005 11:59:07 -0000 1.4
***************
*** 11,15 ****
import net.java.games.jogl.GL;
import net.java.games.jogl.GLDrawable;
- import net.java.games.jogl.GLU;
import org.apache.log4j.Logger;
--- 11,14 ----
***************
*** 43,50 ****
gl = gld.getGL();
! GLU glu = gld.getGLU();
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
double size = this.size * getZoomFactor();
if (width <= height) {
--- 42,54 ----
gl = gld.getGL();
! glu = gld.getGLU();
! int[] viewport = new int[] {0, 0, (int)width, (int)height};
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
+ //Set the PickMatrix if we are trying to pick something
+ if (picking > 0) {
+ glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport);
+ }
double size = this.size * getZoomFactor();
if (width <= height) {
***************
*** 89,98 ****
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();
--- 93,102 ----
gl.glBegin(GL.GL_LINES);
for (int x = -(int)size; x <= (int)size; x++) {
! gl.glVertex3d((double) x, -size, -80.0);
! gl.glVertex3d((double) x, size, -80.0);
}
for (int y = -(int)size; y <= (int)size; y++) {
! gl.glVertex3d(-size, (double) y, -80.0);
! gl.glVertex3d(size, (double) y, -80.0);
}
gl.glEnd();
|