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