ホーム » 2023 » 6月 » 28

日別アーカイブ: 2023/06/28

2023年6月
 123
45678910
11121314151617
18192021222324
252627282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,478 アクセス



Linux での GLUT 3D データ表示

昨日のコードをもう少し汎用的に修正.そしてそれを他から呼出せるように変更.
次の様なコードで 3D データを生成して,GLUT で表示できる様にした.

bool	test	(void)
{
	Vd2A	pts ;
	{
		pts.push_back(Vd2(  0,  0)) ;
		pts.push_back(Vd2( 70,  0)) ;
		pts.push_back(Vd2( 90, 50)) ;
		pts.push_back(Vd2(100,100)) ;
		pts.push_back(Vd2( 50,100)) ;
		pts.push_back(Vd2( 30, 70)) ;
		pts.push_back(Vd2( 40, 30)) ;
		pts.push_back(Vd2(  0,  0)) ;
		}
	vv_PLF	vvplf ;
	{
		Vd3A	v3a = ::ToVd3A(pts) ;
		Vd4A	v4a = ::ToVd4A(v3a) ;
		PLF	plf_l__ (PLF::line,v4a) ;
		PLF	plf_f__ (PLF::face,v4a) ;
		v_PLF	v_plf ;
			v_plf.push_back(plf_l__) ;
			v_plf.push_back(plf_f__) ;
			vvplf.push_back(v_plf) ;
		}
	tstring	txt_name = ::g3_d_get_txt_name() ;
	{
		tstring	tmp_path = ::Get_i_Tools_tmp_date() ;
		tstring	ipl_name = ::Path_AddLastSP(tmp_path) + ::Now_Format(_T("%H%M%S")) + _T(".ipl") ;
		::To_ipl  (vvplf,ipl_name.c_str()) ;
		::SaveText(txt_name.c_str(),ipl_name) ;
		}
	{
		::exec_g3_d(txt_name.c_str()) ;
		}
	return	true ;
	}

g3_d_gl

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.