net.letskit.redbook.fourth
Class pointp

java.lang.Object
  extended by net.letskit.redbook.glskeleton
      extended by net.letskit.redbook.fourth.pointp
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener, javax.media.opengl.GLEventListener

public class pointp
extends glskeleton
implements javax.media.opengl.GLEventListener, java.awt.event.KeyListener

This program demonstrates point parameters and their effect on point primitives. 250 points are randomly generated within a 10 by 10 by 40 region, centered at the origin. In some modes (including the default), points that are closer to the viewer will appear larger. Pressing the 'l', 'q', and 'c' keys switch the point parameters attenuation mode to linear, quadratic, or constant, respectively. Pressing the 'f' and 'b' keys move the viewer forward and backwards. In either linear or quadratic attenuation mode, the distance from the viewer to the point will change the size of the point primitive. Pressing the '+' and '-' keys will change the current point size. In this program, the point size is bounded, so it will not get less than 2.0, nor greater than GL_POINT_SIZE_MAX.

Author:
Kiet Le (Java port)

Method Summary
 void display(javax.media.opengl.GLAutoDrawable drawable)
           
 void displayChanged(javax.media.opengl.GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
           
 void init(javax.media.opengl.GLAutoDrawable drawable)
           
 void keyPressed(java.awt.event.KeyEvent key)
           
 void keyReleased(java.awt.event.KeyEvent key)
           
 void keyTyped(java.awt.event.KeyEvent key)
           
static void main(java.lang.String[] args)
           
 void reshape(javax.media.opengl.GLAutoDrawable drawable, int x, int y, int w, int h)
           
 
Methods inherited from class net.letskit.redbook.glskeleton
animate, pause, refresh, runExit, setCanvas, setCanvas, setDefaultAnimator, setDefaultListeners
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)

init

public void init(javax.media.opengl.GLAutoDrawable drawable)
Specified by:
init in interface javax.media.opengl.GLEventListener

display

public void display(javax.media.opengl.GLAutoDrawable drawable)
Specified by:
display in interface javax.media.opengl.GLEventListener

reshape

public void reshape(javax.media.opengl.GLAutoDrawable drawable,
                    int x,
                    int y,
                    int w,
                    int h)
Specified by:
reshape in interface javax.media.opengl.GLEventListener

displayChanged

public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
                           boolean modeChanged,
                           boolean deviceChanged)
Specified by:
displayChanged in interface javax.media.opengl.GLEventListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent key)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent key)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent key)
Specified by:
keyReleased in interface java.awt.event.KeyListener