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.

Desenhar o cubo ...glut . glutWireCube (10 f);Figura 3.5: RotationScalingFunção <strong>de</strong> Escala:GL. glScalef (float x, float y, float z)A função recebe como argumentos os factores <strong>de</strong> escala em cada um dos eixos x, y e z. O pseudo-códigoseguinte é ilustrado na Figura 3.6.GL2 gl = drawable . getGL (). getGL2 ();GLUT glut = new GLUT ();// Escalar x =2*x, y =1* x e z =2* zgl. glScalef (2f, 1f, 2f);// Desenhar o cubo ...glut . glutWireCube (10 f);Figura 3.6: Scale3.5.2 A Matriz I<strong>de</strong>ntida<strong>de</strong> (I<strong>de</strong>ntity Matrix)Ao tentar conseguir o resultado na Figura 3.7, po<strong>de</strong>mos ser tentados a escrever o código:GL2 gl = drawable . getGL (). getGL2 ();GLUT glut = new GLUT ();// Translate y =1019

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

Saved successfully!

Ooh no, something went wrong!