本文へ移動

Kyuubuキューブ

CSS 3Dのキューブをタッチ、キー、回転記号で回します。シードでスクランブルを再現し、名前付きの手順で解き方を追えます。

「キューブ」は、英語のcubeを表す日本語の表記です。 名前について(英語)

目次

リファレンス · キューブのエンジンと表示

viewMatrix関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The way the viewer looks at the cube: turned about the model's y (yaw), then tipped about the screen's x (pitch), in degrees.

インポート

import { viewMatrix } from "@johnmorrisdotca/kyuubu";

定義

function viewMatrix(yaw: number, pitch: number): Mat3

引数

名前型説明
yawnumber

The viewing angle about model y, in degrees.

pitchnumber

The viewing angle about screen x, in degrees.

戻り値

Mat3

The way the viewer looks at the cube: turned about the model's y (yaw), then tipped about the screen's x (pitch), in degrees.

例

import { viewMatrix } from "@johnmorrisdotca/kyuubu";

console.log(viewMatrix(-30, -20));
[
  [ 0.8660254037844387, 0, -0.49999999999999994 ],
  [ 0.17101007166283433, 0.9396926207859084, 0.29619813272602386 ],
  [ 0.46984631039295416, -0.3420201433256687, 0.8137976813493738 ]
]

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kyuubu 1.14.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。