13.07.2015 Views

Manual de Apoio 2010

Manual de Apoio 2010

Manual de Apoio 2010

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

import pt.ipb . esact .cg.gl. CGEngine ;import pt.ipb . esact .cg.gl. GLKeyboardAdapter ;import pt.ipb . esact .cg.gl. GLVector ;import pt.ipb . esact .cg.gl. tools . GlTools ;import com . jogamp . opengl . util . FPSAnimator ;import com . jogamp . opengl . util . gl2 . GLUT ;import com . jogamp . opengl . util . texture . spi . TGAImage ;@SuppressWarnings (" serial ")public class TexGen extends JFrame implements GLEventListener {private GLU glu = new GLU ();private GLUT glut = new GLUT ();private GLCanvas canvas ;FPSAnimator animator ;private float bgColor [] = { 0f, 0f, 0f, 0f };private GLVector location = new GLVector (0f, 0f, 5f);private GLVector lookAt = new GLVector (0f, 0f, 0f);private IntBuffer textures = IntBuffer . allocate (2);private CGEngine e;// I<strong>de</strong>ntificadores das Texturaspublic static final int Stripes = 0, Environment = 1;public static final int ObjectLinear = 0, EyeLinear = 1, SphereMap = 2;private int ren<strong>de</strong>rMo<strong>de</strong> = SphereMap ;private TGAImage environment ;public static void main ( String [] args ) {new TexGen ();}public TexGen () {super (" TexGen ");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 ();canvas . addGLEventListener ( this );p. add ( canvas , Bor<strong>de</strong>rLayout . CENTER );e = new CGEngine ( canvas , location );e. camera (). lookAt ( lookAt );setVisible ( true );canvas . requestFocus ();}animator = new FPSAnimator ( canvas , 25);animator . start ();127

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

Saved successfully!

Ooh no, something went wrong!