00001
00002
00003
00004 package org.dronus.gl;
00005
00006 import org.hfbk.vis.Prefs;
00007 import org.lwjgl.opengl.GL11;
00008 import org.lwjgl.util.glu.Sphere;
00014 public class GLSphereRenderer {
00015
00016 static int dl=0, detail;
00017
00018 public static void renderSphere(float r){
00019
00020 if (dl==0 || detail!=Prefs.current.detail){
00021 Sphere gls = new Sphere();
00022 gls.setTextureFlag(true);
00023 dl=GL11.glGenLists(1);
00024 GL11.glNewList(dl,GL11.GL_COMPILE);
00025 detail=Prefs.current.detail;
00026 gls.draw(1, (2<<detail)+1, (1<<detail)+1);
00027 GL11.glEndList();
00028 }
00029
00030 GL11.glPushMatrix();
00031 GL11.glScalef(r,r,r);
00032 GL11.glCallList(dl);
00033 GL11.glPopMatrix();
00034 }
00035 }