SpotView::SpotView(QWidget *parent) : QGLWidget(parent) , floor(new TriPlane(QPlane3D(QVector3D(0.0f, -1.0f, 0.0f), QVector3D(0.0f, 0.8f, 0.1f)), QVector3D(0.0f, 0.0f, 1.0f), QSizeF(10.0f, 10.0f), 1)) , timer(new QTimer(this)) , spin(0) { lp = new QGLLightParameters(this); lp->setAmbientColor(QColor(32, 64, 32)); lp->setDiffuseColor(QColor(196, 255, 196)); lp->setDirection(QVector3D(0.0f, -1.0f, -1.0f)); lights[0] = new Spotlight(QColor(255, 0, 0)); lights[0]->setArcIncr(QVector2D(TWO_PI/ 70.0f, TWO_PI / 140.f)); lights[1] = new Spotlight(QColor(0, 255, 0)); lights[1]->setArcIncr(QVector2D(TWO_PI / 120.0f, TWO_PI / 60.0f)); lights[2] = new Spotlight(QColor(0, 0, 255)); lights[2]->setArcIncr(QVector2D(TWO_PI / 50.0f, TWO_PI / 100.0f)); model = new QGLLightModel(this); model->setAmbientSceneColor(QColor(24, 24, 24)); //model->setViewerPosition(QGLLightModel::LocalViewer); }
cwGLGridPlane::cwGLGridPlane(QObject* parent) : cwGLObject(parent), Plane(QPlane3D(QVector3D(0.0, 0.0, -75.0), QVector3D(0.0, 0.0, 1.0))), Extent(3000.0), //3km in the negitive and positive direction from origin Program(NULL) { updateModelMatrix(); }