示例#1
0
文件: App.cpp 项目: luaman/g3d-cvs
void App::onInit() {
    showRenderingStats = false;
    window()->setCaption(filenameBaseExt(filename) + " - G3D Viewer");

    sky = Sky::fromFile(System::findDataFile("sky"));
    skyParameters = SkyParameters( G3D::toSeconds(10, 00, 00, AM) );
    lighting = Lighting::fromSky( sky, skyParameters, Color3::white() );
    lighting->ambientTop = Color3::white() * 0.3f;
    lighting->ambientBottom = Color3::white() * 0.1f;
	
    colorClear = Color3::white();
    //modelController = ThirdPersonManipulator::create();

    setViewer(filename);
}
示例#2
0
    void ModelContainerView::onInit() {
        // Called before the application loop beings.  Load data here and
        // not in the constructor so that common exceptions will be
        // automatically caught.
        iSky = Sky::fromFile("../../data/sky/");

        iSkyParameters = SkyParameters(G3D::toSeconds(11, 00, 00, AM));
        iLighting = Lighting::fromSky(iSky, iSkyParameters, Color3::white());

        // This simple demo has no shadowing, so make all lights unshadowed
        iLighting->lightArray.append(iLighting->shadowedLightArray);
        iLighting->shadowedLightArray.clear();

        // Example debug GUI:
        //debugPane->addCheckBox("Use explicit checking", &explicitCheck);
        debugWindow->setVisible(true);

        toneMap->setEnabled(false);
    }
示例#3
0
文件: main.cpp 项目: luaman/g3d-cvs
void App::onInit() {
    // Called before the application loop beings.  Load data here and
    // not in the constructor so that common exceptions will be
    // automatically caught.

    // Turn on the developer HUD
    debugWindow->setVisible(true);
    developerWindow->cameraControlWindow->setVisible(true);
    developerWindow->videoRecordDialog->setEnabled(true);
    showRenderingStats = true;

    sky = Sky::fromFile(System::findDataFile("sky"));

    skyParameters = SkyParameters(G3D::toSeconds(11, 00, 00, AM));
    lighting = Lighting::fromSky(sky, skyParameters, Color3::white());

    // This simple demo has no shadowing, so make all lights unshadowed
    lighting->lightArray.append(lighting->shadowedLightArray);
    lighting->shadowedLightArray.clear();

    /////////////////////////////////////////////////////////////
    // Example of how to add debugging controls
    debugPane->addButton("Exit", this, &App::endProgram);
    
    // More examples of debugging GUI controls:
    // debugPane->addCheckBox("Use explicit checking", &explicitCheck);
    // debugPane->addTextBox("Name", &myName);
    // debugPane->addNumberBox("height", &height, "m", GuiTheme::LINEAR_SLIDER, 1.0f, 2.5f);
    // button = debugPane->addButton("Run Simulator");

    // Start wherever the developer HUD last marked as "Home"
    defaultCamera.setCoordinateFrame(bookmark("Home"));

    
    //GuiTheme::makeThemeFromSourceFiles(pathConcat(dataDir, "skin"), "osx_white.png", "osx_black.png", "osx.txt", pathConcat(dataDir, "osx_new.gtm"));

    //GuiTheme::Ref theme = GuiTheme::fromFile("osx_new.gtm");
    

    //model = MD3Model::fromDirectory("C:\\dev\\data\\md3\\chaos-marine\\models\\players\\Chaos-Marine");
}