add xyz axes

This commit is contained in:
Quentin Legot 2021-02-16 18:04:55 +01:00
parent b544c486af
commit 61e26dc007
2 changed files with 15 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Scanner; import java.util.Scanner;
import lsystem.screen.MainFrame; import lsystem.screen.MainFrame;
import lsystem.screen.SwingGLCanvas;
public class Main { public class Main {
@ -16,6 +17,7 @@ public class Main {
frame.pack(); frame.pack();
frame.setVisible(true); frame.setVisible(true);
SwingGLCanvas canvas = new SwingGLCanvas();
final Scanner scanner = new Scanner(System.in); final Scanner scanner = new Scanner(System.in);
String axiom = null; String axiom = null;

View File

@ -66,11 +66,21 @@ public class JoglEventListener implements GLEventListener {
0.0f, 1.0f, 0.0f 0.0f, 1.0f, 0.0f
); );
gl.glRotatef(angle, 0f, 1f, 0f); /* gl.glRotatef(angle, 0f, 1f, 0f);
gl.glColor3f(1.0f, 0.0f, 0.0f); gl.glColor3f(1.0f, 0.0f, 0.0f);
glut.glutSolidSphere(1.0f, 20, 20); glut.glutSolidSphere(1.0f, 20, 20); */
gl.glColor3f(1f, 1f, 1f);
gl.glBegin(GL2.GL_LINES);
gl.glVertex3f(0f, 0f, 0f);
gl.glVertex3f(1f, 0f, 0f);
gl.glVertex3f(0f, 0f, 0f);
gl.glVertex3f(0f, 1f, 0f);
gl.glVertex3f(0f, 0f, 0f);
gl.glVertex3f(0f, 0f, 1f);
gl.glEnd();
gl.glRasterPos3f(1.1f, 0.0f, 0.0f);
glut.glutBitmapCharacter(GLUT.BITMAP_HELVETICA_18, 'X');
angle += 0.1f; angle += 0.1f;
angle %= 360f; angle %= 360f;
} }