Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8531
Modified Files:
ViewYZ.java
Log Message:
The grid is can be seen in this view now, and selection works with gl
Index: ViewYZ.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewYZ.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ViewYZ.java 17 Aug 2005 08:57:52 -0000 1.3
--- ViewYZ.java 23 Aug 2005 11:59:42 -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) {
***************
*** 90,99 ****
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();
--- 94,103 ----
gl.glBegin(GL.GL_LINES);
for (int y = -(int)size; y <= size; y++) {
! gl.glVertex3d(80.0, (double)y, -size);
! gl.glVertex3d(80.0, (double)y, size);
}
for (int z = -(int)size; z <= size; z++) {
! gl.glVertex3d(80.0, -size, (double)z);
! gl.glVertex3d(80.0, size, (double)z);
}
gl.glEnd();
|