예제 #1
0
void YMainGimbalMode::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 4*3;
	static const DWORD NIDX = 6*3;
	static const NTVERTEX VTX[NVTX] = {
		{ 9,166,0,  0,0,0,  1029/texw, (texh-584)/texh},
		{19,166,0,  0,0,0,  1039/texw, (texh-584)/texh},
		{ 9,176,0,  0,0,0,  1029/texw, (texh-574)/texh},
		{19,176,0,  0,0,0,  1039/texw, (texh-574)/texh},
		{ 9,183,0,  0,0,0,  1029/texw, (texh-584)/texh},
		{19,183,0,  0,0,0,  1039/texw, (texh-584)/texh},
		{ 9,193,0,  0,0,0,  1029/texw, (texh-574)/texh},
		{19,193,0,  0,0,0,  1039/texw, (texh-574)/texh},
		{ 9,200,0,  0,0,0,  1029/texw, (texh-584)/texh},
		{19,200,0,  0,0,0,  1039/texw, (texh-584)/texh},
		{ 9,210,0,  0,0,0,  1029/texw, (texh-574)/texh},
		{19,210,0,  0,0,0,  1039/texw, (texh-574)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1,
		4,5,6, 7,6,5,
		8,9,10, 11,10,9
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #2
0
void HUDButton::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 4*3;
	static const DWORD NIDX = 6*3;
	static const NTVERTEX VTX[NVTX] = {
		// Orbit mode indicator
		{bb_x0,      bb_y0,      0,  0,0,0,  tx_x0/texw,        tx_y0/texh},
		{bb_x0+tx_dx,bb_y0,      0,  0,0,0,  (tx_x0+tx_dx)/texw,tx_y0/texh},
		{bb_x0,      bb_y0+tx_dy,0,  0,0,0,  tx_x0/texw,        (tx_y0+tx_dy)/texh},
		{bb_x0+tx_dx,bb_y0+tx_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw,(tx_y0+tx_dy)/texh},
		// Surface mode indicator
		{bb_x1,      bb_y0,      0,  0,0,0,  tx_x0/texw,        tx_y0/texh},
		{bb_x1+tx_dx,bb_y0,      0,  0,0,0,  (tx_x0+tx_dx)/texw,tx_y0/texh},
		{bb_x1,      bb_y0+tx_dy,0,  0,0,0,  tx_x0/texw,        (tx_y0+tx_dy)/texh},
		{bb_x1+tx_dx,bb_y0+tx_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw,(tx_y0+tx_dy)/texh},
		// Docking mode indicator
		{bb_x2,      bb_y0,      0,  0,0,0,  tx_x0/texw,        tx_y0/texh},
		{bb_x2+tx_dx,bb_y0,      0,  0,0,0,  (tx_x0+tx_dx)/texw,tx_y0/texh},
		{bb_x2,      bb_y0+tx_dy,0,  0,0,0,  tx_x0/texw,        (tx_y0+tx_dy)/texh},
		{bb_x2+tx_dx,bb_y0+tx_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw,(tx_y0+tx_dy)/texh}
	};
	static const WORD IDX[NIDX] = {
		// Orbit mode indicator
		0,1,2, 3,2,1,
		// Surface mode indicator
		4,5,6, 7,6,5,
		// Docking mode indicator
		8,9,10, 11,10,9
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
void DynamicGroupLevel2048Node::InitGeodes()
{
	//инициализировать геометрию патчей земной поверхности

	for ( int i = 0 ; i < m_vData.size() ; ++i )
	{
		//добавить узел геометрии
		m_vData[ i ].m_Geode = new osg::Geode;

		//добавить uniform
		m_vData[ i ].m_unfOffset = new osg::Uniform( m_vData[ i ].m_sOffset.c_str() , osg::Vec3( 0,0,0) );
		m_vData[ i ].m_unfColorP = new osg::Uniform( m_vData[ i ].m_sColorP.c_str() , osg::Vec3( 0,1,0 ) );
		m_vData[ i ].m_unfColorS = new osg::Uniform( m_vData[ i ].m_sColorS.c_str() , osg::Vec3( 1,0,0 ) );
		m_vData[ i ].m_unfKofScale = new osg::Uniform( m_vData[ i ].m_sKofScale.c_str() , 32.0f );
		m_vData[ i ].m_unfDist = new osg::Uniform( m_vData[ i ].m_sDist.c_str() , 2048.0f * DIST_SCALE );
		m_vData[ i ].m_unfTexCoordAdd = new osg::Uniform( m_vData[ i ].m_sTexCoordAdd.c_str() , 2.0f );
		m_vData[ i ].m_unfTexCoordScale = new osg::Uniform( m_vData[ i ].m_sTexCoordScale.c_str() , 64.0f );

		//добавить геометрию в i'ый узел
		AddGeometry( i );

		//настроить параметры необходимые в шейдере
		SetupShaderParam( i );

		m_rootNode->addChild( m_vData[ i ].m_Geode.get() );
	}
}
예제 #4
0
void MWSButton::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 4;
	static const DWORD NIDX = 6;
	static const NTVERTEX VTX[NVTX] = {
		{bb_x0,      bb_y0,      0,  0,0,0,  tx_x0/texw,         tx_y0/texh},
		{bb_x0+tx_dx,bb_y0,      0,  0,0,0,  (tx_x0+tx_dx)/texw, tx_y0/texh},
		{bb_x0,      bb_y0+tx_dy,0,  0,0,0,  tx_x0/texw,         tx_y0/texh},
		{bb_x0+tx_dx,bb_y0+tx_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw, tx_y0/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1
	};
	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #5
0
void ScramGimbalCntr::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 4;
	static const DWORD NIDX = 6;
	static const NTVERTEX VTX[NVTX] = {
		{58,469,0,  0,0,0,  1029/texw, (texh-584)/texh},
		{68,469,0,  0,0,0,  1039/texw, (texh-584)/texh},
		{58,479,0,  0,0,0,  1029/texw, (texh-574)/texh},
		{68,479,0,  0,0,0,  1039/texw, (texh-574)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1
	};
	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #6
0
void HoverBalanceCtrl::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 4;
	static const DWORD NIDX = 6;
	static const NTVERTEX VTX[NVTX] = {
		{64,305,0,  0,0,0,  1054/texw, (texh-616)/texh},
		{78,305,0,  0,0,0,  1068/texw, (texh-616)/texh},
		{64,347,0,  0,0,0,  1054/texw, (texh-574)/texh},
		{78,347,0,  0,0,0,  1068/texw, (texh-574)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1
	};
	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #7
0
void InstrVS::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	const DWORD texw = PANEL2D_TEXW, texh = PANEL2D_TEXH;
	const float tapex0 = 1850.5f, tapew = 41.0f;
	const float tapey0 = (float)(texh-764), tapeh = 512.0f;
	const float xcnt = 682.0f, ycnt = 311.0f;

	const DWORD NVTX = 24;
	const DWORD NIDX = 36;
	static NTVERTEX VTX[NVTX] = {
		// VS tape
		{xcnt-22,ycnt-59,0,  0,0,0,  tapex0/(float)texw,        tapey0/(float)texh},
		{xcnt+22,ycnt-59,0,  0,0,0,  (tapex0+tapew)/(float)texw,tapey0/(float)texh},
		{xcnt-22,ycnt+59,0,  0,0,0,  tapex0/(float)texw,        (tapey0+tapeh)/(float)texh},
		{xcnt+22,ycnt+59,0,  0,0,0,  (tapex0+tapew)/(float)texw,(tapey0+tapeh)/(float)texh},
		// VS readout
		{xcnt+ 6.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+13.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+ 6.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+13.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+13.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+20.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+13.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+20.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+20.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+27.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+20.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+27.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+27.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+34.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+27.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+34.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+34.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+41.0f,ycnt-7.0f,0,  0,0,0,  0, 0},
		{xcnt+34.0f,ycnt+7.0f,0,  0,0,0,  0, 0},
		{xcnt+41.0f,ycnt+7.0f,0,  0,0,0,  0, 0}
	};
	static WORD IDX[NIDX] = {
		0,1,2, 3,2,1,
		4,5,6, 7,6,5,
		8,9,10, 11,10,9,
		12,13,14, 15,14,13,
		16,17,18, 19,18,17,
		20,21,22, 23,22,21,
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #8
0
void HoverBalanceDisp::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 4;
	static const DWORD NIDX = 6;
	static const NTVERTEX VTX[NVTX] = {
		{27,  327.5f-3,0,  0,0,0,  tx_x0/texw, tx_y0/texh},
		{27+7,327.5f-3,0,  0,0,0,  (tx_x0+tx_dx)/texw, tx_y0/texh},
		{27,  327.5f+3,0,  0,0,0,  tx_x0/texw, (tx_y0+tx_dy)/texh},
		{27+7,327.5f+3,0,  0,0,0,  (tx_x0+tx_dx)/texw, (tx_y0+tx_dy)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #9
0
파일: InstrVs.cpp 프로젝트: Artoria2e5/obtr
void InstrSpd::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	const DWORD texw = PANELEL_TEXW, texh = PANELEL_TEXH;
	const float tapex0 = 68.0f, tapew = 32.0f;
	const float tapey0 = (float)(texh-422), tapeh = 333.0f;

	const DWORD NVTX = 22;
	const DWORD NIDX = 30;

	static NTVERTEX VTX[NVTX] = {
		// Spd tape
		{stape_xcnt-16,stape_ycnt-48,0,  0,0,0,  tapex0/(float)texw,        0},
		{stape_xcnt+16,stape_ycnt-48,0,  0,0,0,  (tapex0+tapew)/(float)texw,0},
		{stape_xcnt-16,stape_ycnt+48,0,  0,0,0,  tapex0/(float)texw,        0},
		{stape_xcnt+16,stape_ycnt+48,0,  0,0,0,  (tapex0+tapew)/(float)texw,0},
		// Spd*1000 readouts
		{stape_xcnt-39,stape_ycnt-7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{stape_xcnt-31,stape_ycnt-7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		{stape_xcnt-39,stape_ycnt+7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{stape_xcnt-31,stape_ycnt+7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		{stape_xcnt-31,stape_ycnt-7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{stape_xcnt-23,stape_ycnt-7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		{stape_xcnt-31,stape_ycnt+7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{stape_xcnt-23,stape_ycnt+7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		{stape_xcnt-23,stape_ycnt-7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{stape_xcnt-15,stape_ycnt-7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		{stape_xcnt-23,stape_ycnt+7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{stape_xcnt-15,stape_ycnt+7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		// apoapsis/periapsis velocity bugs
		{stape_xcnt+16,stape_ycnt   ,0,  0,0,0,  77.5f/(float)texw, (float)(texh-13.5f)/(float)texh},
		{stape_xcnt+ 5,stape_ycnt   ,0,  0,0,0,  65.0f/(float)texw, (float)(texh-13.5f)/(float)texh},
		{stape_xcnt+16,stape_ycnt-11,0,  0,0,0,  77.5f/(float)texw, (float)(texh-26)/(float)texh},
		{stape_xcnt+16,stape_ycnt   ,0,  0,0,0,  77.5f/(float)texw, (float)(texh-12.5f)/(float)texh},
		{stape_xcnt+ 5,stape_ycnt   ,0,  0,0,0,  65.0f/(float)texw, (float)(texh-12.5f)/(float)texh},
		{stape_xcnt+16,stape_ycnt+11,0,  0,0,0,  77.5f/(float)texw, (float)(texh)/(float)texh}
	};
	static WORD IDX[NIDX] = {
		0,1,2, 3,2,1,
		4,5,6, 7,6,5,
		8,9,10, 11,10,9,
		12,13,14, 15,14,13,
		16,17,18,  19,21,20
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #10
0
void ThrottleHover::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 4;
	static const DWORD NIDX = 6;
	static const NTVERTEX VTX[NVTX] = {
		// hover slider
		{bb_x0,      bb_y0,      0,  0,0,0,  tx_x0/texw,        tx_y0/texh},
		{bb_x0+bb_dx,bb_y0,      0,  0,0,0,  (tx_x0+tx_dx)/texw,tx_y0/texh},
		{bb_x0,      bb_y0+tx_dy,0,  0,0,0,  tx_x0/texw,        (tx_y0+tx_dy)/texh},
		{bb_x0+bb_dx,bb_y0+tx_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw,(tx_y0+tx_dy)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #11
0
void PMainGimbalCtrl::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 8;
	static const DWORD NIDX = 12;
	static const NTVERTEX VTX[NVTX] = {
		{64, 83,0,  0,0,0,  1054/texw, (texh-616)/texh},
		{78, 83,0,  0,0,0,  1068/texw, (texh-616)/texh},
		{64,125,0,  0,0,0,  1054/texw, (texh-574)/texh},
		{78,125,0,  0,0,0,  1068/texw, (texh-574)/texh},
		{83, 83,0,  0,0,0,  1054/texw, (texh-616)/texh},
		{97, 83,0,  0,0,0,  1068/texw, (texh-616)/texh},
		{83,125,0,  0,0,0,  1054/texw, (texh-574)/texh},
		{97,125,0,  0,0,0,  1068/texw, (texh-574)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1,
		4,5,6, 7,6,5
	};
	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #12
0
void ScramGimbalDisp::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 8;
	static const DWORD NIDX = 12;
	static const NTVERTEX VTX[NVTX] = {
		{pm_x0,      sc_y0-bb_dy,0,  0,0,0,  tx_x0/texw, tx_y0/texh},
		{pm_x0+bb_dx,sc_y0-bb_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw, tx_y0/texh},
		{pm_x0,      sc_y0+bb_dy,0,  0,0,0,  tx_x0/texw, (tx_y0+tx_dy)/texh},
		{pm_x0+bb_dx,sc_y0+bb_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw, (tx_y0+tx_dy)/texh},
		{pm_x0+2.0f*bb_dx+1.0f,sc_y0-bb_dy,0,  0,0,0,  tx_x0/texw, tx_y0/texh},
		{pm_x0+bb_dx+1.0f,sc_y0-bb_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw, tx_y0/texh},
		{pm_x0+2.0f*bb_dx+1.0f,sc_y0+bb_dy,0,  0,0,0,  tx_x0/texw, (tx_y0+tx_dy)/texh},
		{pm_x0+bb_dx+1.0f,sc_y0+bb_dy,0,  0,0,0,  (tx_x0+tx_dx)/texw, (tx_y0+tx_dy)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1,
		4,6,5, 7,5,6
	};
	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #13
0
파일: InstrVs.cpp 프로젝트: Artoria2e5/obtr
void InstrVS::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	const DWORD texw = PANELEL_TEXW, texh = PANELEL_TEXH;
	const float tapex0 = 0.0f, tapew = 32.0f;
	const float tapey0 = (float)(texh-422), tapeh = 333.0f;

	const DWORD NVTX = 18;
	const DWORD NIDX = 24;

	static NTVERTEX VTX[NVTX] = {
		// VS tape
		{vtape_xcnt-16,vtape_ycnt-48,0,  0,0,0,  tapex0/(float)texw,        tapey0/(float)texh},
		{vtape_xcnt+16,vtape_ycnt-48,0,  0,0,0,  (tapex0+tapew)/(float)texw,tapey0/(float)texh},
		{vtape_xcnt-16,vtape_ycnt+48,0,  0,0,0,  tapex0/(float)texw,        (tapey0+tapeh)/(float)texh},
		{vtape_xcnt+16,vtape_ycnt+48,0,  0,0,0,  (tapex0+tapew)/(float)texw,(tapey0+tapeh)/(float)texh},
		// VS*1000 readouts
		{vtape_xcnt-31,vtape_ycnt-7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{vtape_xcnt-23,vtape_ycnt-7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		{vtape_xcnt-31,vtape_ycnt+7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{vtape_xcnt-23,vtape_ycnt+7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		{vtape_xcnt-23,vtape_ycnt-7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{vtape_xcnt-15,vtape_ycnt-7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		{vtape_xcnt-23,vtape_ycnt+7,0, 0,0,0,  (float)wheel_srcx/(float)texw, 0},
		{vtape_xcnt-15,vtape_ycnt+7,0, 0,0,0,  (float)(wheel_srcx+10)/(float)texw, 0},
		// max vspeed bugs
		{vtape_xcnt+16,vtape_ycnt   ,0,  0,0,0,  77.5f/(float)texw, (float)(texh-13.5f)/(float)texh},
		{vtape_xcnt+ 5,vtape_ycnt   ,0,  0,0,0,  65.0f/(float)texw, (float)(texh-13.5f)/(float)texh},
		{vtape_xcnt+16,vtape_ycnt-11,0,  0,0,0,  77.5f/(float)texw, (float)(texh-26)/(float)texh},
		{vtape_xcnt+16,vtape_ycnt   ,0,  0,0,0,  77.5f/(float)texw, (float)(texh-12.5f)/(float)texh},
		{vtape_xcnt+ 5,vtape_ycnt   ,0,  0,0,0,  65.0f/(float)texw, (float)(texh-12.5f)/(float)texh},
		{vtape_xcnt+16,vtape_ycnt+11,0,  0,0,0,  77.5f/(float)texw, (float)(texh)/(float)texh}
	};
	static WORD IDX[NIDX] = {
		0,1,2, 3,2,1,
		4,5,6, 7,6,5,
		8,9,10, 11,10,9,
		12,13,14,  15,17,16
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #14
0
void YMainGimbalDisp::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 8;
	static const DWORD NIDX = 12;
	static const NTVERTEX VTX[NVTX] = {
		{59.5f-3.0f,239.0f,0,  0,0,0,  1147.5f/texw, (texh-608.5f)/texh},
		{59.5f+3.0f,239.0f,0,  0,0,0,  1147.5f/texw, (texh-614.5f)/texh},
		{59.5f-3.0f,246.0f,0,  0,0,0,  1154.5f/texw, (texh-608.5f)/texh},
		{59.5f+3.0f,246.0f,0,  0,0,0,  1154.5f/texw, (texh-614.5f)/texh},
		{59.5f-3.0f,254.0f,0,  0,0,0,  1147.5f/texw, (texh-608.5f)/texh},
		{59.5f+3.0f,254.0f,0,  0,0,0,  1147.5f/texw, (texh-614.5f)/texh},
		{59.5f-3.0f,247.0f,0,  0,0,0,  1154.5f/texw, (texh-608.5f)/texh},
		{59.5f+3.0f,247.0f,0,  0,0,0,  1154.5f/texw, (texh-614.5f)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1,
		4,6,5, 7,5,6
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #15
0
void YMainGimbalCtrl::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	static const DWORD NVTX = 8;
	static const DWORD NIDX = 12;
	static const NTVERTEX VTX[NVTX] = {
		{56,179,0,  0,0,0,  1054/texw, (texh-574)/texh},
		{98,179,0,  0,0,0,  1054/texw, (texh-616)/texh},
		{56,193,0,  0,0,0,  1068/texw, (texh-574)/texh},
		{98,193,0,  0,0,0,  1068/texw, (texh-616)/texh},
		{56,198,0,  0,0,0,  1054/texw, (texh-574)/texh},
		{98,198,0,  0,0,0,  1054/texw, (texh-616)/texh},
		{56,212,0,  0,0,0,  1068/texw, (texh-574)/texh},
		{98,212,0,  0,0,0,  1068/texw, (texh-616)/texh}
	};
	static const WORD IDX[NIDX] = {
		0,1,2, 3,2,1,
		4,5,6, 7,6,5
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #16
0
파일: InstrVs.cpp 프로젝트: Artoria2e5/obtr
void InstrVAcc::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	const DWORD texw = PANELEL_TEXW, texh = PANELEL_TEXH;
	const float tapex0 = 0.0f, tapew = 32.0f;
	const float tapey0 = (float)(texh-422), tapeh = 333.0f;

	const DWORD NVTX = 3;
	const DWORD NIDX = 3;

	static NTVERTEX VTX[NVTX] = {
		// VAcc needle
		{vtape_xcnt+24,vtape_ycnt  ,0,  0,0,0,  66.5f/(float)texw, (texh-6.5f)/(float)texh},
		{vtape_xcnt+31,vtape_ycnt-6,0,  0,0,0,  71.5f/(float)texw, (texh-1.0f)/(float)texh},
		{vtape_xcnt+31,vtape_ycnt+6,0,  0,0,0,  61.5f/(float)texw, (texh-1.0f)/(float)texh},
	};
	static WORD IDX[NIDX] = {
		0,1,2
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #17
0
void AirlockSwitch::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
    const DWORD NVTX = 4*nbutton;
    const DWORD NIDX = 6*nbutton;
    const WORD IDX_TPL[6] = {0,1,2,3,2,1};
    NTVERTEX VTX[NVTX];
    WORD IDX[NIDX];

    DWORD i, j;
    memset (VTX, 0, NVTX*sizeof(NTVERTEX));
    for (i = 0; i < nbutton; i++) {
        for (j = 0; j < 4; j++) {
            VTX[i*4+j].x = bb_x0 + i*bb_dx + (j%2)*tx_dx;
            VTX[i*4+j].y = bb_y0 + (j/2)*tx_dy;
            VTX[i*4+j].tu = (tx_x0 + ((j+1)%2)*tx_dx)/texw;
            VTX[i*4+j].tv = (tx_y0 + (j/2)*tx_dy)/texh;
        }
        for (j = 0; j < 6; j++)
            IDX[i*6+j] = (WORD)(i*4)+IDX_TPL[j];
    }
    AddGeometry(hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #18
0
// AddEffective --
void V4SceneManager::AddEffective(GF_Node * node) {

  // gets the node type (equals pool number)
  u32 poolN = pools.poolN(gf_node_get_tag(node));

  // adds the node using a type specific function
  switch (poolN) {
    case DICT_GEN: {
      AddGen(node);
      break;
    }

    case DICT_GEOMETRY: {
      AddGeometry(node);
      break;
    }

    case DICT_APPEARANCE: {
      AddAppearance(node);
      break;
    }

    case DICT_TEXTURE: {
      AddTexture(node);
      break;
    }

    case DICT_MATERIAL: {
      AddMaterial(node);
      break;
    }

    // TODO : raise an exception when not found
  }

}
예제 #19
0
bool AnimaNode::ReadObject(const ptree& objectTree, AnimaScene* scene, bool readName)
{
	try
	{
		if (readName)
			SetName(objectTree.get<AnimaString>("AnimaNode.Name"));

		_materialName = objectTree.get<AnimaString>("AnimaNode.Material", "");
		_animationNodeName = objectTree.get<AnimaString>("AnimaNode.AnimationNodeName", "");
		SetIsAsset(objectTree.get<bool>("AnimaNode.IsAsset", false));

		if (!_materialName.empty())
			_material = scene->GetMaterialsManager()->GetMaterialFromName(_materialName);
		
		for (auto& geometryData : objectTree.get_child("AnimaNode.Geometries"))
		{
			if (geometryData.first == "Geometry")
			{
				AnimaString geometryName = geometryData.second.get_value<AnimaString>("");
				if (geometryName.empty())
					AnimaLogger::LogMessageFormat("WARNING - Error reading a node called '%s': found a geometry without name", GetName().c_str());
				else
				{
					AnimaGeometry* geometry = scene->GetGeometriesManager()->GetGeometryFromName(geometryName);
					if (geometry == nullptr)
						AnimaLogger::LogMessageFormat("WARNING - Error reading a node called '%s': node has a geometry named '%s' bot the geometry doesn't exists", GetName().c_str(), geometryName.c_str());
					else
						AddGeometry(geometry);
				}
			}
		}

		for (auto& boneInfoData : objectTree.get_child("AnimaNode.GeometriesBonesInfo"))
		{
			if (boneInfoData.first == "BoneInfo")
			{
				AnimaString geometryBoneInfoName = boneInfoData.second.get<AnimaString>("AnimaGeometryBoneInfo.Name", "");
				if (geometryBoneInfoName.empty())
					AnimaLogger::LogMessageFormat("WARNING - Error reading a node called '%s': found a geometry bone data without name", GetName().c_str());
				else
				{
					AnimaGeometryBoneInfo* geometryBoneInfo = AnimaAllocatorNamespace::AllocateNew<AnimaGeometryBoneInfo>(*_allocator, geometryBoneInfoName, _allocator);
					if (geometryBoneInfo->ReadObject(boneInfoData.second, scene, false))
						_geometriesBonesInfo.Add(geometryBoneInfoName, geometryBoneInfo);
				}
			}
		}

		for (auto& animationData : objectTree.get_child("AnimaNode.Animations"))
		{
			if (animationData.first == "Animation")
			{
				AnimaString animationName = animationData.second.get_value<AnimaString>("");
				if (animationName.empty())
					AnimaLogger::LogMessageFormat("WARNING - Error reading a node called '%s': found an animation without name", GetName().c_str());
				else
				{
					AnimaAnimation* animation = scene->GetAnimationsManager()->GetAnimationFromName(animationName);
					if (animation == nullptr)
						AnimaLogger::LogMessageFormat("WARNING - Error reading a node called '%s': node has an animation named '%s' bot the animation doesn't exists", GetName().c_str(), animationName.c_str());
					else
						AddAnimation(animation);
				}
			}
		}

		ptree sceneObjectTree = objectTree.get_child("AnimaNode.SceneObject");
		if (AnimaSceneObject::ReadObject(sceneObjectTree, scene, false))
		{
			SetPosition(GetPosition());
			return true;
		}

		return false;
	}
	catch (boost::property_tree::ptree_bad_path& exception)
	{
		AnimaLogger::LogMessageFormat("ERROR - Error parsing node: %s", exception.what());
		return false;
	}
	catch (boost::property_tree::ptree_bad_data& exception)
	{
		AnimaLogger::LogMessageFormat("ERROR - Error parsing geometry: %s", exception.what());
		return false;
	}
}
예제 #20
0
파일: adictrl.cpp 프로젝트: Artoria2e5/obtr
void ADICtrl::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx, DWORD grpidx_disp)
{
	// Controls
	const float bb_x0 = bb_dl_x0+10.0f;
	const float bb_dx =  20.0f;
	const float bb_y0 = bb_dl_y0+39.0f;
	const float bb_tgt_x0 = bb_x0-46.0f;
	const float bb_mde_x0 = bb_x0+80.0f;
	const DWORD nvtx = 4*7;
	const DWORD nidx = 6*7;
	const NTVERTEX vtx[nvtx] = {
		// frame dial
		{bb_dl_x0-bb_dl_dx2,bb_dl_y0-bb_dl_dy2,0,  0,0,0,  tx_x0/texw,        tx_y0/texh        },
		{bb_dl_x0+bb_dl_dx2,bb_dl_y0-bb_dl_dy2,0,  0,0,0,  (tx_x0+tx_dx)/texw,tx_y0/texh        },
		{bb_dl_x0-bb_dl_dx2,bb_dl_y0+bb_dl_dy2,0,  0,0,0,  tx_x0/texw,        (tx_y0+tx_dy)/texh},
		{bb_dl_x0+bb_dl_dx2,bb_dl_y0+bb_dl_dy2,0,  0,0,0,  (tx_x0+tx_dx)/texw,(tx_y0+tx_dy)/texh},
		// target dial
		{bb_dl_x0+bb_dl_dx-bb_dl_dx2,bb_dl_y0-bb_dl_dy2,0,  0,0,0,  tx_x0/texw,        tx_y0/texh        },
		{bb_dl_x0+bb_dl_dx+bb_dl_dx2,bb_dl_y0-bb_dl_dy2,0,  0,0,0,  (tx_x0+tx_dx)/texw,tx_y0/texh        },
		{bb_dl_x0+bb_dl_dx-bb_dl_dx2,bb_dl_y0+bb_dl_dy2,0,  0,0,0,  tx_x0/texw,        (tx_y0+tx_dy)/texh},
		{bb_dl_x0+bb_dl_dx+bb_dl_dx2,bb_dl_y0+bb_dl_dy2,0,  0,0,0,  (tx_x0+tx_dx)/texw,(tx_y0+tx_dy)/texh},
		// roll switch
		{bb_x0,         bb_y0,         0,  0,0,0,  tx_x0_bt/texw,           tx_y0_bt/texh           },
		{bb_x0+tx_dx_bt,bb_y0,         0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,tx_y0_bt/texh           },
		{bb_x0,         bb_y0+tx_dy_bt,0,  0,0,0,  tx_x0_bt/texw,           (tx_y0_bt+tx_dy_bt)/texh},
		{bb_x0+tx_dx_bt,bb_y0+tx_dy_bt,0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,(tx_y0_bt+tx_dy_bt)/texh},
		// pitch switch
		{bb_x0+bb_dx,         bb_y0,         0,  0,0,0,  tx_x0_bt/texw,           tx_y0_bt/texh           },
		{bb_x0+bb_dx+tx_dx_bt,bb_y0,         0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,tx_y0_bt/texh           },
		{bb_x0+bb_dx,         bb_y0+tx_dy_bt,0,  0,0,0,  tx_x0_bt/texw,           (tx_y0_bt+tx_dy_bt)/texh},
		{bb_x0+bb_dx+tx_dx_bt,bb_y0+tx_dy_bt,0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,(tx_y0_bt+tx_dy_bt)/texh},
		// yaw switch
		{bb_x0+2.0f*bb_dx,         bb_y0,         0,  0,0,0,  tx_x0_bt/texw,           tx_y0_bt/texh           },
		{bb_x0+2.0f*bb_dx+tx_dx_bt,bb_y0,         0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,tx_y0_bt/texh           },
		{bb_x0+2.0f*bb_dx,         bb_y0+tx_dy_bt,0,  0,0,0,  tx_x0_bt/texw,           (tx_y0_bt+tx_dy_bt)/texh},
		{bb_x0+2.0f*bb_dx+tx_dx_bt,bb_y0+tx_dy_bt,0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,(tx_y0_bt+tx_dy_bt)/texh},
		// ref/tgt selector
		{bb_tgt_x0,         bb_y0,         0,  0,0,0,  tx_x0_bt/texw,           tx_y0_bt/texh           },
		{bb_tgt_x0+tx_dx_bt,bb_y0,         0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,tx_y0_bt/texh           },
		{bb_tgt_x0,         bb_y0+tx_dy_bt,0,  0,0,0,  tx_x0_bt/texw,           (tx_y0_bt+tx_dy_bt)/texh},
		{bb_tgt_x0+tx_dx_bt,bb_y0+tx_dy_bt,0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,(tx_y0_bt+tx_dy_bt)/texh},
		// needle/rate reference mode
		{bb_mde_x0,         bb_y0,         0,  0,0,0,  tx_x0_bt/texw,           tx_y0_bt/texh           },
		{bb_mde_x0+tx_dx_bt,bb_y0,         0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,tx_y0_bt/texh           },
		{bb_mde_x0,         bb_y0+tx_dy_bt,0,  0,0,0,  tx_x0_bt/texw,           (tx_y0_bt+tx_dy_bt)/texh},
		{bb_mde_x0+tx_dx_bt,bb_y0+tx_dy_bt,0,  0,0,0,  (tx_x0_bt+tx_dx_bt)/texw,(tx_y0_bt+tx_dy_bt)/texh}
	};
	const WORD idx[nidx] = {
		0,1,2, 3,2,1,
		4,5,6, 7,6,5,
		8,9,10, 11,10,9,
		12,13,14, 15,14,13,
		16,17,18, 19,18,17,
		20,21,22, 23,22,21,
		24,25,26, 27,26,25
	};
	AddGeometry (hMesh, grpidx, vtx, nvtx, idx, nidx);
	ctrlgrp = grp;
	ctrlofs = vtxofs;

	// Display
	const float dsp_texw = 512.0f;
	const float dsp_texh = 512.0f;
	const float tx_dsp_x0 = 330.5f;
	const float tx_dsp_y0 = dsp_texh-46.5f;
	const float tx_dsp_dx = 147.0f;
	const float tx_dsp_dy =  47.0f;
	const float bb_dsp_x0 = bb_dl_x0-32.5f;
	const float bb_dsp_y0 = bb_dl_y0-86.5f;
	const NTVERTEX dvtx[4] = {
		{bb_dsp_x0,          bb_dsp_y0,          0,  0,0,0,  tx_dsp_x0/dsp_texw,            tx_dsp_y0/dsp_texh            },
		{bb_dsp_x0+tx_dsp_dx,bb_dsp_y0,          0,  0,0,0,  (tx_dsp_x0+tx_dsp_dx)/dsp_texw,tx_dsp_y0/dsp_texh            },
		{bb_dsp_x0,          bb_dsp_y0+tx_dsp_dy,0,  0,0,0,  tx_dsp_x0/dsp_texw,            (tx_dsp_y0+tx_dsp_dy)/dsp_texh},
		{bb_dsp_x0+tx_dsp_dx,bb_dsp_y0+tx_dsp_dy,0,  0,0,0,  (tx_dsp_x0+tx_dsp_dx)/dsp_texw,(tx_dsp_y0+tx_dsp_dy)/dsp_texh}
	};
	const WORD didx[6] = {
		0,1,2, 3,2,1
	};
	AddGeometry (hMesh, grpidx_disp, dvtx, 4, didx, 6);
	dispgrp = grp;
	dispofs = vtxofs;
}
예제 #21
0
void InstrHSI::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx)
{
	const float horzx = (float)(texw-312), horzy = (float)(texh-252);
	const float rosex = horzx+2.0f, rosew = 152.0f;
	const float rosey = horzy+2.0f, roseh = 152.0f;
	const float arrowy = horzy+172.5f, arrowh = 17.0f;
	const float devy = arrowy+17.5f, devh = 10.0f;
	const float scalex = horzx+12.0f, scalew = 82.0f;
	const float scaley = horzy+216.0f, scaleh = 12.0f;
	const float out_y0 = (horzy+231.5f)/(float)texh, out_y1 = (horzy+248.5f)/(float)texh;
	const DWORD NVTX = 44;
	const DWORD NIDX = 66;
	static NTVERTEX VTX[NVTX] = {
		// compass rose
		{xcnt-60.5f,ycnt-60.5f,0,  0,0,0,  rosex/(float)texw, rosey/(float)texh},
		{xcnt+60.5f,ycnt-60.5f,0,  0,0,0,  (rosex+rosew)/(float)texw, rosey/(float)texh},
		{xcnt-60.5f,ycnt+60.5f,0,  0,0,0,  rosex/(float)texw, (rosey+roseh)/(float)texh},
		{xcnt+60.5f,ycnt+60.5f,0,  0,0,0,  (rosex+rosew)/(float)texw, (rosey+roseh)/(float)texh},
		// glideslope background
		{xcnt+62.0f,ycnt-60,0, 0,0,0,  (horzx+  0.5f)/(float)texw, (horzy+154.5f)/(float)texh},
		{xcnt+76.5f,ycnt-60,0, 0,0,0,  (horzx+  0.5f)/(float)texw, (horzy+154.5f)/(float)texh},
		{xcnt+62.0f,ycnt+60,0, 0,0,0,  (horzx+155.5f)/(float)texw, (horzy+154.5f)/(float)texh},
		{xcnt+76.5f,ycnt+60,0, 0,0,0,  (horzx+155.5f)/(float)texw, (horzy+154.5f)/(float)texh},
		// glideslope indicator
		{xcnt+64.0f,ycnt-64,0, 0,0,0,  (horzx+ 94.5f)/(float)texw, (horzy+216.5f)/(float)texh},
		{xcnt+76.5f,ycnt-64,0, 0,0,0,  (horzx+107.5f)/(float)texw, (horzy+216.5f)/(float)texh},
		{xcnt+64.0f,ycnt-64,0, 0,0,0,  (horzx+ 94.5f)/(float)texw, (horzy+227.5f)/(float)texh},
		{xcnt+76.5f,ycnt-64,0, 0,0,0,  (horzx+107.5f)/(float)texw, (horzy+227.5f)/(float)texh},
		// source bearing indicator
		{xcnt-6.2f,ycnt-61,0,  0,0,0,  (horzx+ 0.5f)/float(texw), (arrowy+arrowh+18.0f)/(float)texh},
		{xcnt+6.2f,ycnt-61,0,  0,0,0,  (horzx+ 0.5f)/float(texw), (arrowy+arrowh+1.0f)/(float)texh},
		{xcnt-6.2f,ycnt-45,0,  0,0,0,  (horzx+18.0f)/float(texw), (arrowy+arrowh+18.0f)/(float)texh},
		{xcnt+6.2f,ycnt-45,0,  0,0,0,  (horzx+18.0f)/float(texw), (arrowy+arrowh+1.0f)/(float)texh},
		// deviation scale
		{xcnt-32.2f,ycnt- 4.7f,0,  0,0,0,  scalex/(float)texw,scaley/(float)texh},
		{xcnt+32.2f,ycnt- 4.7f,0,  0,0,0,  (scalex+scalew)/(float)texw,scaley/(float)texh},
		{xcnt-32.2f,ycnt+ 4.7f,0,  0,0,0,  scalex/(float)texw,(scaley+scaleh)/(float)texh},
		{xcnt+32.2f,ycnt+ 4.7f,0,  0,0,0,  (scalex+scalew)/(float)texw,(scaley+scaleh)/(float)texh},
		// course indicator
		{xcnt- 6.2f,ycnt-60.5f,0,  0,0,0,  rosex/float(texw), (arrowy+arrowh)/(float)texh},
		{xcnt+ 6.2f,ycnt-60.5f,0,  0,0,0,  rosex/float(texw), arrowy/(float)texh},
		{xcnt- 6.2f,ycnt+60.5f,0,  0,0,0,  (rosex+rosew)/float(texw), (arrowy+arrowh)/(float)texh},
		{xcnt+ 6.2f,ycnt+60.5f,0,  0,0,0,  (rosex+rosew)/float(texw), arrowy/(float)texh},
		// deviation indicator
		{xcnt-3.65f,ycnt-25.82f,0, 0,0,0, (horzx+91.0f)/(float)texw,devy/(float)texh},
		{xcnt+3.65f,ycnt-25.82f,0, 0,0,0, (horzx+91.0f)/(float)texw,(devy+devh)/(float)texh},
		{xcnt-3.65f,ycnt+25.82f,0, 0,0,0, (horzx+91.0f+64.0f)/(float)texw,devy/(float)texh},
		{xcnt+3.65f,ycnt+25.82f,0, 0,0,0, (horzx+91.0f+64.0f)/(float)texw,(devy+devh)/(float)texh},
		// course readout background
		{xcnt-57,ycnt-72,0,  0,0,0,  0,0},
		{xcnt-36,ycnt-72,0,  0,0,0,  0,0},
		{xcnt-57,ycnt-60,0,  0,0,0,  0,0},
		{xcnt-36,ycnt-60,0,  0,0,0,  0,0},
		// course readout
		{xcnt-57,ycnt-72,0,  0,0,0,  0,out_y0},
		{xcnt-50,ycnt-72,0,  0,0,0,  0,out_y0},
		{xcnt-57,ycnt-60,0,  0,0,0,  0,out_y1},
		{xcnt-50,ycnt-60,0,  0,0,0,  0,out_y1},
		{xcnt-50,ycnt-72,0,  0,0,0,  0,out_y0},
		{xcnt-43,ycnt-72,0,  0,0,0,  0,out_y0},
		{xcnt-50,ycnt-60,0,  0,0,0,  0,out_y1},
		{xcnt-43,ycnt-60,0,  0,0,0,  0,out_y1},
		{xcnt-43,ycnt-72,0,  0,0,0,  0,out_y0},
		{xcnt-36,ycnt-72,0,  0,0,0,  0,out_y0},
		{xcnt-43,ycnt-60,0,  0,0,0,  0,out_y1},
		{xcnt-36,ycnt-60,0,  0,0,0,  0,out_y1}
	};
	static WORD IDX[NIDX] = {
		// compass rose
		0,1,2, 3,2,1,
		4,5,6, 7,6,5,
		8,9,10, 11,10,9,
		12,13,14, 15,14,13,
		16,17,18, 19,18,17,
		20,21,22, 23,22,21,
		24,25,26, 27,26,25,
		28,29,30, 31,30,29,
		32,33,34, 35,34,33,
		36,37,38, 39,38,37,
		40,41,42, 43,42,41
	};

	AddGeometry (hMesh, grpidx, VTX, NVTX, IDX, NIDX);
}
예제 #22
0
파일: adiball.cpp 프로젝트: Artoria2e5/obtr
void ADIBall::AddMeshData2D (MESHHANDLE hMesh, DWORD grpidx_ball, DWORD grpidx_ind)
{
	// We need two separate mesh groups for the ball and indicators, because the ball is typically
	// rendered below the panel mesh, and the indicators above it

	static const DWORD nvtx_rect = 4;
	static const DWORD nidx_rect = 6;
	static const WORD idx_rect[nidx_rect] = { 0,1,2,  3,2,1 };

	DWORD i, nidx;
	NTVERTEX *vtx;
	WORD *idx;

	// ball mesh
	MakeBall (6, rad, vtx, nballvtx, idx, nidx);
	if (ballvtx0) delete []ballvtx0;
	ballvtx0 = new VECTOR3[nballvtx];
	for (i = 0; i < nballvtx; i++) {
		ballvtx0[i].x = vtx[i].x;
		ballvtx0[i].y = vtx[i].y;
		ballvtx0[i].z = vtx[i].z;
		vtx[i].x += bb_cntx;
		vtx[i].y += bb_cnty;
		vtx[i].z = 0;
	}
	if (layout == 1)
		for (i = 0; i < nballvtx; i++)
			vtx[i].tu += tx_dx/texw;

	AddGeometry (hMesh, grpidx_ball, vtx, nballvtx, idx, nidx);
	ballgrp = grp;
	ballofs = vtxofs;

	// Roll indicator mesh
	static const NTVERTEX bvtx[nvtx_rect] = {
		{bb_cntx-bank_dx2,bb_cnty-bank_rad,        0,  0,0,0,  bank_tx_x0/texw,             bank_tx_y0/texh             },
		{bb_cntx+bank_dx2,bb_cnty-bank_rad,        0,  0,0,0,  (bank_tx_x0+bank_tx_dx)/texw,bank_tx_y0/texh             },
		{bb_cntx-bank_dx2,bb_cnty-bank_rad+bank_dy,0,  0,0,0,  bank_tx_x0/texw,             (bank_tx_y0+bank_tx_dy)/texh},
		{bb_cntx+bank_dx2,bb_cnty-bank_rad+bank_dy,0,  0,0,0,  (bank_tx_x0+bank_tx_dx)/texw,(bank_tx_y0+bank_tx_dy)/texh}
	};
	AddGeometry (hMesh, grpidx_ind, bvtx, nvtx_rect, idx_rect, nidx_rect);
	indgrp = grp;
	rollindofs = vtxofs;

	// Pitch error needle
	static const NTVERTEX pevtx[nvtx_rect] = {
		{bb_cntx-needle_r2,bb_cnty+needle_w2,0,  0,0,0,  (needle_tx_xcnt-needle_tx_w2*needle_r2/needle_r1)/texw,needle_tx_y0/texh               },
		{bb_cntx-needle_r2,bb_cnty-needle_w2,0,  0,0,0,  (needle_tx_xcnt-needle_tx_w2*needle_r2/needle_r1)/texw,(needle_tx_y0+needle_tx_dy)/texh},
		{bb_cntx+needle_r1,bb_cnty+needle_w2,0,  0,0,0,  (needle_tx_xcnt+needle_tx_w2)/texw,                    needle_tx_y0/texh               },
		{bb_cntx+needle_r1,bb_cnty-needle_w2,0,  0,0,0,  (needle_tx_xcnt+needle_tx_w2)/texw,                    (needle_tx_y0+needle_tx_dy)/texh}
	};
	AddGeometry (hMesh, grpidx_ind, pevtx, nvtx_rect, idx_rect, nidx_rect);
	peofs = vtxofs;

	// Yaw error needle
	static const NTVERTEX yevtx[nvtx_rect] = {
		{bb_cntx-needle_w2,bb_cnty-needle_r2,0,  0,0,0,  (needle_tx_xcnt-needle_tx_w2*needle_r2/needle_r1)/texw,(needle_tx_y0+needle_tx_dy)/texh},
		{bb_cntx+needle_w2,bb_cnty-needle_r2,0,  0,0,0,  (needle_tx_xcnt-needle_tx_w2*needle_r2/needle_r1)/texw,needle_tx_y0/texh               },
		{bb_cntx-needle_w2,bb_cnty+needle_r1,0,  0,0,0,  (needle_tx_xcnt+needle_tx_w2)/texw,                    (needle_tx_y0+needle_tx_dy)/texh},
		{bb_cntx+needle_w2,bb_cnty+needle_r1,0,  0,0,0,  (needle_tx_xcnt+needle_tx_w2)/texw,                    needle_tx_y0/texh               }
	};
	AddGeometry (hMesh, grpidx_ind, yevtx, nvtx_rect, idx_rect, nidx_rect);
	yeofs = vtxofs;

	// To/From indicator
	static const NTVERTEX tfvtx[nvtx_rect] = {
		{bb_tf_x0,         bb_tf_y0,         0,  0,0,0,  tx_tf_x0/texw,           tx_tf_y0/texh},
		{bb_tf_x0+tx_tf_dx,bb_tf_y0,         0,  0,0,0,  (tx_tf_x0+tx_tf_dx)/texw,tx_tf_y0/texh},
		{bb_tf_x0,         bb_tf_y0+tx_tf_dy,0,  0,0,0,  tx_tf_x0/texw,           (tx_tf_y0+tx_tf_dy)/texh},
		{bb_tf_x0+tx_tf_dx,bb_tf_y0+tx_tf_dy,0,  0,0,0,  (tx_tf_x0+tx_tf_dx)/texw,(tx_tf_y0+tx_tf_dy)/texh}
	};
	AddGeometry (hMesh, grpidx_ind, tfvtx, nvtx_rect, idx_rect, nidx_rect);
	tfofs = vtxofs;

	// Pitch rate indicator mesh
	static const NTVERTEX prvtx[nvtx_rect] = {
		{bb_cntx+rate_dr,       bb_cnty+rate_w2,0,  0,0,0,  rate_tx_x0/texw,             rate_tx_y0/texh             },
		{bb_cntx+rate_dr,       bb_cnty-rate_w2,0,  0,0,0,  (rate_tx_x0+rate_tx_dx)/texw,rate_tx_y0/texh             },
		{bb_cntx+rate_dr+rate_h,bb_cnty+rate_w2,0,  0,0,0,  rate_tx_x0/texw,             (rate_tx_y0+rate_tx_dy)/texh},
		{bb_cntx+rate_dr+rate_h,bb_cnty-rate_w2,0,  0,0,0,  (rate_tx_x0+rate_tx_dx)/texw,(rate_tx_y0+rate_tx_dy)/texh}
	};
	AddGeometry (hMesh, grpidx_ind, prvtx, nvtx_rect, idx_rect, nidx_rect);
	prateofs = vtxofs;

	// Roll rate indicator mesh
	static const NTVERTEX rrvtx[nvtx_rect] = {
		{bb_cntx+rate_w2,bb_cnty-rate_dr,       0,  0,0,0,  rate_tx_x0/texw,             rate_tx_y0/texh             },
		{bb_cntx-rate_w2,bb_cnty-rate_dr,       0,  0,0,0,  (rate_tx_x0+rate_tx_dx)/texw,rate_tx_y0/texh             },
		{bb_cntx+rate_w2,bb_cnty-rate_dr-rate_h,0,  0,0,0,  rate_tx_x0/texw,             (rate_tx_y0+rate_tx_dy)/texh},
		{bb_cntx-rate_w2,bb_cnty-rate_dr-rate_h,0,  0,0,0,  (rate_tx_x0+rate_tx_dx)/texw,(rate_tx_y0+rate_tx_dy)/texh}
	};
	AddGeometry (hMesh, grpidx_ind, rrvtx, nvtx_rect, idx_rect, nidx_rect);
	brateofs = vtxofs;

	// Yaw rate indicator mesh
	static const NTVERTEX yrvtx[nvtx_rect] = {
		{bb_cntx-rate_w2,bb_cnty+rate_dr,       0,  0,0,0,  rate_tx_x0/texw,             rate_tx_y0/texh             },
		{bb_cntx+rate_w2,bb_cnty+rate_dr,       0,  0,0,0,  (rate_tx_x0+rate_tx_dx)/texw,rate_tx_y0/texh             },
		{bb_cntx-rate_w2,bb_cnty+rate_dr+rate_h,0,  0,0,0,  rate_tx_x0/texw,             (rate_tx_y0+rate_tx_dy)/texh},
		{bb_cntx+rate_w2,bb_cnty+rate_dr+rate_h,0,  0,0,0,  (rate_tx_x0+rate_tx_dx)/texw,(rate_tx_y0+rate_tx_dy)/texh}
	};
	AddGeometry (hMesh, grpidx_ind, yrvtx, nvtx_rect, idx_rect, nidx_rect);
	yrateofs = vtxofs;

	delete []vtx;
	delete []idx;
}