Manual de Apoio 2010
Manual de Apoio 2010
Manual de Apoio 2010
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Apêndice CCódigo FonteC.1 Example0.javapackage pt.ipb . esact .cg. examples ;import java . awt . Bor<strong>de</strong>rLayout ;import java . util . ArrayList ;import java . util . List ;import javax . media . opengl . GL2 ;import javax . media . opengl . GLAutoDrawable ;import javax . media . opengl . GLEventListener ;import javax . media . opengl . awt . GLCanvas ;import javax . media . opengl . glu . GLU ;import javax . swing . JFrame ;import pt.ipb . esact .cg.gl. CGEngine ;import pt.ipb . esact .cg.gl. GLVector ;import pt.ipb . esact .cg.gl. tools . GlUtil ;import com . jogamp . opengl . util . FPSAnimator ;import com . jogamp . opengl . util . gl2 . GLUT ;@SuppressWarnings (" serial ")public class Example0 extends JFrame implements GLEventListener {private GLU glu = new GLU ();private GLUT glut = new GLUT ();private GLCanvas canvas ;private GLVector fLightPos = new GLVector ( -100f, 100f, 50f, 1f);private float fNoLight [] = { 0.0f, 0.0f, 0.0f, 0.0 f };private float fLowLight [] = { 0.25f, 0.25f, 0.25f, 1.0 f };private float fBrightLight [] = { 1.0f, 1.0f, 1.0f, 1.0 f };private static final float FloorSize = 20f;private static final int NumSpheres = 30;private List < GLVector > spherePositions = new ArrayList < GLVector >();public static void main ( String [] args ) {new Example0 ();}116