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


C++ Trackball::setMinNear方法代码示例

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


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

示例1: initGL

/** This method needs to be called once the GL context has been created by GLFW.
  * It is called only once per execution */
void initGL()
{ 
    // set the background color, i.e., the color used
    // to fill the screen when calling glClear(GL_COLOR_BUFFER_BIT)
    glClearColor(0.3f,0.3f,0.3f,0.);

    glEnable(GL_DEPTH_TEST);

    // load the default shaders 
    mBlinn.loadFromFiles(PGHP_DIR"/shaders/blinn.vert", PGHP_DIR"/shaders/blinn.frag");
    mSimple.loadFromFiles(PGHP_DIR"/shaders/simple.vert", PGHP_DIR"/shaders/simple.frag");
    mHole.loadFromFiles(PGHP_DIR"/shaders/hole.vert", PGHP_DIR"/shaders/hole.frag");
    mMesh.loadFromFiles(PGHP_DIR"/shaders/mesh.vert", PGHP_DIR"/shaders/mesh.frag");

    //PointCloud
    pc = new PointCloud();
    pc->load(PGHP_DIR"/data/decimate.asc");
    pc->makeUnitary();
    pc->init(&mBlinn);

    //Mesh
    mesh = new Mesh();
    //mesh->load(PGHP_DIR"/data/PhantomUgly.obj");
    //mesh->load(PGHP_DIR"/data/PhantomLite.obj");
    //mesh->load(PGHP_DIR"/data/bunny.obj");
    mesh->load(PGHP_DIR"/data/sphere.obj");
    //mesh->load(PGHP_DIR"/data/sphere2.obj");
    mesh->makeUnitary();
    mesh->init(&mBlinn);

    //Octree
    octree = new Octree(pc,15,10);
    wirecube = new WireCube();
    wirecube->init(&mSimple);

    mCamera.setSceneCenter(Vector3f(0.0,0.0,0.0));
    mCamera.setSceneDistance(4);
    mCamera.setMinNear(0.1f);
    mCamera.setNearFarOffsets(-200.f,200.0f);
    mCamera.setScreenViewport(AlignedBox2f(Vector2f(0.0,0.0), Vector2f(WIDTH,HEIGHT)));

    GL_TEST_ERR;
}
开发者ID:MYJY971,项目名称:sagacious-octo-waddle,代码行数:45,代码来源:main.cpp

示例2: initGL

/** This method needs to be called once the GL context has been created by GLFW.
  * It is called only once per execution */
void initGL()
{ 
    // set the background color, i.e., the color used
    // to fill the screen when calling glClear(GL_COLOR_BUFFER_BIT)
    glClearColor(0.3f,0.3f,0.3f,0.);

    glEnable(GL_DEPTH_TEST);

    // load the default shaders 
    mBlinn.loadFromFiles(PGHP_DIR"/shaders/blinn.vert", PGHP_DIR"/shaders/blinn.frag");
    mSimple.loadFromFiles(PGHP_DIR"/shaders/simple.vert", PGHP_DIR"/shaders/simple.frag");

    //PointCloud
    pc = new PointCloud();
    //pc->load(PGHP_DIR"/data/decimate.asc");
    //pc->load(PGHP_DIR"/data/decimateRed.asc");
    pc->load(PGHP_DIR"/data/sunglasses_lens.asc");
    pc->makeUnitary();
    pc->init(&mBlinn);

    //Ball
    ball = new Ball(pc);
    ball->init(&mBlinn);

    surface = new Surface();
    surface->init(&mSimple);

    //Octree
    octree = new Octree(pc,15,10);
    wirecube = new WireCube();
    wirecube->init(&mSimple);

    mCamera.setSceneCenter(Vector3f(0.0,0.0,0.0));
    mCamera.setSceneDistance(4);
    mCamera.setMinNear(0.1f);
    mCamera.setNearFarOffsets(-200.f,200.0f);
    mCamera.setScreenViewport(AlignedBox2f(Vector2f(0.0,0.0), Vector2f(WIDTH,HEIGHT)));

    GL_TEST_ERR;
}
开发者ID:MYJY971,项目名称:sagacious-octo-waddle,代码行数:42,代码来源:main.cpp

示例3: initGL

/** This method needs to be called once the GL context has been created by GLFW.
  * It is called only once per execution */
void initGL()
{ 
    // set the background color, i.e., the color used
    // to fill the screen when calling glClear(GL_COLOR_BUFFER_BIT)
    glClearColor(0.3f,0.3f,0.3f,0.);

    glEnable(GL_DEPTH_TEST);

    // load the default shaders 
    mBlinn.loadFromFiles(PGHP_DIR"/shaders/blinn.vert", PGHP_DIR"/shaders/blinn.frag");
    mSimple.loadFromFiles(PGHP_DIR"/shaders/simple.vert", PGHP_DIR"/shaders/simple.frag");
    mHole.loadFromFiles(PGHP_DIR"/shaders/hole.vert", PGHP_DIR"/shaders/hole.frag");
//    mMesh.loadFromFiles(PGHP_DIR"/shaders/mesh.vert", PGHP_DIR"/shaders/mesh.frag");

    //PointCloud
    pc = new PointCloud();
    pc->load(PGHP_DIR"/data/decimate.asc");
    pc->makeUnitary();
    pc->init(&mBlinn);

    //Mesh

    Mesh* mesh = new Mesh();
    //mesh->load(PGHP_DIR"/data/PhantomUgly.obj");
    //mesh->load(PGHP_DIR"/data/PhantomLite.obj");
    //mesh->load(PGHP_DIR"/data/cube.obj");
    mesh->load(PGHP_DIR"/data/ObjConnexe.obj");
    mesh->makeUnitary();
    mesh->init(&mBlinn);
    mMeshes.push_back(mesh);
    //kate_leg------------
    Mesh* kate_leg = new Mesh();
    kate_leg->load(PGHP_DIR"/data/Kate_leg.obj");
    kate_leg->makeUnitary();
    kate_leg->init(&mBlinn);
    mMeshes.push_back(kate_leg);
    //kate_fur------------
    Mesh* kate_fur = new Mesh();
    kate_fur->load(PGHP_DIR"/data/Kate_fur.obj");
    kate_fur->makeUnitary();
    kate_fur->init(&mBlinn);
    mMeshes.push_back(kate_fur);
    //bunny------------
    Mesh* bunny = new Mesh();
    bunny->load(PGHP_DIR"/data/bunny_stanford.obj");
    bunny->makeUnitary();
    bunny->init(&mBlinn);
    mMeshes.push_back(bunny);
    //sphere------------
    Mesh* sphere = new Mesh();
    sphere->load(PGHP_DIR"/data/sphere.obj");
    sphere->makeUnitary();
    sphere->init(&mBlinn);
    mMeshes.push_back(sphere);
    //cube------------
    Mesh* cube = new Mesh();
    cube->load(PGHP_DIR"/data/cube.obj");
    cube->makeUnitary();
    cube->init(&mBlinn);
    mMeshes.push_back(cube);
    //2cube------------
    Mesh* twoCubes = new Mesh();
    twoCubes->load(PGHP_DIR"/data/twoCubes.obj");
    twoCubes->makeUnitary();
    twoCubes->init(&mBlinn);
    mMeshes.push_back(twoCubes);
    //3compConnex------------
    Mesh* troisConnex = new Mesh();
    troisConnex->load(PGHP_DIR"/data/troisConnex.obj");
    troisConnex->makeUnitary();
    troisConnex->init(&mBlinn);
    mMeshes.push_back(troisConnex);

    //---------------------

    mCurrentMesh = mMeshes.size()-1;

    //Octree
    octree = new Octree(pc,15,10);
    wirecube = new WireCube();
    wirecube->init(&mSimple);

    mCamera.setSceneCenter(Vector3f(0.0,0.0,0.0));
    mCamera.setSceneDistance(4);
    mCamera.setMinNear(0.1f);
    mCamera.setNearFarOffsets(-200.f,200.0f);
    mCamera.setScreenViewport(AlignedBox2f(Vector2f(0.0,0.0), Vector2f(WIDTH,HEIGHT)));

    GL_TEST_ERR;
}
开发者ID:Patagouin,项目名称:Mod,代码行数:92,代码来源:main.cpp


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