|
I have
<code> public class NetworkDrawer implements GLEventListener { GLU glu = new GLU(); public static ArrayList<Node> nodes = new ArrayList<Node>(); public static ArrayList<Arc> arcs = new ArrayList<Arc>(); </code>
At the top of my class, then i have my init method as:
<code> public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); glu.gluOrtho2D(-40.0,40.0,-40.0,40.0); } </code>
So all i want to do where is chage the clipping volume to -40 to 40 in both the x and y direction, as i have a set of 2d coordinated i want to play as points and that seemed the natural way.
My display method:
<code> public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glLoadIdentity(); gl.glColor3f(1F, 0F, 0F); gl.glVertex2d(0, 0); gl.glVertex2d(0.5, 0); //drawNodes(drawable); gl.glColor3f(1F, 1F, 0F); //drawArcs(drawable); } </code>
Im drawing two points to test my new co-ordinate system is in place, so they should be very close, but instead they are bing drawn with the default co-ordinate system -1 to 1 in both x and y, so one point in the middle, and the other half way between the middle and the right hand side of the window.
Any idea how i get my correct -40 to 40 system in place?
|