No More Retake

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

メニュー

Houdini:makebasis VEX

Houdini勉強回。最近知った関数。

makebasis()

以下、マニュアルのURL
https://www.sidefx.com/docs/houdini/vex/functions/makebasis.html

マニュアル曰く、”指定したzaxisベクトルから正規直交基底を作成して、xaxisとyaxisの基底ベクトルを構成”、するらしい。

なんのこっちゃ。

その機能を意訳すると、あるベクトルに直行するベクトルを2つ作ってくれる関数。
例えば、{1,0,0}に対してmakebasis関数を使うと、{0,1,0}, {0,0,1}の2つのベクトルを作ってくれると。

使い方は

void  makebasis(vector &xaxis, vector &yaxis, vector zaxis, vector u)

1番目と2番目の引数、xaxisとyaxisが生成されるベクトル。3番目の引数zaxisが入力として使うベクトル。4番目の引数uはupベクトルかな?yaxisがuの方向を基準になります。

例えば、L-systemで作ったラインに対して使ってあれやこれやすると、

orientが作れる。

ネットワークこんな感じ。

ラインに対してpolyframeでタンジェント方向にアトリビュートNを作り、あとWrangleでかきかき。

vector x, y;
makebasis(x, y, v@N, {0,1,0});
p@orient = quaternion(set(x, y, v@N));

これでorientアトリビュートの出来上がり。
以上!

関連記事

  1. 2016.02.08

    Houdini:SubFrame
  2. 2021.05.23

    Houdini:Magma
  3. 2017.12.11

    Houdini:Error(SOP)

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

このサイトについて

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%2F2020%2F11%2F29%2Fhoudinimakebasis-vex%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%2F2020%2F11%2F29%2Fhoudinimakebasis-vex%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