void RotationsViewer::initializeGui()
{
    glutPassiveMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
    TwGLUTModifiersFunc(glutGetModifiers);
    TwInit(TW_OPENGL, NULL);
    TwWindowSize(mWindowWidth, mWindowHeight);

    TwCopyStdStringToClientFunc(onCopyStdStringToClient);

    mDemoBar = TwNewBar("Demo controls");
    TwDefine(" 'Demo controls' size='200 175' position='5 5' iconified=false fontresizable=false alpha=200");

    TwEnumVal modeTypeEV[] = { { DEMO1, "Convert" }, { DEMO2, "Curve" } };
    modeType = TwDefineEnum("ModeType", modeTypeEV, 2);
    TwAddVarRW(mDemoBar, "Demo", modeType, &mMode, NULL);

    TwAddVarRW(mDemoBar, "X Angle", TW_TYPE_DOUBLE, &mXAngle, " group='Convert params' ");
    TwAddVarRW(mDemoBar, "Y Angle", TW_TYPE_DOUBLE, &mYAngle, " group='Convert params' ");
    TwAddVarRW(mDemoBar, "Z Angle", TW_TYPE_DOUBLE, &mZAngle, " group='Convert params' ");
    TwEnumVal rooTypeEV[] = { { XYZ, "XYZ" }, { XZY, "XZY" }, { YXZ, "YXZ" }, { YZX, "YZX" }, { ZXY, "ZXY" }, { ZYX, "ZYX" } };
    rooType = TwDefineEnum("RooType", rooTypeEV, 6);
    TwAddVarRW(mDemoBar, "Rot Order", rooType, &mRotOrder, " group='Convert params' ");

    TwEnumVal splineTypeEV[] = { { ASplineQuat::LINEAR, "Linear" }, { ASplineQuat::CUBIC, "Cubic" } };
    splineType = TwDefineEnum("SplineType", splineTypeEV, 2);
    TwAddVarCB(mDemoBar, "Spline type", splineType, onSetStyleCb, onGetStyleCb, this, " group='Curve params'");
}
Exemple #2
0
InterfaceGl::InterfaceGl( const std::string &title, const Vec2i &size, const ColorA color )
{
	initAntGl();
	mBar = std::shared_ptr<TwBar>( TwNewBar( title.c_str() ), TwDeleteBar );
	char optionsStr[1024];
	sprintf( optionsStr, "`%s` size='%d %d' color='%d %d %d' alpha=%d", title.c_str(), size.x, size.y, (int)(color.r * 255), (int)(color.g * 255), (int)(color.b * 255), (int)(color.a * 255) );
	TwDefine( optionsStr );
	
	TwCopyStdStringToClientFunc( implStdStringToClient );
}
Exemple #3
0
int main ( int argc, char *argv[] ) {

	#pragma region [-- FreeGLUT --]
	
	glutInit (&argc, argv);
	glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH );
	glutInitWindowSize( Width, Heigth );
	main_window = glutCreateWindow ("Shaders");
	
	#pragma endregion

	#pragma region [-- GLEW --]
	
	// Inicializacion de GLEW
	GLenum glew_err = glewInit ();

	if ( GLEW_OK != glew_err ){
		cout << "No es posible inicializar GLEW\n";
		return 1;
	}

	

	cout << "Usando GLEW Version: " << glewGetString ( GLEW_VERSION ) << "\n\n";

	#pragma endregion

	initShaders();
	initLights();

	#pragma region [-- AntTweakBar --]
	TwBar *bar; // Pointer to the tweak bar
	TwBar *barLights;
	// Initialize AntTweakBar
    TwInit(TW_OPENGL, NULL);

	glutMouseFunc(mouseClick);

	// Set GLUT event callbacks
    // - Directly redirect GLUT mouse button events to AntTweakBar
    //glutMouseFunc((GLUTmousebuttonfun)TwEventMouseButtonGLUT);
    // - Directly redirect GLUT mouse motion events to AntTweakBar
    glutMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
    // - Directly redirect GLUT mouse "passive" motion events to AntTweakBar (same as MouseMotion)
    glutPassiveMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
    // - Directly redirect GLUT key events to AntTweakBar
    glutKeyboardFunc((GLUTkeyboardfun)TwEventKeyboardGLUT);
    // - Directly redirect GLUT special key events to AntTweakBar
    glutSpecialFunc((GLUTspecialfun)TwEventSpecialGLUT);
    // - Send 'glutGetModifers' function pointer to AntTweakBar;
    //   required because the GLUT key event functions do not report key modifiers states.
    TwGLUTModifiersFunc(glutGetModifiers);

	bar = TwNewBar("Objetos");
    TwDefine(" Objetos size='225 350' color='25 255 0' "); // change default tweak bar size and color 96 216 224

	// Define the required callback function to copy a std::string (see TwCopyStdStringToClientFunc documentation)
    TwCopyStdStringToClientFunc(CopyStdStringToClient);

	TwAddVarRW(bar, "Cargar figura", TW_TYPE_STDSTRING, &direccion_carga, 
               " label='direccion' group=Cargar help='Define a title for the new tweak bar.' ");

	// Add a button to create a new bar using the title
    TwAddButton(bar, "NewBarCreate", Cargar, &direccion_carga, 
                " label='--> Create' group=Cargar key=c help='Create a new tweak bar.' ");

	TwAddVarRW(bar, "ObjRotation1", TW_TYPE_QUAT4F, &g_Rotation, 
               " label='Object rotation' opened=true help='Change the object orientation.' ");

	// Add 'g_Zoom' to 'bar': this is a modifable (RW) variable of type TW_TYPE_FLOAT. Its key shortcuts are [m] and [M].
    TwAddVarRW(bar, "Zoom", TW_TYPE_FLOAT, &g_Zoom, 
               " min=0.01 max=2.5 step=0.01 keyIncr=m keyDecr=M help='Scale the object (1=original size).' ");
	// Add 'g_Zoom' to 'bar': this is a modifable (RW) variable of type TW_TYPE_FLOAT. Its key shortcuts are [m] and [M].
    TwAddVarRW(bar, "Shinnes", TW_TYPE_FLOAT, &shinnes, 
               " min=0.00 max=200 step=0.1 keyIncr=m keyDecr=M help='Scale the object (1=original size).' ");

	// Add 'Translate' to 'bar': this is a modifable (RW) variable of type TW_TYPE_FLOAT. Its key shortcuts are [xyz] and [xyz].
    TwAddVarRW(bar, "TranslateX", TW_TYPE_FLOAT, &Translation[0], 
               " min=-20.0 max=20 step=0.01 keyIncr=x keyDecr=X help='Scale the object (1=original size).' group='Translation' ");
	TwAddVarRW(bar, "TranslateY", TW_TYPE_FLOAT, &Translation[1], 
               " min=-20.0 max=20 step=0.01 keyIncr=y keyDecr=Y help='Scale the object (1=original size).' group='Translation' ");
	TwAddVarRW(bar, "TranslateZ", TW_TYPE_FLOAT, &Translation[2], 
               " min=-20.0 max=20 step=0.01 keyIncr=z keyDecr=Z help='Scale the object (1=original size).' group='Translation' ");

	barLights = TwNewBar("Luces");
    TwDefine(" Luces size='225 350' position='580 16' color='25 255 0' "); // change default tweak bar size and color 96 216 224

	{
        // ShapeEV associates Shape enum values with labels that will be displayed instead of enum values
        TwEnumVal lightType[3] = { {DIRECTIONALLIGHT, "Direccional"}, {SPOTLIGHT, "Reflector"}, {POINTLIGHT, "Puntual"} };
        // Create a type for the enum lightType
        TwType shapeType = TwDefineEnum("lightType", lightType, 3);
        // add 'g_CurrentShape' to 'bar': this is a variable of type ShapeType. Its key shortcuts are [<] and [>].
		TwAddVarRW(barLights, "Shape", shapeType, &g_light->status, " keyIncr='<' keyDecr='>' help='Change object shape.' ");
    }

	// Add 'g_LightDirection' to 'bar': this is a variable of type TW_TYPE_DIR3F which defines the light direction
	TwAddVarRW(barLights, "LightDir", TW_TYPE_DIR3F, &g_light->spotDirection, 
               " label='Light direction' opened=true help='Change the light direction.' ");

	// Add 'g_MatAmbient' to 'bar': this is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored)
    // and is inserted into a group named 'Material'.
	TwAddVarRW(barLights, "Ambient", TW_TYPE_COLOR3F, &g_light->ambient, " group='Material' ");

    // Add 'g_MatDiffuse' to 'bar': this is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored)
    // and is inserted into group 'Material'.
	TwAddVarRW(barLights, "Diffuse", TW_TYPE_COLOR3F, &g_light->diffuse, " group='Material' ");

	// Add 'g_MatDiffuse' to 'bar': this is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored)
    // and is inserted into group 'Material'.
	TwAddVarRW(barLights, "specular", TW_TYPE_COLOR3F, &g_light->specular, " group='Material' ");

	TwAddVarRW(barLights, "TranslateX", TW_TYPE_FLOAT, &g_light->position.x, 
               " min=-20.0 max=20 step=0.01 keyIncr=x keyDecr=X help='Scale the object (1=original size).' group='Translation' ");
	TwAddVarRW(barLights, "Translatey", TW_TYPE_FLOAT, &g_light->position.y, 
               " min=-20.0 max=20 step=0.01 keyIncr=y keyDecr=Y help='Scale the object (1=original size).' group='Translation' ");
	TwAddVarRW(barLights, "Translatez", TW_TYPE_FLOAT, &g_light->position.z, 
               " min=-20.0 max=20 step=0.01 keyIncr=z keyDecr=Z help='Scale the object (1=original size).' group='Translation' ");

	TwAddVarRW(barLights, "spotExponent", TW_TYPE_FLOAT, &g_light->spotExponent, 
               " min=0.0 max=10 step=1.0 help='Scale the object (1=original size).' ");
	TwAddVarRW(barLights, "spotCutoff", TW_TYPE_FLOAT, &g_light->spotCutoff, 
               " min=0.0 max=60 step=1.0 help='Scale the object (1=original size).' ");
	TwAddVarRW(barLights, "constantAttenuation", TW_TYPE_FLOAT, &g_light->constantAttenuation, 
               " min=0.0  step=1.0 help='Scale the object (1=original size).' ");
	TwAddVarRW(barLights, "linearAttenuation", TW_TYPE_FLOAT, &g_light->linearAttenuation, 
               " min=0.0  step=1.0 help='Scale the object (1=original size).' ");
	TwAddVarRW(barLights, "quadraticAttenuation", TW_TYPE_FLOAT, &g_light->quadraticAttenuation, 
               " min=0.0 max=60 step=1.0 help='Scale the object (1=original size).' ");

	#pragma endregion

	#pragma region [-- Callbacks --]

	glutDisplayFunc(Display);
	glutReshapeFunc(Reshape);

	#pragma endregion
	
	glEnable(GL_DEPTH_TEST);

	
	
	glutMainLoop ();

	return 0;
}
int main(int argc, char *argv[]) 
{
    // Initialize GLUT
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
    glutInitWindowSize(640, 480);
    glutCreateWindow("AntTweakBar string example");
    glutCreateMenu(NULL);

    // Set GLUT callbacks
    glutDisplayFunc(OnDisplay);
    glutReshapeFunc(OnReshape);
    atexit(OnTerminate);  // Called after glutMainLoop ends

    // Initialize AntTweakBar
    TwInit(TW_OPENGL, NULL);

    // Set GLUT event callbacks
    // - Directly redirect GLUT mouse button events to AntTweakBar
    glutMouseFunc(OnMouseButton);
    // - Directly redirect GLUT mouse motion events to AntTweakBar
    glutMotionFunc(OnMouseMotion);
    // - Directly redirect GLUT mouse "passive" motion events to AntTweakBar (same as MouseMotion)
    glutPassiveMotionFunc(OnMouseMotion);
    // - Directly redirect GLUT key events to AntTweakBar
    glutKeyboardFunc(OnKeyboard);
    // - Directly redirect GLUT special key events to AntTweakBar
    glutSpecialFunc(OnSpecial);
    // - Send 'glutGetModifers' function pointer to AntTweakBar;
    //   required because the GLUT key event functions do not report key modifiers states.
    TwGLUTModifiersFunc(glutGetModifiers);


    // Create a tweak bar
    TwBar *bar = TwNewBar("Main");
    TwDefine(" Main label='~ String variable examples ~' fontSize=3 position='180 16' size='270 440' valuesWidth=100 ");


    //
    // 1) C++ std::string variable example
    //

    TwAddButton(bar, "Info1.1", NULL, NULL, " label='1) This example uses' ");
    TwAddButton(bar, "Info1.2", NULL, NULL, " label='std::string variables' ");
    
    // Define the required callback function to copy a std::string (see TwCopyStdStringToClientFunc documentation)
    TwCopyStdStringToClientFunc(CopyStdStringToClient);
    
    // Adding a std::string variable
    std::string newBarTitle = "a title";
    TwAddVarRW(bar, "NewBarTitle", TW_TYPE_STDSTRING, &newBarTitle, 
               " label='Bar title' group=StdString help='Define a title for the new tweak bar.' ");
    
    // Add a button to create a new bar using the title
    TwAddButton(bar, "NewBarCreate", CreateBarCB, &newBarTitle, 
                " label='--> Create' group=StdString key=c help='Create a new tweak bar.' ");
    
    // Set the group label & separator
    TwDefine(" Main/StdString label='Create a new tweak bar' help='This example demonstates different use of std::string variables.' ");
    TwAddSeparator(bar, "Sep1", "");
    TwAddButton(bar, "Blank1", NULL, NULL, " label=' ' ");


    //
    // 2) C-Dynamic string variable example
    //

    TwAddButton(bar, "Info2.1", NULL, NULL, "label='2) This example uses' ");
    TwAddButton(bar, "Info2.2", NULL, NULL, "label='C-Dynamic string variables' ");
    
    // Define the required callback function to copy a CDString (see TwCopyCDStringToClientFunc documentation)
    TwCopyCDStringToClientFunc(CopyCDStringToClient);
    
    // Add a CDString variable
    char *someText = NULL;
    TwAddVarRW(bar, "Input", TW_TYPE_CDSTRING, &someText, 
               " label='Text input' group=CDString help=`The text to be copied to 'Text output'.` ");
    TwAddVarRO(bar, "Output", TW_TYPE_CDSTRING, &someText, 
               " label='Text output' group=CDString help=`Carbon copy of the text entered in 'Text input'.` ");
    
    // Add a line of text (we will use the label of a inactive button)
    #define TEXTLINE "a line of text"
    TwAddButton(bar, "Echo", NULL, NULL, 
                " label=`" TEXTLINE "` group=CDString help='Echo of the text entered in the next field' ");
    
    // Add a CDString variable accessed through callbacks
    char *textLine = (char *)malloc(sizeof(TEXTLINE)+1);
    strncpy(textLine, TEXTLINE, sizeof(TEXTLINE));
    TwAddVarCB(bar, "TextLine", TW_TYPE_CDSTRING, SetTextLineCB, GetTextLineCB, &textLine, 
               " label='Change text above' group=CDString help='The text to be echoed.' ");

    // Set the group label & separator
    TwDefine(" Main/CDString label='Echo some text' help='This example demonstates different use of C-Dynamic string variables.' ");
    TwAddSeparator(bar, "Sep2", "");
    TwAddButton(bar, "Blank2", NULL, NULL, " label=' ' ");


    //
    // 3) C-Static string variable example
    //

    TwAddButton(bar, "Info3.1", NULL, NULL, "label='3) This example uses' ");
    TwAddButton(bar, "Info3.2", NULL, NULL, "label='C strings of fixed size' ");

    // Add a CSString
    char tenStr[] = "0123456789"; // 10 characters + null_termination_char -> size = 11
    TwAddVarRW(bar, "Ten", TW_TYPE_CSSTRING(sizeof(tenStr)), tenStr, 
               " label='10 chars max' group=CSString help='A string with a length of 10 characters max.' ");

    // Add a CSString accessed through callbacks. The callbacks will convert the string characters to upper or lower case
    int capCase = 1; // O: lower-case, 1: upper-case
    TwAddVarCB(bar, "Capitalize", TW_TYPE_CSSTRING(sizeof(g_CapStr)), SetCapStrCB, GetCapStrCB, &capCase, 
               " group=CSString help='A string of fixed size to be converted to upper or lower case.' ");

    // Add a bool variable
    TwAddVarRW(bar, "Case", TW_TYPE_BOOL32, &capCase, 
               " false=lower true=UPPER group=CSString key=Space help=`Changes the characters case of the 'Capitalize' string.` ");

    // Set the group label & separator
    TwDefine(" Main/CSString label='Character capitalization' help='This example demonstates different use of C-Static sized variables.' ");
    TwAddSeparator(bar, "Sep3", "");


    // Call the GLUT main loop
    glutMainLoop();

    return 0;
}
void CreateBar(){
	TwBar *bar = TwNewBar("Gestures_controller");
	TwDefine(" Gestures_controller label='Gestures controller' fontSize=3 position='16 16' size='300 230' valuesWidth=100 ");

	TwCopyStdStringToClientFunc(CopyStdStringToClient);

	TwAddVarCB(bar, "Gesture name", TW_TYPE_STDSTRING, SetMyStdStringCB, GetMyStdStringCB, NULL, "");
	
	TwAddButton(bar, "NewGestureCreate", CreateGesture, NULL, " label='--> Create <--' ");
	TwAddButton(bar, "GestureRecognize", RecognizeGesture, NULL, " label='--> Recognize <--' ");
	

	TwAddSeparator(bar, NULL, "");

	TwAddVarRO(bar, "Hands:", TW_TYPE_INT32, &g_leapListener.numHands, "group='Captured values'");
	TwAddVarRO(bar, "Extended fingers:", TW_TYPE_INT32, &g_leapListener.numFingers, "group='Captured values'");

	TwAddSeparator(bar, NULL, "");
	TwAddVarRO(bar, "Recognized gesture", TW_TYPE_STDSTRING, &g_leapListener.recognizedGesture, "");
	TwAddVarRO(bar, "F_crit", TW_TYPE_FLOAT, &g_leapListener.f_crit, "");
	TwAddVarRO(bar, "F_value", TW_TYPE_FLOAT, &g_leapListener.f_value, "");


	TwBar *trials = TwNewBar("trials");
	TwDefine("trials label='Trials Controller' fontSize=3 position='16 250' size='300 130'");

	TwAddVarRO(trials, "Active trial:", TW_TYPE_STDSTRING, &trial, "");
	TwAddVarRO(trials, "Attempt:", TW_TYPE_INT32, &g_leapListener.nRecognize, "");
	TwAddButton(trials, "trial1", Trial1, NULL, " label='--> Trial 1  <--' ");
	TwAddButton(trials, "trial2", Trial2, NULL, " label='--> Trial 2  <--' ");
	TwAddButton(trials, "trial3", Trial3, NULL, " label='--> Trial 3  <--' ");

	bar2 = TwNewBar("gestures");
	TwDefine("gestures label='Saved Gestures' fontSize=3 position='780 16' size='250 650'");
	TwAddButton(bar2, "ClearDatabase", ClearDatabase, NULL, " label='--> Clear Database <--' ");
	TwAddSeparator(bar2, NULL, "");

	for (int i = 0; i < g_gestureManager.gestures.size(); i++){
		std::string params;
		params.append("");

		if (i >= next_gesture_id){
			params.append("visible='false'");
		}

		std::string varname;
		varname.append(std::to_string(i+1));
		varname.append(" - Name:");
		TwAddVarRO(bar2, varname.c_str(), TW_TYPE_STDSTRING, &g_gestureManager.gestures[i].name, params.c_str());

		varname.clear();
		varname.append(std::to_string(i+1));
		varname.append(" - ID:");
		TwAddVarRO(bar2, varname.c_str(), TW_TYPE_INT32, &g_gestureManager.gestures[i].id, params.c_str());

		varname.clear();
		varname.append(std::to_string(i+1));
		varname.append(" - Hands:");
		TwAddVarRO(bar2, varname.c_str(), TW_TYPE_INT32, &g_gestureManager.gestures[i].numHands, params.c_str());

		varname.clear();
		varname.append(std::to_string(i+1));
		varname.append(" - Fingers:");
		TwAddVarRO(bar2, varname.c_str(), TW_TYPE_INT32, &g_gestureManager.gestures[i].numFingers, params.c_str());
		
		varname.clear();
		varname.append(std::to_string(i+1));
		varname.append(" - sep:");
		TwAddSeparator(bar2, varname.c_str(), params.c_str());
	}

	glfwSetWindowSizeCallback(WindowSizeCB);
	glfwSetMouseButtonCallback((GLFWmousebuttonfun)TwEventMouseButtonGLFW);
	glfwSetMousePosCallback((GLFWmouseposfun)TwEventMousePosGLFW);
	glfwSetMouseWheelCallback((GLFWmousewheelfun)TwEventMouseWheelGLFW);
	glfwSetKeyCallback((GLFWkeyfun)TwEventKeyGLFW);
	glfwSetCharCallback((GLFWcharfun)TwEventCharGLFW);
}
// main func is temporary ugly
int main(int argc, char ** argv)
{
	srand(time(NULL));

	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_MULTISAMPLE | GLUT_ACCUM);
	glutInitWindowPosition(glutGet(GLUT_SCREEN_WIDTH) / 14, glutGet(GLUT_SCREEN_HEIGHT) / 21);
	glutInitWindowSize(glutGet(GLUT_SCREEN_WIDTH) * 6 / 7, glutGet(GLUT_SCREEN_HEIGHT) * 6/7);
	int window = glutCreateWindow("Star System");
	//glutFullScreen();

	glEnable(GL_ACCUM);
	glEnable(GL_DEPTH_TEST);
	//glEnable(GL_LINE_SMOOTH);
	//glEnable(GL_CULL_FACE);
	glEnable(GL_LIGHTING);

	//glCullFace(GL_BACK);
	
	//glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);

	glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
	TwInit(TW_OPENGL, NULL);

	glutDisplayFunc(GlutCB::Display);
	glutReshapeFunc(GlutCB::Reshape);
	
	glutMouseFunc(GlutCB::Mouse);
	glutMotionFunc(GlutCB::Motion);
	glutPassiveMotionFunc(GlutCB::PassiveMotion);
	glutKeyboardFunc(GlutCB::Keyboard);
	glutKeyboardUpFunc(GlutCB::KeyboardUp);
	glutSpecialFunc(GlutCB::Special);
	glutSpecialUpFunc(GlutCB::SpecialUp);

	TwGLUTModifiersFunc(glutGetModifiers);

	glutTimerFunc(Constants::deltaTime, GlutCB::Timer, 1);

	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

	Star sun("Sun", 2.0e30, 1.4e9, Vector3f(1.0f, 1.0f, 0.0f), Vector3d(0.0, 0.0, 0.0), Vector3d(0.0, 0.0, 0.0));

	Planet mercury("Mercury", 3.3e23, 5.0e6, Vector3f(0.8f, 0.0f, 0.0f), Vector3d(4.6e10, 0.0, 0.0), Vector3d(0.0, 4.7e4, 0.0));

	Planet venus("Venus", 4.8e24, 1.2e7, Vector3f(0.8f, 0.6f, 0.7f), Vector3d(1.0e11, 0.0, 0.0), Vector3d(0.0, 3.5e4, 0.0));

	Planet earth("Earth", 6.0e24, 1.2e7, Vector3f(0.0f, 0.0f, 1.0f), Vector3d(1.5e11, 0.0, 0.0), Vector3d(0.0, 3.0e4, 0.0));
	Sputnik moon("Moon", 7.35e22, 3.4e6, Vector3f(0.7f, 0.7f, 0.7f), &earth, Vector3d(4.0e8, 0.0, 0.0), Vector3d(0.0, 1.0e3, 0.0));

	Planet mars("Mars", 6.4e23, 6.7e6, Vector3f(1.0f, 0.0f, 0.0f), Vector3d(2.0e11, 0.0, 0.0), Vector3d(0.0, 2.4e4, 0.0));

	Teapot rasselsTeapot("RasselsTeapot", 0.0, 0.3, Vector3f(1.0f, 1.0f, 1.0f), Vector3d(3.0e11, 0.0, 0.0), Vector3d(0.0, 2.0e4, 0.0));

	Planet jupiter("Jupiter", 1.9e27, 1.3e8, Vector3f(1.0f, 0.8f, 0.0f), Vector3d(7.4e11, 0.0, 0.0), Vector3d(0.0, 1.3e4, 0.0));

	RenderManager * renderManager = RenderManager::getInstance();
	renderManager->initAll();

	Camera * camera = new Camera();
	
	ControlPane * ctrlPane = ControlPane::getInstance(camera, renderManager);
	ctrlPane->show();

	TwCopyStdStringToClientFunc(CopyStdStringToClient);

	ctrlPane->addSpaceObject(&sun);
	renderManager->renderSpaceObject(&sun);

	ctrlPane->addSpaceObject(&mercury);
	renderManager->renderSpaceObject(&mercury);

	ctrlPane->addSpaceObject(&venus);
	renderManager->renderSpaceObject(&venus);

	ctrlPane->addSpaceObject(&earth);
	renderManager->renderSpaceObject(&earth);

	ctrlPane->addSpaceObject(&moon);
	renderManager->renderSpaceObject(&moon);

	ctrlPane->addSpaceObject(&mars);
	renderManager->renderSpaceObject(&mars);

	ctrlPane->addSpaceObject(&rasselsTeapot);
	renderManager->renderSpaceObject(&rasselsTeapot);

	ctrlPane->addSpaceObject(&jupiter);
	renderManager->renderSpaceObject(&jupiter);

	GlutCBInitializer::init(camera, renderManager);

	glutMainLoop();
	
	delete ctrlPane;
	glutDestroyWindow(window);
	return EXIT_SUCCESS;
}