Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8461
Modified Files:
ViewXZ.java
Log Message:
The grid is can be seen in this view now, and selection works with gl
Index: ViewXZ.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewXZ.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ViewXZ.java 17 Aug 2005 08:57:52 -0000 1.3
--- ViewXZ.java 23 Aug 2005 11:59:25 -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,51 ****
gl = gld.getGL();
! GLU glu = gld.getGLU();
// Matrix mode have to be projection for perspecive
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
double size = this.size * getZoomFactor();
if (width <= height) {
--- 42,55 ----
gl = gld.getGL();
! glu = gld.getGLU();
! int[] viewport = new int[] {0, 0, (int)width, (int)height};
// Matrix mode have to be projection for perspecive
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) {
***************
*** 92,101 ****
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();
--- 96,105 ----
gl.glBegin(GL.GL_LINES);
for (int x = -(int)size; x <= (int)size; x++) {
! gl.glVertex3d((double) x, 80.0, -size);
! gl.glVertex3d((double) x, 80.0, size);
}
for (int z = -(int)size; z <= (int)size; z++) {
! gl.glVertex3d(-size, 80.0, (double) z);
! gl.glVertex3d(size, 80.0, (double) z);
}
gl.glEnd();
|