Manual de Apoio 2010
Manual de Apoio 2010
Manual de Apoio 2010
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Reverter as ( possiveis ) transformacoes efectuadas// na matriz Colorgl. glMatrixMo<strong>de</strong> ( GL2 . GL_COLOR );gl. glLoadI<strong>de</strong>ntity ();// Voltar ao Mo<strong>de</strong>lViewgl. glMatrixMo<strong>de</strong> ( GL2 . GL_MODELVIEW );// Desactivar as alteracoesgl. glDisable ( GL2 . GL_CONVOLUTION_2D );gl. glDisable ( GL2 . GL_COLOR_TABLE );}@Overri<strong>de</strong>public void reshape ( GLAutoDrawable drawable , int x, int y, int width , int height ) {GL2 gl = drawable . getGL (). getGL2 ();gl. glViewport (0 , 0, width , height );gl. glMatrixMo<strong>de</strong> ( GL2 . GL_PROJECTION );gl. glLoadI<strong>de</strong>ntity ();glu . gluOrtho2D (0 , width , 0, height );}gl. glMatrixMo<strong>de</strong> ( GL2 . GL_MODELVIEW );gl. glLoadI<strong>de</strong>ntity ();}C.3 Pyramid.javapackage pt.ipb . esact .cg. examples ;import java . awt . Bor<strong>de</strong>rLayout ;import java . awt . Container ;import java .io. IOException ;import java .io. InputStream ;import java . nio . ByteBuffer ;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 . GlTools ;import pt.ipb . esact .cg.gl. tools . GlUtil ;import com . jogamp . opengl . util . FPSAnimator ;import com . jogamp . opengl . util . texture . spi . TGAImage ;@SuppressWarnings (" serial ")public class Pyramid extends JFrame implements GLEventListener {private GLU glu = new GLU ();private GLCanvas canvas ;FPSAnimator animator ;122