本文整理汇总了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;
}
示例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;
}
示例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;
}