** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: graph3dview.cpp,v 1.7 2001/02/02 23:04:06 kevin Exp $
+** $Id: graph3dview.cpp,v 1.8 2001/02/03 18:38:42 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
if (nx == 0 || ny == 0 || ! v)
return;
- glRotatef( m_dXRotate, 1.0, 0.0, 0.0 );
- glRotatef( m_dZRotate, 0.0, 1.0, 0.0 );
- glRotatef( m_dYRotate, 0.0, 0.0, 1.0 );
- glTranslatef (-static_cast<double>(nx) / 2., 0, -static_cast<double>(ny) / 2.);
-
InitMaterials();
+ glRotatef( m_dXRotate, 1.0, 0.0, 0.0 );
+ glRotatef( m_dZRotate, 0.0, 1.0, 0.0 );
+ glRotatef( m_dYRotate, 0.0, 0.0, 1.0 );
+ glTranslatef (-static_cast<double>(nx) / 2., 0., -static_cast<double>(ny) / 2.);
+
+
if (m_bSmooth) {
glShadeModel (GL_SMOOTH);
} else {
if (! m_pCanvas->GetContext()) return;
#endif
+ m_pCanvas->SwapBuffers();
Draw();
std::ostringstream os;
os << "Xangle=" << m_dXRotate << ", Yangle=" << m_dYRotate << ", Zangle=" << m_dZRotate;
#if 1
static float ambient[] = {0.1, 0.1, 0.1, 1.0};
static float diffuse[] = {1.0, 1.0, 1.0, 1.0};
- static float position0[] = {0, 0, -nx/2, 0, 0.0};
- static float position1[] = {0, 0, nx/2, 0.0};
+ static float position0[] = {-nx/2, -ny/2, -ny/2, 0, 0.0};
+ static float position1[] = {-nx/2, -ny/2, ny/2, 0.0};
static float ambient1[] = {0.5, 0.5, 0.5, 1.0};
static float diffuse1[] = {1.0, 1.0, 1.0, 1.0};
// static float position0[] = {0.0, 0.0, 20.0, 0.0};
int maxDim = maxValue<int> (nx, ny);
glOrtho (-maxDim * 0.71, maxDim * 0.71, -maxDim * 0.71, maxDim * 0.71, maxDim * 0.71, -maxDim * 0.71);
+ GLfloat eyep[3], lookp[3], up[3];
+ eyep[0] = -nx/2; eyep[1] = 0; eyep[2] = -ny/2;
+ lookp[1] = 0; lookp[1] = 0, lookp[2] = 0;
+ up[0] = 0; up[1] = 1; up[2] = 0;
+ //gluLookAt (eyep[0], eyep[1], eyep[2], lookp[0], lookp[1], lookp[2], up[0], up[1], up[2]);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
Activate (false);
if (m_pCanvas) {
-// m_pCanvas->Show(false);
+ // m_pCanvas->Show(false);
m_pCanvas->setView(NULL);
m_pCanvas = NULL;
}
SetFrame(NULL);
if (deleteWindow) {
-// m_pFrame->Show(false);
+ // m_pFrame->Show(false);
delete m_pFrame;
m_pFrame = NULL;
-// if (GetDocument() && GetDocument()->getBadFileOpen())
-// ::wxYield(); // wxWindows bug workaround
+ // if (GetDocument() && GetDocument()->getBadFileOpen())
+ // ::wxYield(); // wxWindows bug workaround
}
return true;
void
Graph3dFileCanvas::OnEraseBackground(wxEraseEvent& event)
{
- // Do nothing: avoid flashing.
+ wxGLCanvas::OnEraseBackground(event); // Do nothing: avoid flashing.
}