git-svn-id: svn://db.shs.com.ru/libs@54 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -70,7 +70,7 @@ MainWindow::MainWindow(QWidget * parent): QMainWindow(parent), Ui::MainWindow()
|
||||
GLTextureManager::addSearchPath("data");
|
||||
GLTextureManager::addSearchPath("data/images");
|
||||
GLTextureManager::addSearchPath("data/SU-33_maps");
|
||||
obj = loadFromDAEFile("data/room.dae");//new GLPrimitiveEllipsoid(EARTH_WL / 1E+6, EARTH_WL / 1E+6, EARTH_H / 1E+6, 500, 500);//GLPrimitiveCube();
|
||||
obj = loadFromDAEFile("data/shadows.dae");//new GLPrimitiveEllipsoid(EARTH_WL / 1E+6, EARTH_WL / 1E+6, EARTH_H / 1E+6, 500, 500);//GLPrimitiveCube();
|
||||
//obj->setScale(0.1);
|
||||
//obj->child("Plane001")->material().map_specularity.color_amount = 0.95;
|
||||
//obj = new GLPrimitiveEllipsoid(100, 100, 100, 100, 100);//GLPrimitiveCube();
|
||||
@@ -103,11 +103,11 @@ MainWindow::MainWindow(QWidget * parent): QMainWindow(parent), Ui::MainWindow()
|
||||
view->camera().flyToDistance(500);
|
||||
//view->camera().setMode(Camera::AimMatrix);
|
||||
Light * l = new Light(view->camera().pos());
|
||||
l->light_type = Light::Cone;
|
||||
/*l->light_type = Light::Cone;
|
||||
l->direction = QVector3D(1., 0.2, -0.2);
|
||||
l->angle_start = 0.;
|
||||
l->angle_end = 120.;
|
||||
l->intensity = 1.;
|
||||
l->angle_end = 120.;*/
|
||||
l->intensity = 0.5;
|
||||
//l->decay_linear = 0.2;
|
||||
l->setName("camera");
|
||||
view->addObject(l);
|
||||
@@ -225,6 +225,15 @@ void MainWindow::glInit() {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_pushButton_clicked() {
|
||||
//view->removeLight(view->lightsCount() - 1);
|
||||
//setWindowTitle(QString::number(view->lightsCount()));
|
||||
QVector3D wp = view->light(0)->worldPos();
|
||||
view->camera().setPos(wp);
|
||||
view->camera().setAim(wp + (view->light(0)->worldTransform() * QVector4D(view->light(0)->direction)).toVector3D()*100);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::loadFile(const QString & path) {
|
||||
prev_path = path;
|
||||
QCursor pcur = cursor();
|
||||
|
||||
Reference in New Issue
Block a user