13.07.2015 Views

Manual de Apoio 2010

Manual de Apoio 2010

Manual de Apoio 2010

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}glu . gluPerspective (100f, fAspect , .001f, volume * 5f);}C.9 BezierLighting.javapackagept.ipb . esact .cg. examples .c9;import java . awt . Bor<strong>de</strong>rLayout ;import java . awt . Container ;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. GLVectorList ;import pt.ipb . esact .cg.gl. tools . GlTools ;import com . jogamp . opengl . util . FPSAnimator ;@SuppressWarnings (" serial ")public class BezierLighting extends JFrame implements GLEventListener {private GLU glu = new GLU ();private GLCanvas canvas ;FPSAnimator animator ;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 [] = { .5f, .5f, .5f, 1.0 f };private GLVectorList ctrlPoints ;private GLVector lookAt = new GLVector (0f, .5f, 0f);private CGEngine e;public static void main ( String [] args ) {new BezierLighting ();}public BezierLighting () {super (" Mo<strong>de</strong>lo OpenGL ");setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );setSize (600 , 600);Container p = getContentPane ();Bor<strong>de</strong>rLayout l = new Bor<strong>de</strong>rLayout (5 , 5);p. setLayout (l);canvas = new GLCanvas ();p. add ( canvas , Bor<strong>de</strong>rLayout . CENTER );canvas . addGLEventListener ( this );144

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!