LoginSignup
10
3

More than 1 year has passed since last update.

MacOSのProcessingでP3Dを使いたい!

Posted at

きっかけ

Processingで、以下のように書いた

void setup() {
    size(600, 600, P3D);
}

void draw() {
    background(255, 0, 0);
}

そしたら、こんな感じの謎のwarningを吐かれ、正常に動作しなかった
(ちなみに自分のwarningメッセージをメモしてなかったので、同じ状況である他の人のメッセージを拝借した)

WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future. Called from (
    0   AppKit                              0x00007fff3105d2e3 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 386
    1   AppKit                              0x00007fff3105a68c -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1488
    2   AppKit                              0x00007fff3105a0b6 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
    3   libnativewindow_macosx.jnilib       0x000000012d0c53fe Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398
    4   ???                                 0x0000000114224a88 0x0 + 4632758920
)

調べたところによると、どうやらJOGLのバージョンが問題らしい

解決までの手順

Applicationフォルダ内のProcessing.appを右クリックし、「パッケージの内容を表示」を選択する

スクリーンショット 2021-10-13 12.16.06.png

Contents/Java/core/library/を開くと、色々入っている

スクリーンショット 2021-10-13 12.18.47.png

この中の、4つの.jarファイル

  • gluegen-rt.jar
  • gluegen-rt-natives-macosx-universal.jar
  • jogl-all.jar
  • jogl-all-natives-macosx-universal.jar

を新たなバージョンに置き換えたい

置き換えるファイルのダウンロード

JOGL(https://jogamp.org/deployment/archive/rc/ )のv2.4.0を選ぶ

スクリーンショット 2021-10-13 12.28.11.png

jar/を選択するとファイルがたくさんあるので、そこから欲しい4つのファイル

  • gluegen-rt.jar
  • gluegen-rt-natives-macosx-universal.jar
  • jogl-all.jar
  • jogl-all-natives-macosx-universal.jar

をダウンロードし、それぞれをContents/Java/core/library/に入っている既存のファイルと置き換えれば解決!

参考

Twitter(@ Hau_Kun さん): https://twitter.com/hau_kun/status/1332983730739105792
GitHubのissue: https://github.com/processing/processing/issues/5676

10
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
3