当前位置: 首页>>代码示例>>C++>>正文


C++ Exporter::startRender方法代码示例

本文整理汇总了C++中Exporter::startRender方法的典型用法代码示例。如果您正苦于以下问题:C++ Exporter::startRender方法的具体用法?C++ Exporter::startRender怎么用?C++ Exporter::startRender使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exporter的用法示例。


在下文中一共展示了Exporter::startRender方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: keyDown

void cApp::keyDown( KeyEvent event ){
    switch( event.getChar() ){
        case 'S': mExp.startRender(); break;
        case 's': mExp.snapShot(); break;
        case ' ': bStart = !bStart; break;
    }
}
开发者ID:stdmtb,项目名称:uf_0.9.0,代码行数:7,代码来源:cApp.cpp

示例2: setup

void cApp::setup(){
    
    int w = win_w*master_scale;
    int h = win_h*master_scale;
    
    setFrameRate( fps );
    setWindowSize( w*0.5, h*0.5 );
    setWindowPos( 0, 0 );
    mExp.setup( w, h, 0, 3000, GL_RGB, mt::getRenderPath(), 0);
    
    CameraPersp cam( w, h, 54.4f, 1, 10000 );
    cam.lookAt( Vec3f(0,0, 1300), Vec3f(0,0,0) );
    cam.setCenterOfInterestPoint( Vec3f(0,0,0) );
    camUi.setCurrentCam( cam );

    assetDir = mt::getAssetPath();
    simDir.push_back( assetDir/"sim"/"red_particle3"/"rpc2");
    
    int nSim = simDir.size();
    vbo.assign( nSim, VboSet() );
    
#ifdef RENDER
    mExp.startRender();
#endif
}
开发者ID:stdmtb,项目名称:n9,代码行数:25,代码来源:cApp.cpp

示例3: keyDown

void cApp::keyDown( KeyEvent event ){
    switch (event.getChar()) {
        case '1': camUi.setCurrentCam(cams[0]);     break;
        case '2': camUi.setCurrentCam(cams[1]);     break;
        case '3': camUi.setCurrentCam(cams[2]);     break;
        case '4': camUi.setCurrentCam(cams[3]);     break;
        case '5': camUi.setCurrentCam(cams[4]);     break;
        case 'R': mExp.startRender();               break;
        case 'T': mExp.stopRender();                break;
        case 'f': frame+=100;                       break;
        case '0': frame=0; simDirNum++;             break;
    }
}
开发者ID:stdmtb,项目名称:n9,代码行数:13,代码来源:cApp.cpp

示例4: setup

void cApp::setup(){
    setWindowPos( 0, 0 );
    setWindowSize( mW*mScale, mH*mScale );
    setFrameRate(25);
    assetDir = mt::getAssetPath();
    
    mExp.setup( mW, mH, 0, 2999, GL_RGB, mt::getRenderPath(), 0 );
    
    setupFromBlender();
    
#ifdef RENDER
    mExp.startRender();
#endif

}
开发者ID:stdmtb,项目名称:n9,代码行数:15,代码来源:cApp.cpp

示例5: setup

void cApp::setup(){
    
    setWindowPos( 0, 0 );
    setWindowSize( mW*0.5, mH*0.5 );
    mExp.setup( mW*mScale, mH*mScale,0, 2999, GL_RGB, mt::getRenderPath() );
    
    mPln.setOctaves(4);
    mPln.setSeed(1332);

    randSeed( mt::getSeed() );
    
    int count = 0;
    for( int i=0; i<100; i++){
        StrangeAgent sa;
        sa.setRandom();
        mSAs.push_back( sa );

        for(int j=0; j<sa.points.size(); j++){
            mPlnPts.push_back( Vec3f(count*scale,0,0) );
            count++;
        }
    }
    
    total = count;
    
    if( 1 ){
        CameraPersp cam;
        cam.setNearClip(0.1);
        cam.setFarClip(1000000);
        cam.setFov(60);
        cam.setEyePoint( Vec3f(0,0,-30 ) );
        cam.setCenterOfInterestPoint( Vec3f(0,0,0) );
        cam.setAspectRatio( (float)mW/mH );
        mCamUi.setCurrentCam(cam);
    }else{
        ortho.setNearClip(0.1);
        ortho.setFarClip(1000000);
        ortho.setEyePoint( Vec3f(0,0,-7 ) );
        ortho.setCenterOfInterestPoint( Vec3f(0,0,0) );
        ortho.setAspectRatio( (float)mW/mH );
    }
    
#ifdef RENDER
    mExp.startRender();
#endif
}
开发者ID:stdmtb,项目名称:n9,代码行数:46,代码来源:cApp.cpp

示例6: setup

void cApp::setup(){
    
    setFrameRate( 25 );
    setWindowSize( win_w*0.5, win_h*0.5 );
    setWindowPos( 0, 0 );
    mExp.setup( win_w, win_h, 0, 3000, GL_RGB, mt::getRenderPath(), 0);
    
    assetDir = mt::getAssetPath();
    mt::loadColorSample("img/colorSample/n5pickCol_2.png", mColorSample1 );
    mt::loadColorSample("img/colorSample/n5pickCol_3.png", mColorSample2 );
    
    guide.load( assetDir/"svg"/"n5_guide.svg" );
    
#ifdef RENDER
    mExp.startRender();
#endif
}
开发者ID:stdmtb,项目名称:n9,代码行数:17,代码来源:cApp.cpp

示例7: setup

void cApp::setup(){
    setWindowPos( 0, 0 );
    
    float w = 1920;
    float h = 1080*3;
    
    setWindowSize( w*0.2, h*0.2 );
    mExp.setup( w, h, 0, 550-1, GL_RGB, mt::getRenderPath(), 0);
    
    cam = CameraPersp(w, h, 55.0f, 0.1, 1000000 );
    
    if(0){
        cam.lookAt( vec3(0,0,800), vec3(0,0,0) );
        cam.setLensShift( 0,0 );
    }else{
        cam.setNearClip(0.100000);
        cam.setFarClip(1000000.000000);
        cam.setAspectRatio(0.592593);
        cam.setFov(55.000000);
        cam.setEyePoint(vec3(326.924622,-381.081604,259.431519));
        cam.setWorldUp(vec3(0.000000,1.000000,0.000000));
        cam.setLensShift(vec2(0.000000,0.000000));
        cam.setViewDirection(vec3(-0.578462,0.674288,-0.459040));
        cam.lookAt(vec3(326.924622,-381.081604,259.431519)+vec3(-0.578462,0.674288,-0.459040));
    }
    
    camUi.setCamera( &cam );
    
    mPln.setSeed(123);
    mPln.setOctaves(4);
    
    for( int i=0; i<6; i++){
        Ramses r(eSimType,i);
        rms.push_back( r );
    }

    makeGui();
    
#ifdef RENDER
    mExp.startRender();
#endif
    
}
开发者ID:stdmtb,项目名称:uf_0.9.0,代码行数:43,代码来源:cApp.cpp

示例8: setup

void cApp::setup(){
    setFrameRate( 25 );
    setWindowPos( 0, 0 );
    setWindowSize( mW*mScale, mH*mScale );
    mExp.setup( mW*mScale, mH*mScale, 0, 2999, GL_RGB, mt::getRenderPath() );
    
    mPln.setOctaves( 3 );
    mPln.setSeed( 551 );
    
    mt::loadColorSample("img/Mx80_2_org_B.jpg", mColorSample1 );
    mt::loadColorSample("img/Mx80_2_org_B.jpg", mColorSample2 );

    
    {
        // Audio Setup
        auto ctx = audio::Context::master();
        audio::DeviceRef device = audio::Device::getDefaultOutput();
        audio::Device::Format format;
        format.sampleRate( 192000 );
        format.framesPerBlock( mFpb );
        device->updateFormat( format );
        
        cout << "--- Audio Setting --- " << endl;
        cout << "device name      : " << device->getName() << endl;
        cout << "Sample Rate      : " << ctx->getSampleRate() << endl;
        cout << "frames per Block : " << ctx->getFramesPerBlock() << endl;

        mWaves.assign( 7, Wave() );
        
        for( int i=0; i<mWaves.size(); i++ ){
            mWaves[i].create( "snd/test/3s1e_192k_" + toString(i+1)+ ".wav" );
        }

        ctx->enable();
    }
    
    
#ifdef RENDER
    mExp.startRender();
#endif

}
开发者ID:stdmtb,项目名称:n9,代码行数:42,代码来源:cApp.cpp

示例9: keyDown

void cApp::keyDown( KeyEvent event ){

    switch (event.getChar()) {
        
        case 'R':
            mExp.startRender();
            break;

        case 'T':
            mExp.stopRender();
            break;

        case 'f':
            frame+=100;
            break;
            
        default:
            break;
    }
}
开发者ID:stdmtb,项目名称:n9,代码行数:20,代码来源:cApp.cpp

示例10: keyDown

void cApp::keyDown( KeyEvent event ) {
    char key = event.getChar();
    switch (key) {
        case 'S':
            mExp.snapShot();
            break;
        
        case 'R':
            mExp.startRender();
            break;

         case 'T':
            mExp.stopRender();
            break;
            
        case ' ':
            bStart = !bStart;
            break;
    }
}
开发者ID:stdmtb,项目名称:uf_0.8.6,代码行数:20,代码来源:cApp.cpp

示例11: makeGui

void cApp::makeGui(){
    gui = params::InterfaceGl::create( getWindow(), "Ramses", vec2(300, getWindowHeight()) );
    gui->setOptions( "", "position=`0 0` valueswidth=100" );
    
    function<void(void)> update = [&](){
        for( int i=0; i<rms.size(); i++){
            rms[i].updateVbo(eye);
        }
    };
    
    
    function<void(void)> sx = [this](){
        saveXml();
    };
    
    function<void(void)> ld = [this](){
        loadXml();
        for( int i=0; i<rms.size(); i++){
            rms[i].eSimType = simType;
            rms[i].loadSimData(frame);
            rms[i].updateVbo(eye);
        }
    };

    function<void(void)> ren = [this](){
        bStart = true;
        mExp.startRender();
    };
    
    gui->addText( "main" );
    gui->addParam("start", &bStart );
    gui->addParam("frame", &frame ).updateFn(update);
    gui->addParam("ortho", &bOrtho );
    gui->addParam("xyz global scale", &Ramses::globalScale ).step(0.01).updateFn(update);
    //gui->addParam("r(x) resolution", &Ramses::boxelx, true );
    //gui->addParam("theta(y) resolution", &Ramses::boxely, true );
    gui->addButton("save XML", sx );
    gui->addButton("load XML", ld );
    gui->addButton("start Render", ren );

    gui->addSeparator();
    
    for( int i=0; i<6; i++){
        string p = to_string(simType) + "_"+  Ramses::prm[i];
        
        function<void(void)> up = [i, this](){
            rms[i].updateVbo(eye);
        };
        
        function<void(void)> up2 = [i, this](){
            rms[i].loadSimData(this->frame);
            rms[i].updateVbo(eye);
        };
        
        gui->addParam(p+" show", &rms[i].bShow ).group(p).updateFn(up2);
        //gui->addParam(p+" polar coordinate", &rms[i].bPolar ).group(p).updateFn(up2);
        
        gui->addParam(p+" Auto Min Max", &rms[i].bAutoMinMax ).group(p).updateFn(up);
        gui->addParam(p+" in min", &rms[i].in_min).step(0.05f).group(p).updateFn(up);
        gui->addParam(p+" in max", &rms[i].in_max).step(0.05f).group(p).updateFn(up);
        
        gui->addParam(p+" z extrude", &rms[i].extrude).step(1.0f).group(p).updateFn(up);
        //gui->addParam(p+" x offset", &rms[i].xoffset).step(1.0f).group(p).updateFn(up);
        //gui->addParam(p+" y offset", &rms[i].yoffset).step(1.0f).group(p).updateFn(up);
        //gui->addParam(p+" z offset", &rms[i].zoffset).step(1.0f).group(p).updateFn(up);
        
        gui->addParam(p+" xy scale", &rms[i].scale).step(1.0f).group(p).updateFn(up);
        //gui->addParam(p+" visible thresh", &rms[i].visible_thresh).step(0.005f).min(0.0f).max(1.0f).group(p).updateFn(up);
        gui->addParam(p+" log", &rms[i].eStretch).step(1).min(0).max(1).group(p).updateFn(up2);
        
        // read only
        //gui->addParam(p+" r(x) resolution", &rms[eSimType][i].boxelx, true );
        //gui->addParam(p+" theta(y) resolution", &rms[eSimType][i].boxely, true );
        
        //gui->addParam(p+" visible rate(%)", &rms[i].visible_rate, true ).group(p);
        //gui->addParam(p+" num particle", &rms[i].nParticle, true).group(p);
        
        gui->addSeparator();
        
    }
}
开发者ID:stdmtb,项目名称:uf_0.9.0,代码行数:81,代码来源:cApp.cpp

示例12: setup

void cApp::setup(){
    
    setWindowPos( 0, 0 );
    setWindowSize( 1080*3*0.5, 1920*0.5 );
    mExp.setup( 1080*3, 1920, 3000, GL_RGB, mt::getRenderPath(), 0);
    
    CameraPersp cam(1080*3, 1920, 54.4f, 0.1, 10000 );
    cam.lookAt( Vec3f(0,0, 1600), Vec3f(0,0,0) );
    cam.setCenterOfInterestPoint( Vec3f(0,0,0) );
    camUi.setCurrentCam( cam );
    
    mPln.setSeed(123);
    mPln.setOctaves(4);
    
    fs::path assetPath = mt::getAssetPath();
    
    {
        // make VectorMap
        Surface32f sAspect( loadImage(assetPath/("img/00/halpha3000_aspect_32bit.tif")) );
        Surface32f sSlope( loadImage(assetPath/("img/00/halpha3000_slope1.tif")) );

        int w = sAspect.getWidth();
        int h = sAspect.getHeight();
        
        mVecMap.assign(w, vector<Vec2f>(h) );

        for( int i=0; i<sAspect.getWidth(); i++) {
            for( int j=0; j<sAspect.getHeight(); j++ ) {
                
                Vec2i pos(i, j);
                float aspect = *sAspect.getDataRed( pos );
                float slope = *sSlope.getDataRed( pos );
                if( slope!=0 && aspect!=-9999 ){

                    Vec2f vel( 0, slope*10.0 );
                    vel.rotate( toRadians(aspect) );
                    mVecMap[i][j] = vel;
                }else{
                    mVecMap[i][j] = Vec2f::zero();
                }
                
                mVelocity.push_back( Vec3f(mVecMap[i][j].x, mVecMap[i][j].y, 0) );
            }
        }
    }
    
    {
        // make point from intensity
        Surface32f sIntensity( loadImage(assetPath/("img/00/halpha3000-skv3264879915580.tiff")) );
        intensityW = sIntensity.getWidth();
        intensityH = sIntensity.getHeight();
        
        Surface32f::Iter itr = sIntensity.getIter();
        float threashold = 0.15;
        float extrusion = 300;
        while ( itr.line() ) {
            while( itr.pixel() ){
                float gray = itr.r();
                if( threashold < gray ){
                    Vec2i pos = itr.getPos();
                    Vec3f v(pos.x, pos.y, gray*extrusion );
                    Vec3f noise = mPln.dfBm( Vec3f(pos.x, pos.y, gray) ) * 2.0;
                    ps.push_back( v + noise );
                    float c = gray + 0.2f;
                    float a = lmap(c, 0.0f, 1.0f, 0.3f, 0.7f);
                    cs.push_back( ColorAf(c, c, c, a) );
                }
            }
        }
        
        
        mPoints = gl::VboMesh( ps.size(), 0, mt::getVboLayout(), GL_POINTS );
        gl::VboMesh::VertexIter vitr( mPoints );
        for(int i=0; i<ps.size(); i++ ){
            vitr.setPosition( ps[i] );
            vitr.setColorRGBA( cs[i] );

            ++vitr;
        }
    }
    
    
    mExp.startRender();
    bStart = true;
    
}
开发者ID:stdmtb,项目名称:uf_0.8.6,代码行数:86,代码来源:cApp.cpp

示例13: update

void cApp::update(){
    
    if( frame == endframe ){
        frame = 1;
        simDirNum++;
        if( 40<=simDirNum ){
            printf("DONE\n");
            quit();
        }else{
            printf(" --- DONE\n");
            printf("start rendering : simDirNum = %02d ", simDirNum );

            int w = win_w*master_scale;
            int h = win_h*master_scale;
            mExp.clear();
            mExp.setup( w, h, 0, 3000, GL_RGB, renderDir/to_string(simDirNum), 0);
#ifdef RENDER
            mExp.startRender();
#endif
        }
    }
    fs::path & simDir = simDirList[simDirNum];
    
    RfImporterBin rfIn;

    char m[255];
    //sprintf(m, "Circle01_%05d.bin", frame );
    sprintf(m, "Binary_Loader02_%05d.bin", frame );
    
    string fileName = toString(m);

    fs::path simFilePath = simDir / fileName;
    rfIn.load( simFilePath.string() );
    
    mDg.mDot.reset();

    numParticle = rfIn.gNumParticles;
    const vector<float> &p = rfIn.pPosition;
    const vector<float> &v = rfIn.pVelocity;
    const vector<int> &pid = rfIn.pId;
    
    vector<Vec3f> pos;
    vector<ColorAf> col;
    vector<ColorAf> col4Line;

    float scale = 55.0f;
    
    for (int i=0; i<numParticle; i++) {
        
        float x = p[i*3+0] * scale;
        float y = p[i*3+2] * scale;
        float z = p[i*3+1] * scale;
        pos.push_back( Vec3f(x, y, z) );
        
        float vx = v[i*3+0];
        float vy = v[i*3+2];
        float vz = v[i*3+1];
        float vel = sqrt(vx*vx + vy*vy + vz*vz);
        float velRate = lmap(vel, 0.03f, 15.0f, 0.0f, 1.0f);
        int colorId = pid[i] % mColorSample1.size();

        ColorAf c = mColorSample1[colorId];
        c.r += 0.2;
        c.g += 0.2;
        c.b += 0.2;
        
        c.g += velRate*0.1;
        c.a = 0.95;
        
        col.push_back( c );

        if( bDrawLine ){
            ColorAf c2 = mColorSample2[colorId];
            c2.a = lmap(vel, 0.0f, 1.0f, 0.1f, 0.6f);
            col4Line.push_back( c2 );
        }
    }
    
    mDg.createDot( pos, col, 0.0 );

    if( bDrawLine ){
        int num_line = 1;//randFloat(1,3);
        int num_dupl = 1;//randFloat(1,3);
        int vertex_per_point = num_line * num_dupl * 2;
        vector<Vec3f> out;
        out.assign( pos.size()*vertex_per_point, Vec3f(-99999, -99999, -99999) );
        vector<ColorAf> outc;
        outc.assign( pos.size()*vertex_per_point, ColorAf(0,0,0,0) );
        
        TbbNpFinder npf;
        npf.findNearestPoints( &pos[0], &out[0], &col4Line[0], &outc[0], pos.size(), num_line, num_dupl );
        mDg.addLine(out, outc);
    }
}
开发者ID:stdmtb,项目名称:n9,代码行数:94,代码来源:cApp.cpp

示例14: setup

void cApp::setup(){
    
    int sub = 0;
    for( int i=0; i<=6; i++){
        
        sub+= pow(2, i);
    }
    
    int w = win_w*master_scale;
    int h = win_h*master_scale;
    
    setFrameRate( fps );
    setWindowSize( w*0.5, h*0.5 );
    setWindowPos( 0, 0 );
    renderDir = mt::getRenderPath();
    mExp.setup( w, h, 0, 3000, GL_RGB, renderDir/to_string(simDirNum), 0);
    
    if( bDrawLine ) mExp2.setup( w, h, 0, 3000, GL_RGB, mt::getRenderPath()/"line"/to_string(simDirNum), 0);
    
    CameraPersp top( w, h, 60, 1, 1000000 );
    top.lookAt( Vec3f(0,0, 1300), Vec3f(0,0,0) );
    top.setCenterOfInterestPoint( Vec3f(0,0,0) );
    
    CameraPersp side( w, h, 60, 1, 1000000 );
    side.lookAt( Vec3f(0, 1300, 0), Vec3f(0,0,0) );
    side.setLensShift(0, 0);
    side.setCenterOfInterestPoint( Vec3f(0,0,0) );

    CameraPersp side2( w, h, 60, 1, 1000000 );
    side2.lookAt( Vec3f(1300, 0, 0), Vec3f(0,0,0) );
    side2.setLensShift(0, 0);
    side2.setCenterOfInterestPoint( Vec3f(0,0,0) );

    CameraPersp diag( w, h, 60, 1, 1000000 );
    diag.lookAt( Vec3f(1300/sqrt(2), 1300/sqrt(2), 0), Vec3f(0,0,0) );
    diag.setLensShift(0, 0);
    diag.setCenterOfInterestPoint( Vec3f(0,0,0) );

    CameraPersp diag2( w, h, 60, 1, 1000000 );
    diag2.lookAt( Vec3f(0, 1300/sqrt(2), 1300/sqrt(2)), Vec3f(0,0,0) );
    diag2.setLensShift(0, 0);
    diag2.setCenterOfInterestPoint( Vec3f(0,0,0) );

    cams.push_back(top);
    cams.push_back(side);
    cams.push_back(side2);
    cams.push_back(diag);
    cams.push_back(diag2);

    camUi.setCurrentCam( top );

    assetDir = mt::getAssetPath();
    for( int i=0; i<40; i++){
        //boost::format fmt("Circle01_%02d"); fmt % i;
        //fs::path simDir = assetDir/"sim"/"smooth_r3"/fmt.str();
        
        fs::path simDir = assetDir/"sim"/"absorb_r1";
        
        simDirList.push_back( simDir );
    }

    
    loadColorSample(assetDir/"img"/"colorSample"/"n5pickCol_0.png", mColorSample1 );
    if( bDrawLine ) loadColorSample(assetDir/"img"/"colorSample"/"n5pickCol_1.png", mColorSample2 );
    
#ifdef RENDER
    mExp.startRender();
    if( bDrawLine )mExp2.startRender();
#endif
}
开发者ID:stdmtb,项目名称:n9,代码行数:70,代码来源:cApp.cpp


注:本文中的Exporter::startRender方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。