ベクトルの特定成分を取り出す

投稿者:ヘイホーの叫び
投稿日:2024/7/30
ジャンル:技術・機構
環境:通常
情報番号:15

構文
参照する視線を持つエンティティを<object>とします。
座標の基準点を<coordinates>とします。
ベクトルの大きさをrとします。

①x成分の取り出し
/execute
as <target>
at @s
positioned 0.0 0.0 0.0
positioned ^ ^ ^-2
positioned ~ 0.0 0.0
positioned ^ ^ ^1
facing 0.0 0.0 0.0
positioned <coordinates>
positioned ^ ^ ^r/2
rotated as @s
positioned ^ ^ ^r/2
run
<command>

②y成分の取り出し
/execute
as <target>
at @s
rotated ~180 ~
positioned <coordinates>
positioned ^ ^ ^r/2
rotated as @s
positioned ^ ^ ^r/2
run
<command>

③z成分の取り出し
/execute
as <target>
at @s
positioned 0.0 0.0 0.0
positioned ^ ^ ^-2
positioned 0.0 0.0 ~
positioned ^ ^ ^1
facing 0.0 0.0 0.0
positioned <coordinates>
positioned ^ ^ ^r/2
rotated as @s
positioned ^ ^ ^r/2
run
<command>

説明
視線ベクトルについて、特定軸方向の成分を取り出します。
大きさは任意で変更できます。

特定軸方向に関する視線反転
をベースにしています
最終更新:2024年12月25日 15:24
|新しいページ |検索 |ページ一覧 |RSS |@ウィキご利用ガイド |管理者にお問合せ
|ログイン|