ホーム » メモ (ページ 8)

メモ」カテゴリーアーカイブ

2025年5月
 123
45678910
11121314151617
18192021222324
25262728293031

カテゴリー

アーカイブ

ブログ統計情報

  • 115,570 アクセス


Win10 に IIS と PHP のインストール

Win10 環境で PHP を動作させるためのインストールなどの手順
今回使用したのは Win10 LTSC
通常版に比べて不要なものが入らないのでこれを選択.


以前 Win7 環境に PHP を入れた時の手順
IIS での PHP Web サイトの構成
IIS の有効化.CGI が必要.
Win10 IIS のインストール
IIS の動作の確認.
Win10 localhost にアクセス
Win10 他の PC から IP でアクセス
//win10-ltsc でアクセス
Web PI のインストール.
Web PI を起動して PHP をインストール.
Web PI で PHP の追加
何故かエラー?
PHP Managet for IIS は複数バージョンの PHP を切替えるツールの様で今回は無くても良いか?
Web PI で PHP インストールでエラー
php -v や php -r “phpinfo();” で確認すると動作はしている.
Win10 IIS  php -v
次の内容を php として保存し,ブラウザで開く. <?php phpinfo(); ?>
Win10 LTSC phpinfo()

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

Raspberry Pi で NAS が …

以前は表示されていたと思うが…
Raspberry Pi のファイルマネージャ Pcmanfm で「移動」-「ネットワーク」で NAS などが表示されていない.
Raspberry Pi のファイルマネージャで「移動」-「ネットワーク」
しばらく対応方法がわからなかった.
「ファイルマネージャ」の「アドレス欄」に smb://ds116/ の様に入力することで接続できることを確認.
Raspberry Pi ファイルマネージャのアドレス欄に smb://ds116/

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

GLUT でうまく表示されない?

以前作成した現在時刻を WebGL で表示するコードを GLUT を使用した方法に書き直し.
現在時刻を WebGL で表示
右側の面が正しく表示されていない.
GLUT での現在時刻の表示
見えない面を表示しない様に判断しているコードは次の様なもの.

{
	Vd3	ev = eye ;
	Vd3	nv ;
	Vd3	pt ;
	for (size_t fvIndex=0 ; fvIndex<pia.size() ; fvIndex++) {
		long	fVert = pia[fvIndex].x ;
		long	nVert = pia[fvIndex].y ;
		Vd3	n1 = ::Vx_get(nrms,nVert) ;
		Vd3	p1 = ::Vx_get(pnts,fVert) ;
		nv = nv + n1 ;
		pt = p1 ;
		}
	ev = ev - pt ;
	nv = nv.Normalized() ;
	ev = ev.Normalized() ;
	double	theta = ::deg(acos(nv.Dot(ev))) ;
	if (theta > 90)		{	continue ;	}
	}

原因は,描画用に与えている視点で目標点が加算されていなかったため.

void	draw(void)
{
	GonsA*	ga = get_GonsA() ;
	Vd3	eye = ::get_c_glut()->EP ;
	//	eye+= ::get_c_glut()->TP ;
	::GonsA_to_gl(*ga,eye) ;
	}

最終的にはこのあたり(C_glut)の見直しが必要.


https://itl.mish.work/Iwao/Doc/algo/to_thick/glut.htm

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

Linux から NAS 上のアクセス

Linux から NAS 上のファイルを読み込むコード


Windows からであれば次の様な指定が可能.
tstring test_imo = _T(“//DS116/web/i_Tools/Doc/blog/3D_Data/Test_cube_line.imo”) ;
使用する関数や API によっては “\\” でないとうまくない場合もある.
tstring test_imo = _T(“\\\\DS116\\web\\i_Tools\\Doc\\blog\\3D_Data\\Test_cube_line.imo”) ;


Linux では mount すれば次の様な指定が可能なことは以前に調べている.
tstring test_imo = _T(“/mnt/ds116/web/i_Tools/Doc/blog/3D_Data/Test_cube_line.imo”) ;
今回は異なる方法で何か方法はないかと調べてみた.
結果としては「ファイルマネージャ」などでアクセスできる状態にする必要があるのであまり mount と変わらない.


調べたのは次の様な手順.
「端末」を開いて ls と入力.
そこに「ファイルマネージャ」からディレクトリをドロップ.
「端末」で「Enter」するとアクセスできることを確認.
Linux から NAS 上のディレクトリの ls
tstring test_imo = _T(“/run/user/1000/gvfs/smb-share:server=ds116.local,share=web/i_Tools/Doc/blog/3D_Data/Test_cube_line.imo“) ;

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

WebGL three.js OBJLoader ‘l’

以前 OBJ 内の線の情報を使えないかと思い調べたが,その時はわからないでいた.
Wiki Wavefront .obj file を参考に OBJ ファイルを編集して three.js で読み込んだがうまく読めなかった.


ちょっと別件で詰まってしまったので気分転換に調べていたら…
次の様な指定だとうまくいきそうとわかった.
l 1/ 2/
l 1/ 2/ 2/ 3/ 3/ 4/ 4/ 1/
three.js OBJ 内の Line element

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

UWP アプリ

2016/03 に試してうまく動作しなかった UWP アプリ.
T90Chi VS2015 UWP 起動
一度起動するがすぐにエラーメッセージ.
—————————
Microsoft Visual Studio
—————————
Windows ストア アプリ ‘5a7750b3-af94-47d7-a064-b9adc49f8813_7r65t4tynye04!App’ をアクティブにできません。アクティベーション要求がエラー ‘操作はサポートされていません。不明なエラー: 0x80040904’ で失敗しました。
この問題のトラブルシューティングについては、ヘルプを参照してください。
—————————
OK ヘルプ
—————————
T90Chi VS2015 UWP 起動後エラー


「そんなもん」と思い触らないでいたが,DirectX があったので今の開発機で試してみた.
するとうまく動作する.
Z170S0 で UWP アプリの起動
どこかの設定が違うのだろうか?それともライセンスの関係?

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

Fedora への ssh 接続

Fedora での SSH 接続の有効化
Fedora では「設定」-「共有」-「リモートログイン」がそれにあたる.
VS でのリモートの設定 は「ツール」-「オプション」で開いた「クロスプラットフォーム」にある.
リモート環境の追加
プロジェクトの設定も必要で「構成プロパティ」-「全般」の「リモートビルドマシン」.
リモートビルドマシンの設定
これが合っていないとビルドエラーになる.

1>------ ビルド開始: プロジェクト: ConsoleApplication1, 構成: Release x64 ------
1>Validating sources
1>Copying sources remotely to '192.168.1.34'
1>Validating architecture
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Application Type\Linux\1.0\Linux.targets(151,5): error : Current project architecture 'x64' is incompatible with the remote system architecture 'ARM' ('ARM'). Please switch the project architecture to 'ARM' in Configuration Manager.
1>プロジェクト "ConsoleApplication1.vcxproj" のビルドが終了しました -- 失敗。
========== ビルド: 0 正常終了、1 失敗、0 更新不要、0 スキップ ==========

Ubuntu では ssh サーバが入っていないみたいで次のコマンドでインストール.
$ sudo apt install openssh-server
何故か password を受け付けない?
Win10 19h1 のコマンドプロンプトで次の様にしても接続できない.

C:\Users\Iwao\AppData\Local\Temp>ssh -l Iwao -p 22 192.168.1.39
Iwao@192.168.1.39's password:
Permission denied, please try again.
Iwao@192.168.1.39's password:

何か他の設定が足りないのか?


設定関連のドキュメントは次の所にあった.
Linux ワークロードのダウンロード、インストール、セットアップ

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

VC 2017 Linux プロジェクト

VC 2017 を弄っていたら,Linux のプロジェクトの作成が可能になっていたので試してみた.
どのタイミングだったか忘れたが,SSH 接続が必要になる.


今まで設定してある Raspberry Pi に接続してみた.
Raspberry Pi  SSH 設定
Raspberry Pi 側の設定は「Raspberry Pi の設定」-「インターフェイス」にある.


ビルド時に使用する include は以下にコピーされている.これは Raspberry Pi の /user/include と同じ内容?
C:\Users\Iwao\AppData\Local\Microsoft\Linux\HeaderCache\1.0\-1277036696\usr\include
Raspberry Pi の /user/include のコピー
ビルドして出来上がった .out は /home/pi/projects/…/bin/ARM/Release にある.
Raspberry Pi /home/pi/projects/

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

WebGL three.js r91 – r109

WebGL three.js の r91 以降の変更による影響のメモ
OBJ と MTL を使用しているので webgl_loader_obj_mtl.html の変更内容.


r91 → r96

	var mtlLoader = new THREE.MTLLoader();
	mtlLoader.setPath( 'models/obj/male02/' );
	mtlLoader.load( 'male02_dds.mtl', function( materials ) {
		materials.preload();
		var objLoader = new THREE.OBJLoader();
		objLoader.setMaterials( materials );
		objLoader.setPath( 'models/obj/male02/' );
		objLoader.load( 'male02.obj', function ( object ) {
			object.position.y = - 95;
			scene.add( object );
		}, onProgress, onError );
	});

new THREE.MTLLoader() .setPath( 'models/obj/male02/' ) .load( 'male02_dds.mtl', function ( materials ) { materials.preload(); new THREE.OBJLoader() .setMaterials( materials ) .setPath( 'models/obj/male02/' ) .load( 'male02.obj', function ( object ) { object.position.y = - 95; scene.add( object ); }, onProgress, onError ); } );

→ r97
js/Detector.js がなくなった.


→ r99
r97  var onError = function ( xhr ) { };
r99  var onError = function () { };


→ r101
jsm が追加されている.


→ r105
style が main.css に.


→ r106
module を使用する様に変更されている.


→ r109
setTexturePath が使えなくなったのでコメントに.

//	mtlLdr.setTexturePath	(imoPath) ;
	mtlLdr.setPath		(imoPath) ;

WebGL three.js r109 への対応

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

SDI exe で変換後ドキュメントを開く

SDI exe で,変換後のデータをそのまま開きたかった.
OnOpenDocument で開くことは可能だが,幾つかうまくない所がある.
CDocument の OnOpenDocument 前後の動作をデバッガで追いかけると,ビューの初期化が足りない.
CView* を求めて OnInitialUpdate で対応.

void CX__Doc::OnConvert() 
{
	if (GetPathName().IsEmpty())	{	return	;	}
	tstring	new_name ;
	{
	//	...
		::G3_to_NEW(...,new_name.c_str()) ;
		}
	{
		OnNewDocument () ;
		OnOpenDocument(new_name.c_str()) ;
		SetPathName   (new_name.c_str()) ;
		{
			CFrameWnd*	frame = (CFrameWnd*)AfxGetMainWnd() ;
			if (frame != NULL) {
				CView*	view = frame->GetActiveView() ;
				if (view != NULL) {
					view->OnInitialUpdate() ;
					}
				}
			}
		}
	}

MFC 変換直後にドキュメントを開く

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

LNK1143 : ファイルが無効であるか…

VC 6 で 2017/04 頃のプロジェクトをビルドすると,
fatal error LNK1143: ファイルが無効であるか、 または壊れています: COMDAT セクション 0xFFFF8000 のシンボルがありません。


--------------------構成: GLSmth - Win32 Release--------------------
GLSm.exe - エラー 0、警告 0
--------------------構成: GLSmth - Win32 Debug--------------------
GLSm.exe - エラー 0、警告 0
--------------------構成: T_tjs_1 - Win32 Release--------------------
T_tjs_1.exe - エラー 0、警告 0
--------------------構成: T_tjs_1 - Win32 Debug--------------------
T_tjs_1.exe - エラー 0、警告 0
--------------------構成: T_tjs_2 - Win32 Release--------------------
T_tjs_2.exe - エラー 0、警告 0
--------------------構成: T_tjs_2 - Win32 Debug--------------------
T_tjs_2.exe - エラー 0、警告 0
--------------------構成: T_tjs_3 - Win32 Release--------------------
T_tjs_3.exe - エラー 0、警告 0
--------------------構成: T_tjs_3 - Win32 Debug--------------------
T_tjs_3.exe - エラー 0、警告 0
--------------------構成: T_tjs_4 - Win32 Release--------------------
T_tjs_4.exe - エラー 0、警告 0
--------------------構成: T_tjs_4 - Win32 Debug--------------------
コンパイル中...
T_tjs_4.cpp
...
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(439) : fatal error C1076: コンパイラの制限 : ヒープの領域を使い果たしました; 上限を設定するために /Zm オプションを使用してください。
        c:\program files\microsoft visual studio\vc98\include\xlocmon(106): クラス テンプレートのメンバ関数 'void __thiscall CArray::SetAtGrow(int,class Material)' のコンパイル中
cl.exe の実行エラー
T_tjs_4.exe - エラー 1、警告 0
--------------------構成: thrjs_3d - Win32 Release--------------------
thrjs_3d.exe - エラー 0、警告 0
--------------------構成: thrjs_3d - Win32 Debug--------------------
thrjs_3d.exe - エラー 0、警告 0
--------------------構成: thrjs_mb - Win32 Release--------------------
thrjs_mb.exe - エラー 0、警告 0
--------------------構成: thrjs_mb - Win32 Debug--------------------
リンク中...
thrjs_mb.obj : fatal error LNK1143: ファイルが無効であるか、 または壊れています: COMDAT セクション 0xFFFF8000 のシンボルがありません。
link.exe の実行エラー

thrjs_mb.exe - エラー 1、警告 0
--------------------構成: thrjs_mk - Win32 Release--------------------
thrjs_mk.exe - エラー 0、警告 0
--------------------構成: thrjs_mk - Win32 Debug--------------------
thrjs_mk.exe - エラー 0、警告 0

最初 C1076 のエラーがあったが,この対応には /Zm150 を追加
GLSmth 以外のプロジェクトは,コンソール AP .
threejs 内のプロジェクト
VC 7 や 8 では問題なくビルドできる.


これらのプロジェクトでは main() を含む cpp に他の cpp をインクルードしている.
VC 6 では,ある大きさを超える cpp のコンパイルで正しく obj が作成できないみたい.
出来上がっている obj のファイルサイズは 21 MB 位.
main を含むソースを分割することで対応可能.

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

//itl.mydns.jp/ のパンくずリスト …

先日届いたメール.


https://itl.mydns.jp/joomla/ のパンくずリスト マークアップを修正する
Google Search Console Team <sc-noreply@google.com>
2019/09/20 (金) 17:46


Message type: [WNC-20064166]
Search Console
https://itl.mydns.jp/joomla/ でパンくずリスト マークアップを修正する
Google システムによってお客様のサイトが 15パンくずリスト マークアップに関する問題の例 の問題があると判断されました。このため、お客様サイトのパンくずリストのページが Google 検索でリッチリザルトとして表示されない可能性があります。
Search Console では、このリッチリザルト タイプ専用の新しいレポートをご利用いただけます。新しいレポートでは、検索結果でリッチリザルトが正しく表示されるよう、問題のあるページを特定および修正し、Google に再送信することができます。
パンくずリストレポートを開く
Google LLC, 1600 Amphitheatre Parkway Mountain View, CA 94043 | このメールは、Google Search Console にサイトが登録されているすべてのお客様にお送りしています | この種類のメッセージの配信を停止する
パートナーを追加この Search Console アカウントについてのメッセージを受信するパートナーを追加できます


Joomla! ページの「パンくずリスト」の様だが,よくわからない.
Google Search Console itl.mydns.jp/Joomla パンくずリスト 項目「Item」がありません
特に何もしていないのに,メールの時点から減っている.
対応方法がわからないので様子見.


2019/09/30 特に何もしていないが,エラーは 0 になっている.
itl.mydns.jp/joomla の「パンくずリスト」のエラーが 0 に

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

Raspberry Pi Desktop の設定

Raspberry Pi Desktop を自分好みにするためのいくつかの設定.


Scratch は「日本語」になっているが Scratch 2 は英語のまま.
「File」メニューの左をクリックすると言語が選べて,下の方に「日本語」がある.
Scratch 2 言語設定


ブラウザの Chromium
「メインメニュー」の「設定」-「Add / Remove Software」.
Raspberry Pi Desktop メインメニューから Add / Remove Software
「Chromium」で検索して「ウェブブラウザ – 言語パック」にチェック.
Raspberry Pi Desktop ウェブブラウザ 言語パックにチェック
「OK」でインストール.
私の個人的なテスト用サイトの表示は,持っている Raspberry Pi よりスムーズ?
itl.mydns.jp

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

Raspberry Pi Desktop インストール

Debian Stretch with Raspberry Pi Desktop」のインストール
Raspberry Pi Desktop
次の所を参考にインストール.
Windows PCにPIXEL(Raspberry Pi OS) for PCをインストールしてみよう (2/3)
見た目が異なるだけで指定内容はほぼ同じ.
もう一つ見つけたのは,
[メモ] VirtualBoxにて、Raspberry Pi Desktop(2017-11-16-rpd-x86-stretch版)
こちらは今とほぼ同じ様な表示で,こちらの方がわかりやすいかもしれない.


他の Linux 環境と同じようにするためのいくつかの設定.
/mnt/_.src を作成.
$ sudo mkdir /mnt/_.src
mountCPATH を設定する set_z_inc.sh をコピー.
Raspberry Pi Desktop 共通ソースのフォルダをマウント


GLUT のインストール
$ sudo apt install freeglut3 freeglut3-dev
$ g++ test.cpp -lGL -lGLU -lglut
Raspberry Pi Desktop GLUT インストール


PyOpenGL のインストール.
$ pip install PyOpenGL
$ pip install PyOpenGL_accelerate
Raspberry Pi Desktop   PyOpenGL のインストール

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

VNC Viewer での画面コピー

検索すると設定があることは見つかるが,設定場所が見当たらない.
VNC Viewer のメニューから「Properties…」を開くと,「Options」タブ内にあった.
VNC Viewer の「画面コピー」の設定
「Pass special keys …」のチェックを外すことで意図した動作に.


2023/04/06
どこが原因かは不明だが,VNC を通した画面コピーで 3 ピクセルずれる.
VNC での画面コピーが 3 ピクセルずれる
「VNC での画面コピーが 3 ピクセルずれる」データのダンプ

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

Raspberry Pi にインストール

Raspberry Pi 用に micro SD を購入.

パッケージから micro SD を取り出すのがちょっと大変(金属部分に触ってしまいそう).
micro SD の動作確認のために「KoKaRasPi1181118.img」をコピーして OS が起動することを確認.


今度は Raspbian からのインストール.
ダウンロードできるページにアクセスすると幾つかあり.
https://www.raspberrypi.org/downloads/ NOOBS と Raspbian
今回は Raspbian Buster with desktop and recommended software を選択.
「2019-07-10-raspbian-buster-full.img」を microSD にコピー
あとは Raspberry Pi に挿して起動.
Raspbian Buster with desktop を起動
幾つかの設定を「Japanese」に.
再起動して Wi-Fi などの設定後,ソフトウェアのアップデートに.これは 1 時間程度かかった.
Update Software の画面
また再起動して何とか使える状態に.


ssh で接続しようとすると,何かの設定をしなければならない様なメッセージ.

C:\Users\Iwao\AppData\Local\Temp>ssh -l pi 192.168.1.34
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:+XCHdOHLyB0hFfxDrAR2xEvYhuiylCLzFYhmznJyzYg.
Please contact your system administrator.
Add correct host key in C:\\Users\\Iwao/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\Iwao/.ssh/known_hosts:1
ECDSA host key for 192.168.1.34 has changed and you have requested strict checking.
Host key verification failed.

C:\Users\Iwao\AppData\Local\Temp>

検索すると,
SSH接続で WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
エディタで …/.ssh/known_hosts の 1 行目の 192.168.1.34 を 192.168.1.35 に.
もう一度,ssh -l pi 192.168.1.34 とすることで接続できた.
また,known_hosts には 192.168.1.34 が追加されている.
192.168.1.35 にしたものを 192.168.1.34 に戻すことで,前の SD でも動作可能なことを確認.
known_hosts を編集


2019/09/21
microSD が増えてきたので,ケースを購入.
レビューにある様に,収まりが良くない.

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

PyOpenGL インストール – 2

今度は Ubuntu 環境へのインストール.
先ず Python 2.7 .

iwao@VB-Ubuntu:~$ sudo apt install python
[sudo] iwao のパスワード: 
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
  libpython-stdlib libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib
  python-minimal python2 python2-minimal python2.7 python2.7-minimal
提案パッケージ:
  python-doc python-tk python2-doc python2.7-doc binfmt-support
以下のパッケージが新たにインストールされます:
  libpython-stdlib libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib
  python python-minimal python2 python2-minimal python2.7 python2.7-minimal
アップグレード: 0 個、新規インストール: 10 個、削除: 0 個、保留: 9 個。
3,883 kB のアーカイブを取得する必要があります。
この操作後に追加で 16.7 MB のディスク容量が消費されます。
続行しますか? [Y/n] 

Ubuntu に Python 2.7 をインストール
続いて pip .

iwao@VB-Ubuntu:~$ pip

Command 'pip' not found, but can be installed with:

sudo apt install python-pip

iwao@VB-Ubuntu:~$ sudo apt install python-pip
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
  javascript-common libexpat1 libexpat1-dev libjs-jquery libjs-sphinxdoc libjs-underscore libpython-all-dev
  libpython-dev libpython2-dev libpython2.7 libpython2.7-dev python-all python-all-dev python-asn1crypto
  python-cffi-backend python-configparser python-crypto python-cryptography python-dbus python-dev python-entrypoints
  python-enum34 python-gi python-idna python-ipaddress python-keyring python-keyrings.alt python-pip-whl
  python-pkg-resources python-secretstorage python-setuptools python-six python-wheel python-xdg python2-dev
  python2.7-dev
提案パッケージ:
  apache2 | lighttpd | httpd python-crypto-doc python-cryptography-doc python-cryptography-vectors python-dbus-dbg
  python-dbus-doc python-enum34-doc python-gi-cairo libkf5wallet-bin gir1.2-gnomekeyring-1.0 python-gdata
  python-keyczar python-secretstorage-doc python-setuptools-doc
以下のパッケージが新たにインストールされます:
  javascript-common libexpat1-dev libjs-jquery libjs-sphinxdoc libjs-underscore libpython-all-dev libpython-dev
  libpython2-dev libpython2.7 libpython2.7-dev python-all python-all-dev python-asn1crypto python-cffi-backend
  python-configparser python-crypto python-cryptography python-dbus python-dev python-entrypoints python-enum34
  python-gi python-idna python-ipaddress python-keyring python-keyrings.alt python-pip python-pip-whl
  python-pkg-resources python-secretstorage python-setuptools python-six python-wheel python-xdg python2-dev
  python2.7-dev
以下のパッケージはアップグレードされます:
  libexpat1
アップグレード: 1 個、新規インストール: 36 個、削除: 0 個、保留: 8 個。
37.0 MB 中 36.9 MB のアーカイブを取得する必要があります。
この操作後に追加で 72.7 MB のディスク容量が消費されます。
続行しますか? [Y/n] 

Ubuntu に pip をインストール


PyOpenGL .
$ pip install PyOpenGL
$ pip install PyOpenGL_accelerate
PyOpenGL のインストール
Ubuntu はこのインストールで良いみたい.
Fedora の様に OpenGL.GL にあたるパッケージのインストールは必要なさそう.


Raspberry Pi へのインストール.
Python 2.7 は入っているので PyOpenGL のインストール.
$ pip install PyOpenGL
$ pip install PyOpenGL_accelerate
Raspberry Pi に PyOpenGL のインストール
これだけ良いみたい.


2020/07/29
PyOpenGL 3.x The Python OpenGL Binding

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

PyOpenGL インストール

この記事は 2019/09 に書いたものです.
現在は Python 3.x 対応になっています.


PyOpenGL は Python 2.7 が奨励みたいで,Fedora 環境に Python 2.7 をインストール.
Fedora に Python 2.7 をインストール

[Iwao@fedora ~]$ python
bash: python: コマンドが見つかりませんでした...
コマンド python' を提供するためにパッケージ 'python-unversioned-command' をインストールしますか? [N/y] y

 * キューで待機中... 
 * パッケージの一覧をロード中。... 
以下のパッケージはインストールされるべきものです:
 gdbm-1:1.18-4.fc30.x86_64	A GNU set of database routines which use extensible hashing
 python-unversioned-command-2.7.16-2.fc30.noarch	The "python" command that runs Python 2
 python2-2.7.16-2.fc30.x86_64	An interpreted, interactive, object-oriented programming language
 python2-libs-2.7.16-2.fc30.x86_64	Runtime libraries for Python 2
 python2-pip-19.0.3-3.fc30.noarch	A tool for installing and managing Python 2 packages
 python2-setuptools-40.8.0-1.fc30.noarch	Easily build and distribute Python packages
変更したまま継続しますか? [N/y] y

 * キューで待機中... 
 * 認証を待ち受け中... 
 * キューで待機中... 
 * パッケージをダウンロード中... 
 * データを要求中... 
 * 変更をテスト中... 
 * パッケージのインストール中... 

[Iwao@fedora ~]$ 

次は PyOpenGL のインストール
インストールは次のものらしい.
$ pip install PyOpenGL
$ pip install PyOpenGL_accelerate
【Python】PyOpenGLのインストールからウィンドウ表示まで
PythonのOpenGLライブラリ「PyOpenGL」はPython3系では動かないのね


次の様なウィンドウを表示するだけのコードでエラー.
ImportError: No module named OpenGL.GL

from OpenGL.GL   import *
from OpenGL.GLUT import *

def draw():
    glClearColor(1.0, 1.0, 0.5, 0.0)
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
    glFlush()
    glutSwapBuffers()

def main():
    glutInit(sys.argv)
    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)
    glutInitWindowSize(300, 300)
    glutCreateWindow("PyOpenGL")
    glutDisplayFunc(draw)
    glutMainLoop()

main()
[Iwao@fedora pyopengl]$ python test.py 
Traceback (most recent call last):
  File "test.py", line 3, in 
    from OpenGL.GL import *
ImportError: No module named OpenGL.GL
[Iwao@fedora pyopengl]$ 

OpenGL 関係が足りないみたいで検索すると python-pyopengl が必要とある.
Pythonでグラフィックやるには?

[Iwao@fedora py_math]$ sudo dnf install python-pyopengl*
[sudo] Iwao のパスワード:
メタデータの期限切れの最終確認: 0:57:14 時間前の 2019年09月13日 16時39分16秒 に実施しました。
依存関係が解決しました。
================================================================================
 Package                Architecture Version                Repository     Size
================================================================================
インストール:
 python2-pyopengl       x86_64       3.1.1a1-15.fc30        fedora        2.4 M
依存関係のインストール:
 openblas-threads       x86_64       0.3.7-1.fc30           updates       4.8 M
 python2-numpy          x86_64       1:1.16.4-2.fc30        updates       3.9 M
 python2-nose           noarch       1.3.7-22.fc30          fedora        261 k

dnf install python-pyopengl
これで実行できるようになった.
PyOpenGL でのウィンドウの表示


2020/07/31
PyOpenGL 3.x The Python OpenGL Binding

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

FBX SDK の lib ファイル指定

先日,時間があまりとれず 今までの lib の指定 でそのままだった.


FbxSdk.h から順にたどっていくと fbxsdk_version.h があった.
この中に次の様な SDK バージョンが定義されている.

#define FBXSDK_VERSION_MAJOR	2014
#define FBXSDK_VERSION_MINOR	1
#define FBXSDK_VERSION_POINT	0

バージョン文字列は次の様に利用できる.

CString	fsv_str = FS_Ver_Str ;
#ifdef	FBXSDK_VERSION_STRING
//	fsv_str = ::To_tstring(FBXSDK_VERSION_STRING).c_str() ;
	fsv_str =           _T(FBXSDK_VERSION_STRING) ;
#endif

これらを利用した方法で書き換え.


#if		(FBXSDK_VERSION_MAJOR >= 2014)
		#define	FS_VER_GT_2014_00
#endif
#if		(FBXSDK_VERSION_MAJOR >= 2019)
	#if	(FBXSDK_VERSION_MINOR >=    1)
		#define	FS_VER_GT_2019_01
	#endif
#endif

#ifdef	FS_VER_GT_2019_01
	#ifdef	_DLL
		#pragma	comment	(lib, 	"LibXml2-MD.lib")
		#pragma	comment	(lib, 	"Zlib-MD.lib")
	#else
		#pragma	comment	(lib, 	"LibXml2-MT.lib")
		#pragma	comment	(lib, 	"Zlib-MT.lib")
	#endif
#endif

#ifdef	FS_VER_GT_2014_00
	#ifdef	_DLL
		#pragma	comment	(lib, 	"LibFbxSDK-MD.lib")
	#else
		#pragma	comment	(lib, 	"LibFbxSDK-MT.lib")
	#endif
#endif

FBXSDK_VERSION を使用した pragma comment lib の指定


https://dev.mish.work/wordpress/2020/12/15/fbx-sdk-hxx-pragma-comment/

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

コンパイルオプション -Dname=…

コンパイル時のオプションで -DVER=2019.09 の様な指定を使いたくなったので調べてみた.
コードは次のようなもの.

#include	<iostream>
#include	<iomanip>

#ifndef	Test_Ver_F
#define	Test_Ver_F  2019.0902
#endif

int	main	(int argc,   char* argv[])
{
	{
		std::cout                            	<< Test_Ver_F  << std::endl ;
		std::cout <<  std::setprecision(20)  	<< Test_Ver_F  << std::endl ;
		}
	return	0 ;
	}
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ g++ t_ccsw_d.cpp 
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ ./a.out 
2019.09
2019.0902000000000953
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ g++ t_ccsw_d.cpp -DTest_Ver_F=2019.0902
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ ./a.out 
2019.09
2019.0902000000000953
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ g++ t_ccsw_d.cpp -DTest_Ver_F="2019.0902"
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ ./a.out 
2019.09
2019.0902000000000953
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ g++ t_ccsw_d.cpp -DTest_Ver_F=\"2019.0902\"
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ ./a.out 
2019.0902
2019.0902
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ g++ t_ccsw_d.cpp -DTest_Ver_F=\"2019.09.02\"
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ ./a.out 
2019.09.02
2019.09.02
pi@raspberrypi:~/Documents/test_gcc/t_ccsw_d $ 

g++ t_ccsw_d.cpp -DTest_Ver_F=2019.0902
2019.0902 の様な浮動小数点の指定は特に変わった所はない.
但し浮動小数点による誤差などは考慮が必要.
文字列として扱いたいときは \” で括ればよい.

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