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


C++ Turtle::init方法代码示例

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


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

示例1: setup

void AngleConversionApp::setup()
{
    // SETUP CAMERA
	mCameraDistance = 1200.0f;
	mEye			= Vec3f( 0.0f, 0.0f, mCameraDistance );
	mCenter			= Vec3f( 0.0f, 0.0f, 0.0f );
	mUp				= Vec3f::yAxis();
	mCam.setPerspective( 75.0f, getWindowAspectRatio(), 5.0f, 3000.0f );
    
    // CAMERA ROTATION
    xAngle = 0.0f;
    yAngle = 0.0f;
    zAngle = 0.0f;
    
    // OBJECT ROTATION
    rotateX0 = 0.0f;
    rotateY0 = 0.0f;
    rotateZ0 = 0.0f;
    
    // OBJECT ROTATION
    rotateX1 = 0.0f;
    rotateY1 = 0.0f;
    rotateZ1 = 0.0f;
    
    //PARAMS
    mParams = params::InterfaceGl( "Control Panel", Vec2i( 200, 160 ) );
    mParams.addParam( "Scene Rotation", &mSceneRotation );
    mParams.addParam( "Eye Distance", &mCameraDistance, "min=50.0 max=1500.0 step=50.0 keyIncr=s keyDecr=w" );
    mParams.addParam( "X Angle", &xAngle, "min=0.0 max=360.0 step=5.0 keyIncr=r keyDecr=f" );
    mParams.addParam( "Y Angle", &yAngle, "min=0.0 max=360.0 step=5.0 keyIncr=t keyDecr=g" );
    mParams.addParam( "Z Angle", &zAngle, "min=0.0 max=360.0 step=5.0 keyIncr=y keyDecr=h" );
    
    mParams.addParam( "Rotate X0", &rotateX0, "min=0.0 max=360.0 step=5.0 keyIncr=u keyDecr=j" );
    mParams.addParam( "Rotate Y0", &rotateY0, "min=0.0 max=360.0 step=5.0 keyIncr=i keyDecr=k" );
    mParams.addParam( "Rotate Z0", &rotateZ0, "min=0.0 max=360.0 step=5.0 keyIncr=o keyDecr=l" );
    
    mParams.addParam( "Rotate X1", &rotateX1, "min=0.0 max=360.0 step=5.0 keyIncr=u keyDecr=j" );
    mParams.addParam( "Rotate Y1", &rotateY1, "min=0.0 max=360.0 step=5.0 keyIncr=i keyDecr=k" );
    mParams.addParam( "Rotate Z1", &rotateZ1, "min=0.0 max=360.0 step=5.0 keyIncr=o keyDecr=l" );

    
    glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
	
	gl::enableDepthWrite();
	gl::enableDepthRead();
	gl::enableAlphaBlending();
    
    glDisable( GL_TEXTURE_2D );
    
    mDirectional = 1.0f;
    
    camAngle = 0;
    
    // TURTLE
    startPosition.set( 0.0f, 0.0f, 0.0f);
    zeroDirection.set( 0.0f, 0.0f, 0.0f);
    initialDirection.set( 0.0f, 0.0f, 0.0f);
    
    direction1.set( 0.0f, 0.0f, 0.0f );
    direction2.set( 0.0f, 0.0f, 0.0f );
    
    testTurtle.init( Vec3f(0.0f, 0.0f, 0.0f), Vec3f(0.0f, 30.0f, 30.0f), direction1, 200.0f, 20.0f );
    mTurtles.push_back(testTurtle);
    
    //testTurtle2.init( testTurtle.mFinalPosition, 
    
    
    
    for (int i = 0; i < mTurtles.size(); i++ ) {
        string textString;
        
        textFinalAngle.push_back(textString);
        
        textSetAngle.push_back(textString);
        
        textPreviousAngle.push_back(textString);
        
        textFinalPosition.push_back(textString);
        
        textStartPosition.push_back(textString);
        
        textLocalCoordinates.push_back(textString);
        
        textWorldCoordinates.push_back(textString);
    }

}
开发者ID:williamchyr,项目名称:CinderExamples,代码行数:87,代码来源:AngleConversionApp.cpp


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