[vtkusers] Using OpenGL texture matrix in VTK?
이용석
vijon77 at hotmail.com
Wed Aug 28 01:48:26 EDT 2002
OpenGL offers the possibility to define a texture matrix,
which is defined as the identity matrix by default, the matrix being
applied to all textures coordinates before rendering occurs.
As far as I know, this operation is performed in hardware when a 3D
graphics card is available and supports OpenGL.
I would like to know whether I could make use of this feature with VTK.
Does anybody have a response to my question
(possible and why or not possible in VTK)? Thanks in advance for your
help.
One more question,
VTK can using OpenGL model?
I want know cording..ABOUT THAT.
I use vtk v.2.2 & visual c++ 6.0
Here is my cording.
void CFirstViewManager::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
HWND hwnd = GetSafeHwnd();
HDC hdc = ::GetDC(hwnd);
if (m_ren)
{
m_renWin->Render();
m_iren->Start();
SwapBuffers(hdc);
RECT rect;
::GetClientRect(hwnd,&rect);
ValidateRect(&rect);
GLfloat ambientLight[] = {0.4f, 0.4f, 0.4f, 1.0f };
GLfloat diffuseLight[] = {0.7f, 0.7f, 0.7f, 1.0f };
GLfloat specular[] = { 0.9f, 0.9f, 0.9f, 1.0f};
GLfloat lightPos[] = { -50.0f, 200.0f, 200.0f, 1.0f };
GLfloat specref[] = { 0.6f, 0.6f, 0.6f, 1.0f };
glEnable(GL_DEPTH_TEST); // Hidden surface
removal
glEnable(GL_CULL_FACE); // Do not
calculate inside of solid object
glFrontFace(GL_CCW);
// Enable lighting
glEnable(GL_LIGHTING);
// Setup light 0
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambientLight);
glLightfv(GL_LIGHT0,GL_AMBIENT,ambientLight);
glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuseLight);
glLightfv(GL_LIGHT0,GL_SPECULAR,specular);
// Position and turn on the light
glLightfv(GL_LIGHT0,GL_POSITION,lightPos);
glEnable(GL_LIGHT0);
// Enable color tracking
glEnable(GL_COLOR_MATERIAL);
// Set Material properties to follow glColor values
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
// All materials hereafter have full specular reflectivity
// with a moderate shine
glMaterialfv(GL_FRONT, GL_SPECULAR,specref);
glMateriali(GL_FRONT,GL_SHININESS,64);
// Black background
// glClearColor(0.0f, 0.0f, 0.0f, 1.0f );
// SwapBuffers(pDC->hDC);
DrawScene(); //**Draw Bolt, It made by Opengl.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020828/9d9437a3/attachment.htm>
More information about the vtkusers
mailing list