Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11754/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
Experimenting with drawing styles
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.109
retrieving revision 1.110
diff -C2 -d -r1.109 -r1.110
*** View.java 17 Jul 2006 14:14:56 -0000 1.109
--- View.java 17 Jul 2006 14:47:01 -0000 1.110
***************
*** 660,669 ****
protected void grid() {
double size = View.gridSize();
!
! Project.info("size = " + size);
!
!
! Project.info("adjusted size = " + size);
!
gl.glColor4fv(gridColor);
gl.glDisable(GL.GL_DEPTH_TEST);
--- 660,664 ----
protected void grid() {
double size = View.gridSize();
! gl.glLineWidth(0.5f);
gl.glColor4fv(gridColor);
gl.glDisable(GL.GL_DEPTH_TEST);
***************
*** 689,693 ****
protected void coords() {
double size = View.gridSize();
!
gl.glBegin(GL.GL_LINES);
gl.glDisable(GL.GL_DEPTH_TEST);
--- 684,688 ----
protected void coords() {
double size = View.gridSize();
! gl.glLineWidth(0.5f);
gl.glBegin(GL.GL_LINES);
gl.glDisable(GL.GL_DEPTH_TEST);
***************
*** 775,781 ****
//Draw constructors
! gl.glEnable(GL.GL_LIGHTING);
drawConstructors();
- gl.glDisable(GL.GL_LIGHTING);
{
--- 770,775 ----
//Draw constructors
!
drawConstructors();
{
***************
*** 1000,1024 ****
* Draw a point, line and cone
* @param from the initial vertex
! * @param dir the direction vector
* @param dist the distance from the cam
*/
! private void drawConstructorVector(Vertex from, Vertex dir, double dist) {
gl.glLineWidth(2);
double scale = 500 / height;
! dir.scale(scale * dist / 16);
! Vertex to = from.add(dir);
gl.glBegin(GL.GL_LINES);
gl.glVertex3d(from.getX(), from.getY(), from.getZ());
gl.glVertex3d(to.getX(), to.getY(), to.getZ());
gl.glEnd();
GLUquadric quad = glu.gluNewQuadric();
glu.gluQuadricNormals(quad, GLU.GLU_SMOOTH);
gl.glPushMatrix();
gl.glTranslated(to.getX(), to.getY(), to.getZ());
! gl.glRotated(Math.toDegrees(Geometry.degreesAboutZ(dir)), 0, 0, 1);
! gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(dir)), 0, 1, 0);
gl.glRotated(90, 0, 1, 0);
glu.gluCylinder(quad, (dist / 90) * scale, 0, (dist / 20) * scale, 10, 10);
! gl.glPopMatrix();
}
--- 994,1037 ----
* Draw a point, line and cone
* @param from the initial vertex
! * @param direction the direction vector
* @param dist the distance from the cam
*/
! private void drawConstructorVector(Vertex from, Vertex direction, double dist) {
gl.glLineWidth(2);
double scale = 500 / height;
! Vertex d = direction.copy();
! d.scale(scale * dist / 16);
! Vertex to = from.add(d);
gl.glBegin(GL.GL_LINES);
gl.glVertex3d(from.getX(), from.getY(), from.getZ());
gl.glVertex3d(to.getX(), to.getY(), to.getZ());
gl.glEnd();
+
+ gl.glEnable(GL.GL_LIGHTING);
GLUquadric quad = glu.gluNewQuadric();
glu.gluQuadricNormals(quad, GLU.GLU_SMOOTH);
gl.glPushMatrix();
gl.glTranslated(to.getX(), to.getY(), to.getZ());
! gl.glRotated(Math.toDegrees(Geometry.degreesAboutZ(d)), 0, 0, 1);
! gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(d)), 0, 1, 0);
gl.glRotated(90, 0, 1, 0);
glu.gluCylinder(quad, (dist / 90) * scale, 0, (dist / 20) * scale, 10, 10);
! gl.glPopMatrix();
! gl.glDisable(GL.GL_LIGHTING);
!
! {
! Vertex dir = direction.copy();
! dir.scale(View.gridSize() * 2);
! Vertex a = from.minus(dir);
! Vertex b = from.add(dir);
! gl.glLineWidth(0.5f);
! gl.glEnable(GL.GL_LINE_STIPPLE);
! gl.glBegin(GL.GL_LINE_STRIP);
! gl.glVertex3d(a.getX(), a.getY(), a.getZ());
! gl.glVertex3d(b.getX(), b.getY(), b.getZ());
! gl.glEnd();
! gl.glDisable(GL.GL_LINE_STIPPLE);
! }
!
}
|