LoginSignup
4
2

More than 3 years have passed since last update.

Processingで3次元空間上に文字をかくやり方

Last updated at Posted at 2019-09-03

やりたいこと

3次元空間では視点を変えると、単にtext()で表示させているだけの文字も移動してしまう。デカルト座標に依存せずに画面に文字を固定表示させたい。

実装方法

void showText3d(String str1) {
  pushMatrix();
  camera();
  hint(DISABLE_DEPTH_TEST);
  noLights();
  textMode(MODEL);
  text(str1, 20, 20);
  hint(ENABLE_DEPTH_TEST);
  popMatrix();
}

pushMatrix()とpopMatrix()の組み合わせで解決。

4
2
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
4
2