03.04.2013 Views

Uma Arquitetura de Suporte a Interações 3D ... - DCA - Unicamp

Uma Arquitetura de Suporte a Interações 3D ... - DCA - Unicamp

Uma Arquitetura de Suporte a Interações 3D ... - DCA - Unicamp

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

124 <strong>Arquitetura</strong> <strong>de</strong> interação<br />

}<br />

if( g_pROI[0][0] )<br />

printf( "Mo<strong>de</strong>lo selecionado!\n" );<br />

void Reshape( int iW, int iH ) {<br />

}<br />

glViewport( 0, 0, (GLsizei) iW, (GLsizei) iH );<br />

glMatrixMo<strong>de</strong>( GL_PROJECTION );<br />

glLoadI<strong>de</strong>ntity( );<br />

gluPerspective( 60.0, (GLfloat) iW/(GLfloat) iH, g_fNear, g_fFar );<br />

glMatrixMo<strong>de</strong>( GL_MODELVIEW );<br />

glLoadI<strong>de</strong>ntity( );<br />

gluLookAt( 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 );<br />

// Distância dos planos <strong>de</strong> recorte para a região <strong>de</strong> interesse<br />

g_pIntManager->SetZNear( g_fNear );<br />

g_pIntManager->SetZFar ( g_fFar );<br />

void Mouse( int iX, int iY ) {<br />

}<br />

// Região <strong>de</strong> interesse envolve apenas<br />

// o pixel apontado pelo cursor<br />

g_pIntManager->SetROI( iX, iY, iX+ROIW-1, iY+ROIH-1 );<br />

int main( int argc, char** argv ) {<br />

glutInit( &argc, argv );<br />

glutInitDisplayMo<strong>de</strong>( GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA );<br />

glutInitWindowSize( 600, 600 );<br />

glutInitWindowPosition( 0, 0 );<br />

glutCreateWindow( argv[0] );<br />

Init( );<br />

glutDisplayFunc( Display );<br />

glutIdleFunc( Display );<br />

glutReshapeFunc( Reshape );<br />

glutPassiveMotionFunc( Mouse );<br />

glutMainLoop( );

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

Saved successfully!

Ooh no, something went wrong!