No More Retake

3DCG屋さん向けTips&Referenceサイト

メニュー

Houdini:NDCって何さ!

Houdiniを使っていて、NDCという座標系に触れる機会が増えました。
なので、そのメモ。

NDCは「Normal Device Cordinates」の略で日本語にすると、標準デバイス座標というらしい。
もっと噛み砕いて言うと、カメラを基準にした座標系、だそうです。
カメラからのdepthを作ったり、ベクターブラ―を作ったり、ともかくカメラ基準で何かしたいときに重宝してます。

NDC_v012カメラの位置が原点で、x座標とy座標は、それぞれカメラに映る領域が0~1の範囲に収まるようになっています(正規化)。
Z座標は、カメラから被写体方向にマイナス値で大きくなっていきます。遠ければその分大きなマイナス値になります。

NDC_v04座標の変換用に、Transorm(VEX)というノードがあります。いろんな座標系を行ったり来たり変換できます。
これを使うと座標をNDCに変換できるます。

NDC_v07

また、World SpaceとNDCの変換に特化したノードもあります。
“To NDC”と”from NDC”です。World SpaceからNDCへ変換するのと、その逆ですね。

NDC_v03これ使って四角を変形させてカメラの表示領域にフィットさせてみます。

NDC_v05formNDC(VEX)を使ってこう。

NDC_v06これだけ。(カメラは指定する)
NDC座標の形にしたいからtoNDC(VEX)を使いそうだけど、この場合はNDCでの座標をworld spaceに反映したいのだからformNDCを使うのが正解。
位置は、xとyは0~1の範囲、zは0からマイナスの範囲にあれば、カメラに写る範囲になる。

サンプルファイルndc_sample.hiplc

 

以上、NDCのメモでした。
間違い不足等ありましたらご指摘を!!

 


「参考URL」

http://www.mascotcapsule.com/ja/alldata/samples/brew_v4/xyz_camera.php

http://wgld.org/d/webgl/w069.html

http://chocolapod.sakura.ne.jp/blog/entry/34

https://books.google.co.jp/books?id=wS4uuiEK0QcC&pg=PT78&lpg=PT78&dq=%E3%82%AF%E3%83%AA%E3%83%83%E3%83%97%E5%BA%A7%E6%A8%99%E7%B3%BB&source=bl&ots=TvwXaFA1az&sig=UVpcF91eJnVCcvr6CrRdiP9q-Uw&hl=ja&sa=X&ved=0CFgQ6AEwCWoVChMI0YGFxquCyAIVyBKUCh05XACO#v=onepage&q=%E3%82%AF%E3%83%AA%E3%83%83%E3%83%97%E5%BA%A7%E6%A8%99%E7%B3%BB&f=false

関連記事

コメントをお待ちしております

このサイトについて

3DCG Tipsサイト。Houdiniの記事が多めです。

RSS

follow us in feedly

Archives

  • 2024 (1)
  • 2023 (2)
  • 2022 (9)
  • 2021 (14)
  • 2020 (46)
  • 2019 (17)
  • 2018 (33)
  • 2017 (29)
  • 2016 (36)
  • 2015 (64)
  • 2014 (54)
  • 2013 (60)
  • 2012 (55)

スポンサードリンク

言語切り替え

  • English (United States)
  • 日本語

スポンサードリンク

言語切り替え

  • English (United States)
  • 日本語

Houdiniを使えるようになる本


Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): Failed to enable crypto in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(http://api.facebook.com/restserver.php?method=links.getStats&urls=http%3A%2F%2Fnomoreretake.net%2F2015%2F12%2F23%2Fhoudini_ndc%2F): failed to open stream: operation failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): Failed to enable crypto in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(http://api.b.st-hatena.com/entry.count?url=http%3A%2F%2Fnomoreretake.net%2F2015%2F12%2F23%2Fhoudini_ndc%2F): failed to open stream: operation failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132