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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.5 Procedimento <strong>de</strong> uso 123<br />

}<br />

};<br />

" // Funções <strong>de</strong> modificação dos atributos <strong>de</strong> Out vão aqui \n"<br />

" return Out; \n"<br />

"} \n"<br />

pMyObj->SetPixelDeform( szPSDeform );<br />

// Informa buffer <strong>de</strong> vértices e <strong>de</strong> índices<br />

float pVtPos[9] = { -2.0, -2.0, 0.0,<br />

int pIdx[3] = { 0, 1, 2 };<br />

2.0, -1.0, 0.0,<br />

0.0, 2.0, 0.0 };<br />

pMyObj->SetVertexBuffer( pVtPos, NULL, NULL, 3 );<br />

pMyObj->SetIn<strong>de</strong>xBuffer( pIdx, 1 );<br />

glEnable( GL_DEPTH_TEST );<br />

glClearColor( 0.0, 0.0, 0.0, 0.0 );<br />

// Aloca memória para a região <strong>de</strong> interesse<br />

g_pROI[0] = new float[ROIW*ROIH*4]; // 1 pixel com 1 atributo RGBA<br />

g_pIntManager->SetROI( 0, 0, ROIW-1, ROIH-1 );<br />

void Display( ) {<br />

glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );<br />

// Ren<strong>de</strong>riza mo<strong>de</strong>lo para visualização<br />

Ren<strong>de</strong>rCallBack( NULL, 0, NULL );<br />

// Executa o fluxo <strong>de</strong> processamento da arquitetura e<br />

// ren<strong>de</strong>riza o mo<strong>de</strong>lo nos buffers <strong>de</strong> visualização não visíveis<br />

g_pIntManager->Ren<strong>de</strong>r( );<br />

// Decodifica os atributos<br />

g_pIntManager->Deco<strong>de</strong>( g_pROI );<br />

glutSwapBuffers( );

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

Saved successfully!

Ooh no, something went wrong!