Processing (BETA) version 135+ のリファレンスです。
旧バージョン使用者はソフトウェア内のリファレンスを参照してください。
この文書は Processing のAPIリファレンスを日本語に訳したものです。
最新の内容は 英語版 で確認して下さい。
| Name | modelZ() |
||||||
|---|---|---|---|---|---|---|---|
| Examples | // Adapted from http://dev.processing.org/bugs/show_bug.cgi?id=486
void setup() {
size(500, 500, P3D);
noFill();
}
void draw() {
background(0);
pushMatrix();
// start at the middle of the screen
translate(width/2, height/2);
// some random rotation to make things interesting
rotateY(1.0); //yrot);
rotateZ(2.0); //zrot);
// rotate in X a little more each frame
rotateX(frameCount / 100.0);
// offset from center
translate(0, 150, 0);
// draw a white box outline at (0, 0, 0)
stroke(255);
box(50);
// the box was drawn at (0, 0, 0), store that location
float x = modelX(0, 0, 0);
float y = modelY(0, 0, 0);
float z = modelZ(0, 0, 0);
// clear out all the transformations
popMatrix();
// draw another box at the same (x, y, z) coordinate as the other
pushMatrix();
translate(x, y, z);
stroke(255, 0, 0);
box(50);
popMatrix();
} |
||||||
| Description |
モデル空間内の3次元 X, Y, Z 位置を返します。
この関数は現在の変換関数(scale, rotate, translate, etc.)の影響下にある座標の Z 値を返します。
変換関数の影響下を抜けてから、空間内にオブジェクトを配置する際に、Z 値と原点の位置を組み合わせて使います。
例において、modelX(), modelY(), modelZ() は translate() や rotate() による変換が行われた後、 空間内の立方体(box)の位置を記録します。 popMatrix() が呼び出された時点で、これらの変換関数は影響力を失います。 しかし、modelX(), modelY(), modelZ() によって返される (x, y, z) 座標は同じ位置にもう1つ立方体(box)を配置することを可能にします。 /* Note:6 */ |
||||||
| Syntax | modelZ(x, y, z) |
||||||
| Parameters |
|
||||||
| Usage | Web & Application | ||||||
| Related | modelX() modelY() |
この文書の原文はクリエイティブ・コモンズ(Creative Commons)のAttribution-Noncommercial-Share Alike(表示・非営利・継承) ライセンスで公開されています。
このライセンスは同一の許諾条件の下で原作者のクレジットを表示し、また作品を営利目的で利用しなければ、作品に対して複製、頒布、展示、実演、二次的著作物の作成が行えることを示します。
© 2007 Processing.org
© 2007 Processing.org

