   Light flickers when moved
  I'm trying to create a very simple scene where a light rotates around a teapot.  I have no issues when the light is stationary, but changing its position causes the teapot to flicker black.  In my search for a solution I came across the suggestion (to another individual's related problem) that the light is sharing the surface with the polygon; this isn't the case for me.Note that I'm using JOGL and this is part of an applet.Here is the init code:<code>public void init(GLAutoDrawable drawable) {GL gl = drawable.getGL();gl.glMatrixMode(GL.GL_PROJECTION);gl.glLoadIdentity();glu.gluPerspective(30.0, getSize().getWidth()/getSize().getHeight(), 0.5, 50.0);gl.glEnable(GL.GL_DEPTH_TEST);gl.glClearColor(1.0f, 1.0f, 1.0f, 0.5f);gl.glClearDepth(1.0f);gl.glDepthFunc(GL.GL_LEQUAL);gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, new float[]{1,1,0},0);gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, new float[]{1,1,1},0);gl.glMaterialfv(GL.GL_FRONT, GL.GL_SHININESS, new float[]{50},0);gl.glMaterialfv(GL.GL_FRONT, GL.GL_SPECULAR, new float[]{1,1,1},0);gl.glEnable(GL.GL_LIGHTING);gl.glEnable(GL.GL_LIGHT0);}</code>Here is the display code:<code>float f =0;public void display(GLAutoDrawable drawable) {GL gl = drawable.getGL();gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);setCameraView(gl);f++;float[] lpos = new float[]{(float)Math.sin(f/200)*2,1,(float)Math.cos(f/200)*2};gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lpos, 0);gl.glPushMatrix();glut.glutSolidTeapot(1);gl.glPopMatrix();}</code>Here is the setCameraView method:<code>private void setCameraView(GL gl) {gl.glMatrixMode(GL.GL_MODELVIEW);gl.glLoadIdentity();glu.gluLookAt(0,10,0, 0, 0, 0, 1, 0, 0);}</code>Thanks if anyone can help on this matter!   
  It's a directional light but it looks like your looking for a point light which then you have to make your light position array like this:float[] lpos = new float[]{(float)Math.sin(f/200)*2,1,(float)Math.cos(f/200)*2, 1};gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lpos);//or if I keep your orginalfloat[] lpos = new float[]{(float)Math.sin(f/200)*2,1,(float)Math.cos(f/200)*2};gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lpos, 1);The 1 indicates that it is a point light or spot light. if that remains 0 then position doesn't matter to it as then it's a directional light.   ;Quote:Original post by AsemIt's a directional light but it looks like your looking for a point light which then you have to make your light position array like this:*** Source Snippet Removed ***The 1 indicates that it is a point light or spot light. if that remains 0 then position doesn't matter to it as then it's a directional light.Ah, what a simple mistake - thank you so much!