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.

GLVector location = new GLVector (5f, .5f, 5f);e = new CGEngine ( canvas , location );e. camera (). lookAt ( lookAt );setVisible ( true );canvas . requestFocus ();}animator = new FPSAnimator ( canvas , 25);animator . start ();@Overri<strong>de</strong>public void dispose ( GLAutoDrawable drawable ) {}@Overri<strong>de</strong>public void init ( GLAutoDrawable drawable ) {GL2 gl = drawable . getGL (). getGL2 ();}// Grayish backgroundgl. glClearColor (0f, 0f, 0f, 0f);// Cull backs of polygonsgl. glCullFace ( GL2 . GL_BACK );gl. glFrontFace ( GL2 . GL_CCW );gl. glEnable ( GL2 . GL_DEPTH_TEST );setupLight (gl );// Definir Pontos <strong>de</strong> ControloctrlPoints = new GLVectorList ();updateControlPoints ();// Activar a geracao automatica <strong>de</strong> normaisgl. glEnable ( GL2 . GL_AUTO_NORMAL );private float a0 = 0, a1 = GlTools . GL_PI / 4, a2 = GlTools . GL_PI / 2;private void updateControlPoints () {ctrlPoints . clear ();a0 += .1f;if(a0 >= GlTools . GL_PI )a0 = 0;a1 += .1f;if(a1 >= GlTools . GL_PI )a1 = 0;a2 += .1f;if(a2 >= GlTools . GL_PI )a2 = 0;// v0ctrlPoints . add ( -4f, 0f, 4f); // Start (u0)ctrlPoints . add ( -2f, ( float ) ( Math . sin (a0) * 8f - 4f), 4f); // Control (u0)ctrlPoints . add (4f, 0f, 4f); // End (u0)// v1ctrlPoints . add ( -4f, 0f, 0f); // Start (u1)ctrlPoints . add ( -2f, ( float ) ( Math . sin (a1) * 8f - 4f), 0f); // Control (u1)145

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

Saved successfully!

Ooh no, something went wrong!