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


C++ TwAddVarRW函数代码示例

本文整理汇总了C++中TwAddVarRW函数的典型用法代码示例。如果您正苦于以下问题:C++ TwAddVarRW函数的具体用法?C++ TwAddVarRW怎么用?C++ TwAddVarRW使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: init

void init(void)
{
	

	// Define técnica de shading: GL_FLAT, GL_SMOOTH
	glShadeModel(GL_SMOOTH);
	
	glPolygonMode(GL_FRONT, GL_FILL); // GL_LINE, GL_POINT, GL_FILL

	// Activa o teste de profundidade
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_TEXTURE_2D); 
	//glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); 
	TwInit(TW_OPENGL, NULL);

	mainBar = TwNewBar("Parameters");
	TwAddVarRW(mainBar, "Time Scale", TW_TYPE_FLOAT, &TimeScale,
		" group='Simulation' keyincr=U keydecr=I help='Simulation's time scale'");
	TwAddVarRW(mainBar, "Speed", TW_TYPE_FLOAT, &camSpeed,
		" group='Camera' keyincr=S keydecr=X help='Camera movement speed' ");
	TwAddVarRW(mainBar, "Manual", TW_TYPE_BOOL16, &manualCam,
		" group='Camera' keyincr=C help='Toogle camera mode' ");
	TwAddVarRW(mainBar, "Show Orbits", TW_TYPE_BOOL16, &orbits,
		" group='Orbits' keyincr=O help='Toogle orbits' ");

	// Compila o modelo
	createFloorToDL();
}
开发者ID:vvolkgang,项目名称:YASS,代码行数:28,代码来源:main.c

示例2: glutPassiveMotionFunc

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'");
}
开发者ID:codemodo,项目名称:animation_toolkit,代码行数:27,代码来源:RotationsViewer.cpp

示例3: main

int main(int args, char **argv)
{
  glutInit(&args, argv);
  glutInitWindowSize(800, 600);
  glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
  glutCreateWindow("simple vertex shader");

  TwInit(TW_OPENGL, NULL);
  TwBar *bar = TwNewBar("myBar");
  TwDefine("myBar size='200 400' color = '96 216 224'");

  TwAddVarRW(bar, "ObjectRotate", TW_TYPE_QUAT4F, &g_Rotate, "label='Object Rotation' opened=true");
  TwAddVarRW(bar, "LightDir", TW_TYPE_DIR3F, &g_lightPos, "label='light Pos' opened=true");
  glutMouseFunc((GLUTmousebuttonfun)TwEventMouseButtonGLUT);
  glutMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
  glutPassiveMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
  glutKeyboardFunc((GLUTkeyboardfun)TwEventKeyboardGLUT);
  TwGLUTModifiersFunc(glutGetModifiers);
  glutDisplayFunc(RenderScene);
  glutReshapeFunc(ChangeSize);
  SetupRC();
  glutMainLoop();
  Terminate();
  return 0;
}
开发者ID:RamboWu,项目名称:openglex,代码行数:25,代码来源:simple.cpp

示例4: TwDeleteBar

void MaterialDialog::setMaterial(int pIndex)
{
	if (m_dialog)
		TwDeleteBar(m_dialog);
	// Create a tweak bar
	m_dialog = TwNewBar("Material");
	int barSize[2] = {200, 1060};
	TwDefine(" Material position='1710 10'  ");
	TwSetParam(m_dialog, NULL, "size", TW_PARAM_INT32, 2, barSize);

	m_material = Scene::GetInstance()->GetMaterial(pIndex);

	TwAddVarCB(m_dialog, "MaterialName", TW_TYPE_CDSTRING, SetName, GetName, (void*)this, " label='Name: '");
	TwAddVarRW(m_dialog, "Ambient", TW_TYPE_COLOR3F, (void*)&m_material->ambient, " help='Light color.' group='Properties'");
	TwAddVarRW(m_dialog, "Diffuse", TW_TYPE_COLOR3F, (void*)&m_material->diffuse, " help='Light color.' group='Properties'");
	TwAddVarRW(m_dialog, "Specular", TW_TYPE_COLOR3F, (void*)&m_material->specular, " help='Light color.' group='Properties'");
	TwAddVarRW(m_dialog, "Emissive", TW_TYPE_COLOR3F, (void*)&m_material->emissive, " help='Light color.' group='Properties'");

	TwAddVarRW(m_dialog, "Opacity", TW_TYPE_FLOAT, (void*)&m_material->opacity, " help='Light color.' group='Properties' min=0.0 max=1.0 step=0.01");
	TwAddVarRW(m_dialog, "Reflectivity", TW_TYPE_FLOAT, (void*)&m_material->reflectivity, " help='Light color.' group='Properties' min=0.0 max=1.0 step=0.01");
	TwAddVarRW(m_dialog, "Shininess", TW_TYPE_FLOAT, (void*)&m_material->shininess, " help='Light color.' group='Properties' min=0.0 max=100.0 step=1.0");
	TwAddVarRW(m_dialog, "Texture Scale", TW_TYPE_FLOAT, (void*)&m_material->textureScale, " help='Light color.' group='Properties' min=0.0 max=10.0 step=0.01");

	TwAddButton(m_dialog, "Load Diffuse Texture", LoadDiffuse, this, " label='Diffuse Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Specular Texture", LoadSpecular, this, " label='Specular Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Glow Texture", LoadGlow, this, " label='Glow Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Normal Texture", LoadNormal, this, " label='Normal Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Displacement Texture", LoadDisplacement, this, " label='Displacement Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Gradient Texture", LoadGradient, this, " label='Gradient Texture' key=c help='Load an Agile file into the editor.' group='Load'");

	TwStructMember tessMembers[] = { 
		{ "Edge1", TW_TYPE_FLOAT, offsetof(AglVector4, x), " Step=0.1 min=1.0 max=64.0" },
		{ "Edge2", TW_TYPE_FLOAT, offsetof(AglVector4, y), " Step=0.1 min=1.0 max=64.0" },
		{ "Edge3", TW_TYPE_FLOAT, offsetof(AglVector4, z), " Step=0.1 min=1.0 max=64.0" },
		{ "Internal", TW_TYPE_FLOAT, offsetof(AglVector4, w), " Step=0.1 min=1.0 max=64.0" }};
	TwType tessType = TwDefineStruct("TESSELATIONFACTORS", tessMembers, 4, sizeof(AglVector4), NULL, NULL);

	TwAddVarRW(m_dialog, "Tess", tessType, &m_material->tesselationFactor, " group='Properties' ");
	TwAddVarRW(m_dialog, "Displacement", TW_TYPE_FLOAT, (void*)&m_material->displacement, " group='Properties' min=0.0 max=10.0 step=0.01");

	TwAddButton(m_dialog, "Add Layer", AddLayer, this, " label='Add Layer' key=c help='Load an Agile file into the editor.' group='Gradient Mapping'");

	TwAddButton(m_dialog, "Delete", Delete, this, "");


	if (m_material->gradientDataIndex >= 0)
	{
		AglGradient* g = Scene::GetInstance()->GetGradient(m_material->gradientDataIndex);
		vector<AglGradientMaterial*> layers = g->getLayers();
		for (unsigned int i = 0; i < layers.size(); i++)
		{
			AddLayer(g, layers[i], i);
		}
	}


	show();
}
开发者ID:MattiasLiljeson,项目名称:Amalgamation,代码行数:58,代码来源:MaterialDialog.cpp

示例5: TwAddVarRW

void rendering::lighting::BaseLight::InitializeTweakBar(TwBar* lightsBar)
{
	//TwAddVarRW(lightsBar, "lightPos", vector3DType, &GetTransform().GetPos(), " label='Pos' group='Base lights' ");
	//TwAddVarRW(lightsBar, "lightRot", TW_TYPE_QUAT4F, &GetTransform().GetRot(), " label='Rot' group='Base lights' ");
	//TwAddVarRW(lightsBar, "lightShadowInfo", shadowInfoType, &(*GetShadowInfo()), " label='Shadow info' group='Base lights' ");
	TwAddVarRW(lightsBar, "lightColor", TW_TYPE_COLOR4F, &m_color, " label='Color' group='Base lights' ");
	TwAddVarRW(lightsBar, "lightIntensity", TW_TYPE_REAL, &m_intensity, " label='Intensity' group='Base lights' ");
	TwAddVarRW(lightsBar, "lightEnabled", TW_TYPE_BOOLCPP, &m_isEnabled, " label='Enabled' group='Base lights' ");
}
开发者ID:artulec88,项目名称:GameEngine,代码行数:9,代码来源:BaseLight.cpp

示例6: TwNewBar

void CompleteBoxPruningTest::Select()
{
    // Create a tweak bar
    {
        mBar = TwNewBar("OPC_CompleteBoxPruning");
        TwAddVarRW(mBar, "Speed", TW_TYPE_FLOAT, &mSpeed, " min=0.0 max=0.01 step=0.00001");
        TwAddVarRW(mBar, "Amplitude", TW_TYPE_FLOAT, &mAmplitude, " min=10.0 max=200.0 step=0.1");
    }
}
开发者ID:Rocket-Buddha,项目名称:GameCode4,代码行数:9,代码来源:CompleteBoxPruning.cpp

示例7: twGUI

void twGUI(TwBar *bar){
    
    TwAddVarRW(bar, "Model path", TW_TYPE_CSSTRING(255), &filename, " group='Model' ");
    TwAddButton(bar, "Load", loadModel, NULL, " group='Model' ");
    
    TwAddVarRW(bar, "Radius", TW_TYPE_FLOAT, &mesh.radius, " group='Surfels' min=0 max=1 step = 0.002 ");
    TwAddVarRW(bar, "Normal Size", TW_TYPE_FLOAT, &mesh.normalSize, " group='Surfels' min=0 max=1 step = 0.02 ");

}
开发者ID:w2schmitt,项目名称:CppPointRendering,代码行数:9,代码来源:callbacks.cpp

示例8: setupAntTweakBar

static void setupAntTweakBar()
{
	g_bar = TwNewBar("TweakBar");
	TwDefine(" TweakBar size='320 640' "); // resize bar
	TwDefine(" GLOBAL help='Simulation control.' "); // Message added to the help bar.
	
	/*TwAddVarRW(g_bar, "TD", TW_TYPE_FLOAT, &var_TIME_DELTA,
		" label='Time delta' precision=5 min=0 max=1 step=0.01 ");*/
	
	TwAddVarRW(g_bar, "FPS", TW_TYPE_DOUBLE, &g_twVar.info_fps,
		" group=INFO label='Frame rate:' precision=1 ");

	TwAddSeparator(g_bar, "SEP0", 0);

	/*TwAddVarRW(g_bar, "ANIMATION_SPEED", TW_TYPE_FLOAT, &var_ANIMATION_SPEED,
	" group=ANIMATION label='Speed' precision=1 min=0 max=10 step=0.1 ");*/

	TwAddVarRW(g_bar, "GRAVITY", TW_TYPE_FLOAT, &g_twVar.sim_gravity,
		" group=SIMULATION label='Gravity' precision=10 min=-1 max=1 step=0.0001 ");
	
	TwAddVarRW(g_bar, "SIMULATE", TW_TYPE_BOOL8, &g_twVar.sim_enable,
		" group=SIMULATION label='Run simulation' ");

	TwAddButton(g_bar, "SIMULATION_STEP", [](void*) { g_twVar.sim_step = true; }, NULL,
		" group=SIMULATION  label='Step simulation' key=N ");

	TwAddButton(g_bar, "SIMULATION_RESET", [](void*) { g_ball->reset(false); s_model->resetAnimation(); }, NULL,
		" group=SIMULATION  label='Reset' ");

	TwAddSeparator(g_bar, "SEP1", 0);

	TwAddVarRW(g_bar, "BLEND_VERT_STIFF", TW_TYPE_BOOL8, &g_twVar.blend_useWeights,
		" group=BLEND label='Use skin weights' ");
	TwAddVarRW(g_bar, "BLEND_STIFF_MULT", TW_TYPE_FLOAT, &g_twVar.blend_multiplier,
		" group=BLEND label='Multiplier' precision=4 min=0 max=1 step=0.0001 ");

	TwAddVarRW(g_bar, "BLEND_CONST_STIFF", TW_TYPE_FLOAT, &g_twVar.constraint_stiffness,
		" group=BLEND label='Stiffness k' precision=4 min=0 max=1 step=0.0001 ");

	TwAddSeparator(g_bar, "SEP2", 0);

	TwAddVarRW(g_bar, "RENDER_FILL", TW_TYPE_BOOL8, &g_twVar.render_fill,
		" group=RENDER label='Fill' ");
	TwAddVarRW(g_bar, "RENDER_WIREFRAME", TW_TYPE_BOOL8, &g_twVar.render_wireframe,
		" group=RENDER label='Wireframe' ");
	TwAddVarRW(g_bar, "RENDER_DISTMAG", TW_TYPE_BOOL8, &g_twVar.render_distMag,
		" group=RENDER label='Distortion magnitude' ");

	TwAddVarRW(g_bar, "rec_record", TW_TYPE_BOOL8, ffmpegRec(),
		" group=RECORD label='Record' ");

	TwAddSeparator(g_bar, "SEP3", 0);

	TwAddButton(g_bar, "BALL_RESET", [](void*) { g_ball->reset(); }, NULL, " label='Throw ball' ");
	
}
开发者ID:marcushultman,项目名称:interactive-secondary-motion,代码行数:56,代码来源:main.cpp

示例9: TwInit

void AntTweakBarWrapper::Init()
{
	TwInit(TW_OPENGL, NULL);
	m_control_panel_bar = TwNewBar("Control Panel");
	//TwDefine(" 'Control Panel' size='200 210' position='114 10' color='255 255 255' text=dark ");
	char control_bar_pos_string [255];
    sprintf(control_bar_pos_string, "'Control Panel' position='%d 10' color='255 255 0' ", DEFAULT_SCREEN_WIDTH-210);
    TwDefine(control_bar_pos_string);

	TwAddVarRW(m_control_panel_bar, "Start Simulation", TwType(sizeof(bool)), &(g_start_simulation), " label='Start Simulation' key=s group='Debug Information' help='Toggle simulation mode.'");
	TwAddVarRW(m_control_panel_bar, "Render FP", TwType(sizeof(bool)), &(g_show_render), " label='Render FP' key=w group='Debug Information' help='Toggle render display mode.'");
	TwAddVarRW(m_control_panel_bar, "Wireframe", TwType(sizeof(bool)), &(g_show_wireframe), " label='Wireframe mode' key=w group='Debug Information' help='Toggle wireframe display mode.'");
	TwAddVarRW(m_control_panel_bar, "Edge List", TwType(sizeof(bool)), &(g_show_edgelist), " label='Edgelist mode'  group='Debug Information' help='Toggle edgelist display mode.'");
	TwAddVarRW(m_control_panel_bar, "Line Width", TW_TYPE_FLOAT, &(g_linewidth),"label='Line Width' min=0 max=100 step=0.05  help='line width' group='Debug Information'");
	TwAddVarRW(m_control_panel_bar, "Fixed Vertex", TwType(sizeof(bool)), &(g_show_fixedvertex), " label='Fixed Vertex' key=w group='Debug Information' help='Toggle fixed vertex mode.'");
	TwAddVarRW(m_control_panel_bar, "Point Size", TW_TYPE_FLOAT, &(g_pointsize),"label='Point Size' min=0 max=100 step=0.05  help='Point Size' group='Debug Information'");

	TwAddVarRW(m_control_panel_bar, "Zoom", TW_TYPE_FLOAT, &(cameraDistance),"label='Zoom Mode' min=-30 max=30 step=0.1 keyIncr=z keyDecr=Z help='zoom camera' group='Camera'");

	m_sim_bar = TwNewBar("Simulation Control");
	TwDefine("'Simulation Control' position='0 0' color='255 0 0'");

	TwEnumVal shapeEV[NUM_SIMULATION] = { {PositionBasedDynamic, "Position Based Dynamic"}, {MassSpring, "Mass Spring"}, {FiniteElement, "Finite Element"}, {FastMassSpring, "Fast Mass Spring"}, {ProjectiveDynamic, "Projective Dynamic"} };
    TwType simmethod = TwDefineEnum("simmethod", shapeEV, NUM_SIMULATION);
	TwAddVarRW(m_sim_bar, "Simulation Method", simmethod, &g_CurrentMethod, " keyIncr='<' keyDecr='>' help='Change Simulation Method.' ");
}
开发者ID:apapaxiong,项目名称:openglFrame,代码行数:26,代码来源:UI_warpper.cpp

示例10: Position

ModelLightingClass::ModelLightingClass(string barName, bool p_quad, const XMFLOAT3 & postion):Entity(),
	Position(postion), Rotation(0.0f, 0.0f, 0.0f), Scale(1.0f, 1.0f, 1.0f), Quaternion(XMQuaternionIdentity())
{
	m_vertexBuffer = 0;
	m_indexBuffer = 0;
	m_model = 0;


	m_bar = TwNewBar(barName.c_str());

	string define = barName + " iconified=true  alpha=200";
	string group = barName + "/Rotation opened = false";
	TwDefine(define.c_str());

	TwAddVarRW(m_bar, "XRotation", TW_TYPE_FLOAT, &Rotation.x, " step=0.01 group=Rotation");
	TwAddVarRW(m_bar, "YRotation", TW_TYPE_FLOAT, &Rotation.y, " step=0.01 group=Rotation");
	TwAddVarRW(m_bar, "ZRotation", TW_TYPE_FLOAT, &Rotation.z, "min=0 max=6.28 step=0.01 group=Rotation");
	TwDefine(group.c_str());

	TwAddVarRW(m_bar, "XPosition", TW_TYPE_FLOAT, &Position.x, "  step=0.1 group=Position");
	TwAddVarRW(m_bar, "YPosition", TW_TYPE_FLOAT, &Position.y, "  step=0.1 group=Position");
	TwAddVarRW(m_bar, "ZPosition", TW_TYPE_FLOAT, &Position.z, "  step=0.1 group=Position");
	group = barName + "/Position opened = false";
	TwDefine(group.c_str());

	TwAddVarRW(m_bar, "XScale", TW_TYPE_FLOAT, &Scale.x, "  step=0.01 group=Scale");
	TwAddVarRW(m_bar, "YScale", TW_TYPE_FLOAT, &Scale.y, "  step=0.01 group=Scale");
	TwAddVarRW(m_bar, "ZScale", TW_TYPE_FLOAT, &Scale.z, "  step=0.01 group=Scale");
	group = barName + "/Scale opened = false";
	TwDefine(group.c_str());
}
开发者ID:VincentHui,项目名称:Genisis,代码行数:31,代码来源:ModelLightingClass.cpp

示例11: initGUI

void initGUI() {
    // Initialize AntTweakBar GUI
    if (!TwInit(TW_OPENGL, NULL))
    {
        assert(0);
    }

    TwWindowSize(g_WindowWidth, g_WindowHeight);
    TwBar *controlBar = TwNewBar("Controls");
    TwDefine(" Controls position='10 10' size='200 320' refresh=0.1 ");

    TwAddVarCB(controlBar, "use_shaders", TW_TYPE_BOOLCPP, cbSetShaderStatus, cbGetShaderStatus, NULL, " label='shaders' key=s help='Turn programmable pipeline on/off.' ");

    // Shader panel setup
    TwAddVarRW(controlBar, "vs", TW_TYPE_BOOLCPP, &g_UseVertexShader, " group='Shaders' label='vertex' key=v help='Toggle vertex shader.' ");
    TwAddVarRW(controlBar, "gs", TW_TYPE_BOOLCPP, &g_UseGeometryShader, " group='Shaders' label='geometry' key=g help='Toggle geometry shader.' ");
    TwAddVarRW(controlBar, "fs", TW_TYPE_BOOLCPP, &g_UseFragmentShader, " group='Shaders' label='fragment' key=f help='Toggle fragment shader.' ");
    TwAddButton(controlBar, "build", cbCompileShaderProgram, NULL, " group='Shaders' label='build' key=b help='Build shader program.' ");
	//TwDefine( " Controls/Shaders readonly=true "); 

    // Render panel setup
    TwAddVarRW(controlBar, "wiremode", TW_TYPE_BOOLCPP, &g_WireMode, " group='Render' label='wire mode' key=w help='Toggle wire mode.' ");
    TwAddVarRW(controlBar, "face_culling", TW_TYPE_BOOLCPP, &g_FaceCulling, " group=Render label='face culling' key=c help='Toggle face culling.' ");

    // Scene panel setup
    TwEnumVal geometry_type[] = { 
        { ELEPHANT_GEOMETRY    , "Elephant"},
        { CUBE_GEOMETRY        , "Cube"    },
    };
    TwType geom_type = TwDefineEnum("Model", geometry_type, NUM_GEOMETRY_TYPES);
    TwAddVarRW(controlBar, "model", geom_type, &g_GeometryType, " group='Scene' keyIncr=Space help='Change model.' ");
    TwAddVarRW(controlBar, "auto-rotation", TW_TYPE_BOOLCPP, &g_SceneRotEnabled, " group='Scene' label='rotation' key=r help='Toggle scene rotation.' ");
    TwAddVarRW(controlBar, "Translate", TW_TYPE_FLOAT, &g_SceneTraZ, " group='Scene' label='translate' min=1 max=1000 step=0.5 keyIncr=t keyDecr=T help='Scene translation.' ");
    TwAddVarRW(controlBar, "SceneRotation", TW_TYPE_QUAT4F, &g_SceneRot, " group='Scene' label='rotation' open help='Toggle scene orientation.' ");
}
开发者ID:Bublafus,项目名称:NPR-techniques,代码行数:35,代码来源:AntTweakConfiguration.cpp

示例12: TwNewBar

void BipartiteBoxPruningTest::Select()
{
	// Create a tweak bar
#ifdef USE_ANTTWEAKBAR
	{
		mBar = TwNewBar("BipartiteBoxPruning");
		TwAddVarRW(mBar, "Speed", TW_TYPE_FLOAT, &mSpeed, " min=0.0 max=0.01 step=0.00001");
		TwAddVarRW(mBar, "Amplitude", TW_TYPE_FLOAT, &mAmplitude, " min=10.0 max=200.0 step=0.1");
	}
#endif //USE_ANTTWEAKBAR
}
开发者ID:Kelloggs,项目名称:experiments,代码行数:11,代码来源:BipartiteBoxPruning.cpp

示例13: initializeTwGUI

 void initializeTwGUI()
 {
     TwDefine(" OSGDemo size='240 400' color='96 216 224' ");
     
     TwAddVarRW( g_twBar, "ModelName", TW_TYPE_CSSTRING(sizeof(g_fileName)), g_fileName, " label='Model name' " );
     TwAddButton( g_twBar, "LoadButton", TwGUIManager::loadModelFunc, this, " label='Load model from file' " );
     TwAddSeparator( g_twBar, NULL, NULL );
     TwAddVarRW( g_twBar, "PosX", TW_TYPE_FLOAT, &(position[0]), " step=0.1 " );
     TwAddVarRW( g_twBar, "PosY", TW_TYPE_FLOAT, &(position[1]), " step=0.1 " );
     TwAddVarRW( g_twBar, "PosZ", TW_TYPE_FLOAT, &(position[2]), " step=0.1 " );
     TwAddVarRW( g_twBar, "Rotation", TW_TYPE_QUAT4F, &(rotation[0]), NULL );
 }
开发者ID:killlu79,项目名称:osgRecipes,代码行数:12,代码来源:osganttweakbar.cpp

示例14: TwNewBar

TwBar *CreateTweakBar()
{
    TwBar *bar;

    // Create a tweak bar
    bar = TwNewBar("TweakBar");
    TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar with SDL and OpenGL Core Profile.\n' "); // Message added to the help bar.

    // Add variables
    TwAddVarRW(bar, "Rotation", TW_TYPE_QUAT4F, &quat, " opened=true help='Rectangle rotation' ");
    TwAddVarRW(bar, "Color", TW_TYPE_COLOR3F, &color, " opened=true help='Rectangle color' ");

    return bar;
}
开发者ID:halfspiral,项目名称:AntTweakBar,代码行数:14,代码来源:TwGLCoreSDL.cpp

示例15: TwGetBarName

bool OGLSimpleLighting::InitGUI()
{
    auto tweakBar = atbApp->GetBarByIndex(0);
    auto barName = TwGetBarName(tweakBar);
    std::stringstream format;
    format << barName << " " << " label='Lighting Example' ";
    
	TwAddVarRW(tweakBar, "lightDir", TW_TYPE_DIR3F, &light.direction, "label='Direction' group='Light'");
	TwAddVarRW(tweakBar, "lightSpec", TW_TYPE_COLOR3F, &light.specularColor, "label='Specular Intensity' group='Light'");
	TwAddVarRW(tweakBar, "lightDiff", TW_TYPE_COLOR3F, &light.diffuseColor, "label='Diffuse Intensity' group='Light'");
    TwDefine(format.str().c_str());
    
    return true;
}
开发者ID:Coeurou,项目名称:OGL_Perigrination,代码行数:14,代码来源:OGLSimpleLighting.cpp


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