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


C++ Viewer::eyePosition方法代码示例

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


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

示例1: display

void display() {
    glClear( GL_COLOR_BUFFER_BIT );

    Origami.draw( View.eyePosition() );
    if( State.drawAxis ) {
        glBegin(GL_LINES);
        glColor3ub(255,  0,  0);
        glVertex3d(-20.0,0.0,0.0);
        glColor3ub(255,255,255);
        glVertex3d(  0.0,0.0,0.0);
        glVertex3d(0.0,0.0,0.0);
        glColor3ub(255,  0,  0);
        glVertex3d( 20.0,0.0,0.0);
        glColor3ub(  0,255,  0);
        glVertex3d(0.0,-20.0,0.0);
        glColor3ub(255,255,255);
        glVertex3d(0.0,  0.0,0.0);
        glVertex3d(0.0,0.0,0.0);
        glColor3ub(  0,255,  0);
        glVertex3d(0.0, 20.0,0.0);
        glColor3ub(  0,  0,255);
        glVertex3d(0.0,0.0,-20.0);
        glColor3ub(255,255,255);
        glVertex3d(0.0,0.0,  0.0);
        glVertex3d(0.0,0.0,0.0);
        glColor3ub(  0,  0,255);
        glVertex3d(0.0,0.0, 20.0);
        glEnd();
    }
    Origami.drawAdjust();

    glutSwapBuffers();
}
开发者ID:buihaduong,项目名称:Origami,代码行数:33,代码来源:main.cpp

示例2: folding

void folding(Vector source, Vector destination)
{
	// Origami.listVertex();
	// printf("\n");

	// source.print();
	View.world2window( source, Cursor3D.x, Cursor3D.y, Cursor3D.z );

	Line line = View.cursorLine( Cursor3D.x, Cursor3D.y );
	// line.print();
	source = Origami.pickVertex( line );

	glutWarpPointer( Cursor3D.x, Cursor3D.y );
	// destination.print();
	// printf("\n");

	Origami.moveVertex( destination, View.eyePosition(), false);
	View.world2window( destination, Cursor3D.x, Cursor3D.y, Cursor3D.z );
	Origami.releaseVertex();
}
开发者ID:buihaduong,项目名称:Origami,代码行数:20,代码来源:main.cpp

示例3: timer

void timer(int value) {
								bool redisplay = false;
								// modify view
								double angle  = 1.5/double(State.fps);
								double delta  = 1.5/double(State.fps);
								double deltaZ = 0.015/double(State.fps);
								double scale  = 1.0+1.5/double(State.fps);
								if( Special.down(GLUT_KEY_LEFT)    ) { View.twistLeft( angle );   redisplay=true; }
								if( Special.down(GLUT_KEY_RIGHT)   ) { View.twistRight( angle );  redisplay=true; }
								if( Special.down(GLUT_KEY_UP)      ) { View.zoom( 1.0/scale ); redisplay=true; }
								if( Special.down(GLUT_KEY_DOWN)    ) { View.zoom( scale );   redisplay=true; }
								if( Key.down('4') || State.inRotation ) { View.rotateLeft( angle );  redisplay=true; } // need numlock on
								if( Key.down('6') ) { View.rotateRight( angle ); redisplay=true; }
								if( Key.down('8') ) { View.rotateUp( angle );    redisplay=true; }
								if( Key.down('2') ) { View.rotateDown( angle );  redisplay=true; }
								if( Key.down('1') ) { View.slideLeft( delta ); redisplay=true; }
								if( Key.down('3') ) { View.slideRight( delta ); redisplay=true; }
								if( Key.down('5') ) { View.lookAt( 0, 0, 40,  0, 0, 0,  0, 1, 0 ); redisplay=true; }
								// renew folding
								if( State.inFolding ) {
																bool inBending = false;
																if( Key.down('m') ) {
																								Cursor3D.z -= deltaZ;
																								inBending = true;
																}else if( Key.down('n') ) {
																								Cursor3D.z += deltaZ;
																}
																Vector destination;

																View.window2world( Cursor3D.x, Cursor3D.y, Cursor3D.z, destination );
																Origami.moveVertex( destination, View.eyePosition(), inBending );
																View.world2window( destination, Cursor3D.x, Cursor3D.y, Cursor3D.z );
																redisplay = true;
								}else if( State.inAnimation ) {
																if( Origami.play( State.fps ) ) State.inAnimation = false;
																redisplay = true;
								}

								if(redisplay) glutPostRedisplay();
								glutTimerFunc(1000/State.fps, timer, 0);
}
开发者ID:buihaduong,项目名称:Origami,代码行数:41,代码来源:main.cpp


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