ポリゴンテスト & NAS6LIB ヘルプ ドキュメント






 






//################################################################
//Programed by NAS6
//################################################################
//./javascripts/nas6lib/timer.js
//./javascripts/nas6lib/vector.js
//./javascripts/nas6lib/matrix.js
//./javascripts/nas6lib/quaternion.js
//./javascripts/nas6lib/keyboard.js
//################################################################
//タイマー、ベクトル、行列、四元数、対数四元数、2/3D CG 行列計算 javascript ライブラリ
//################################################################





戻る





 ■■■ ./nas6lib/keyboard.js メモ ■■■ 

keyID、キーコード表です。

本名ID、U.S.標準キーボード

0xYX

0

1

2

3

4

5

6

7

8

9

A

B

C

D

E

F

0x0X

VK_$00

VK_LBUTTON

VK_RBUTTON

VK_CANCEL : Break

VK_MBUTTON

VK_XBUTTON1

VK_XBUTTON2

VK_$07

VK_BACK : BackSpace

VK_TAB : Tab

VK_$0A

VK_$0B

VK_CLEAR

VK_RETURN : Enter

VK_$0E

VK_$0F

0x1X

VK_SHIFT : Shift

VK_CONTROL : Ctrl

VK_MENU : Alt

VK_PAUSE

VK_CAPITAL

VK_KANA

VK_$16

VK_JUNJA

VK_FINAL

VK_KANJI

VK_$1A

VK_ESCAPE : Esc

VK_CONVERT : 変換

VK_NONCONVERT : 無変換

VK_ACCEPT

VK_MODCHANGE

0x2X

VK_SPACE : Space

VK_PRIOR : PgUp

VK_NEXT : PgDn

VK_END : End

VK_HOME : Home

VK_LEFT : ←

VK_UP : ↑

VK_RIGHT : →

VK_DOWN : ↓

VK_SELECT

VK_PRINT

VK_EXECUTE

VK_SNAPSHOT : Print Screen

VK_INSERT : Ins

VK_DELETE : Del

VK_HELP

0x3X

VK_0

VK_1

VK_2

VK_3

VK_4

VK_5

VK_6

VK_7

VK_8

VK_9

VK_$3A

VK_$3B

VK_$3C

VK_$3D

VK_$3E

VK_$3F

0x4X

VK_$40

VK_A

VK_B

VK_C

VK_D

VK_E

VK_F

VK_G

VK_H

VK_I

VK_J

VK_K

VK_L

VK_M

VK_N

VK_O

0x5X

VK_P

VK_Q

VK_R

VK_S

VK_T

VK_U

VK_V

VK_W

VK_X

VK_Y

VK_Z

VK_LWIN

VK_RWIN

VK_APPS

VK_$5E

VK_SLEEP

0x6X

VK_NUMPAD0

VK_NUMPAD1

VK_NUMPAD2

VK_NUMPAD3

VK_NUMPAD4

VK_NUMPAD5

VK_NUMPAD6

VK_NUMPAD7

VK_NUMPAD8

VK_NUMPAD9

VK_MULTIPLY : numpad *

VK_ADD : numpad +

VK_SEPARATOR : numpad enter

VK_SUBTRACT : numpad -

VK_DECIMAL : numpad .

VK_DIVIDE : numpad /

0x7X

VK_F1

VK_F2

VK_F3

VK_F4

VK_F5

VK_F6

VK_F7

VK_F8

VK_F9

VK_F10

VK_F11

VK_F12

VK_F13

VK_F14

VK_F15

VK_F16

0x8X

VK_F17

VK_F18

VK_F19

VK_F20

VK_F21

VK_F22

VK_F23

VK_F24

VK_$88

VK_$89

VK_$8A

VK_$8B

VK_$8C

VK_$8D

VK_$8E

VK_$8F

0x9X

VK_NUMLOCK : Num Lock

VK_SCROLL : Scroll Lock

VK_$92

VK_$93

VK_$94

VK_$95

VK_$96

VK_$97

VK_$98

VK_$99

VK_$9A

VK_$9B

VK_$9C

VK_$9D

VK_$9E

VK_$9F

0xAX

VK_LSHIFT

VK_RSHIFT

VK_LCONTROL

VK_RCONTROL

VK_LMENU

VK_RMENU

VK_BROWSER_BACK

VK_BROWSER_FORWARD

VK_BROWSER_REFRESH

VK_BROWSER_STOP

VK_BROWSER_SERCH

VK_BROWSER_FAVORITES

VK_BROWSER_HOME

VK_VOLUME_MUTE

VK_VOLUME_DOWN

VK_VOLUME_UP

0xBX

VK_MEDIA_NEXT_TRACK

VK_MEDIA_PREV_TRACK

VK_MEDIA_STOP

VK_MEDIA_PLAY_PAUSE

VK_LAUNCH_MAIL

VK_LAUNCH_MEDIA_SELECT

VK_LAUNCH_APP1

VK_LAUNCH_APP2

VK_$B8

VK_$B9

VK_OEM_1 : [:;]

VK_OEM_PLUS : [+]

VK_OEM_COMMA : [,]

VK_OEM_MINUS : [-]

VK_OEM_PERIOD : [.]

VK_OEM_2 : [/?]

0xCX

VK_OEM_3 : [`~]

VK_$C1

VK_$C2

VK_$C3

VK_$C4

VK_$C5

VK_$C6

VK_$C7

VK_$C8

VK_$C9

VK_$CA

VK_$CB

VK_$CC

VK_$CD

VK_$CE

VK_$CF

0xDX

VK_$D0

VK_$D1

VK_$D2

VK_$D3

VK_$D4

VK_$D5

VK_$D6

VK_$D7

VK_$D8

VK_$D9

VK_$DA

VK_OEM_4 : [[{]

VK_OEM_5 : [\|]

VK_OEM_6 : []}]

VK_OEM_7 : [']

VK_OEM_8

0xEX

VK_$E0

VK_OEM_AX

VK_OEM_102 : [\_]

VK_ICO_HELP

VK_ICO_00

VK_PROCESSKEY

VK_ICO_CLEAR

VK_PACKET

VK_$E8

VK_OEM_RESET

VK_OEM_JUMP

VK_OEM_PA1

VK_OEM_PA2

VK_OEM_PA3

VK_OEM_WSCTRL

VK_OEM_CUSEL

0xFX

VK_OEM_ATTN

VK_OEM_FINISH

VK_OEM_COPY

VK_OEM_AUTO

VK_OEM_ENLW

VK_OEM_BACKTAB

VK_ATTN

VK_CRSEL

VK_EXSEL

VK_EREOF

VK_PLAY

VK_ZOOM

VK_NONAME

VK_PA1

VK_OEM_CLEAR

VK_$FF


本名ID, 別名ID

VK_RETURN, VK_ENTER

VK_ESCAPE, VK_ESC

VK_OEM_MINUS, VK_-

VK_OEM_7, VK_^

VK_NUMPAD1, VK_N1

VK_NUMPAD2, VK_N2

VK_NUMPAD3, VK_N3

VK_NUMPAD4, VK_N4

VK_NUMPAD5, VK_N5

VK_NUMPAD6, VK_N6

VK_NUMPAD7, VK_N7

VK_NUMPAD8, VK_N8

VK_NUMPAD9, VK_N9

VK_NUMPAD0, VK_N0

VK_DECIMAL, VK_N.

VK_ADD, VK_N+

VK_SUBTRACT, VK_N-

VK_MULTIPLY, VK_N*

VK_DIVIDE, VK_N/

VK_NUMLOCK, VK_NLK

VK_OEM_5, VK_|

VK_OEM_3, VK_@

VK_OEM_4, VK_[

VK_OEM_PLUS, VK_;

VK_OEM_1, VK_:

VK_OEM_6, VK_]

VK_OEM_COMMA, VK_,

VK_OEM_PERIOD, VK_.

VK_OEM_2, VK_/

VK_OEM_102, VK__

VK_CONTROL, VK_CTRL

VK_MENU, VK_ALT

VK_CONVERT, VK_CNVT

VK_NONCONVERT, VK_NONCNVT

VK_PRIOR, VK_PGUP

VK_NEXT, VK_PGDN

VK_LEFT, VK_←

VK_UP, VK_↑

VK_RIGHT, VK_→

VK_DOWN, VK_↓

VK_INSERT, VK_INS

VK_DELETE, VK_DEL

VK_SCROLL, VK_SLK

VK_SNAPSHOT, VK_PRTSCRN

VK_OEM_ATTN, VK_CLK

VK_OEM_COPY, VK_KANA

VK_OEM_ENLW, VK_ZEN

VK_OEM_AUTO, VK_ZEN2

VK_PAUSE, VK_BRK

VK_CLEAR, VK_CLS

---

---

---

---

---

---


本名IDと別名IDの相互変換はKeyB.ToReal(str)とKeyB.ToAlias(str, ary){配列aryに別名リストが返る}でできます。
if(KeyB.keystate[KeyB.indexof(KeyB.ToReal(str))])でキーボードの押し下げ判定ができます。
KeyB.addAlias([元IDstr, 別IDstr])で別名追加定義。KeyB.delAlias(str)で別名の紐付けも一緒に削除。
KeyB.addUnityAlias([統一されたIDstr, 別IDstr, ...])で統一別名追加定義。KeyB.delUnityAlias(str)で統一別名を削除。
KeyB.UnityAlias(aliasID)で別名の統一。
KeyB.isPressUnityAlias(aliasID)で統一別名の押し下げ情報取得。
unity関連で複数のキーを1つのキーとして処理できます。

■NAS6LIB ヘルプ ドキュメント■


//######## N6LTimerMan ########
//./javascripts/nas6lib/timer.js
//######## タイマーマネージャー ########

N6LTimerMan:構築

N6LTimerMan.add()
N6LTimerMan.changeinterval(int)
N6LTimerMan.start()
N6LTimerMan.stop()

//######## N6LTimerMan.timer[id] ########
//./javascripts/nas6lib/timer.js
//######## タイマー ########
//id:タイマー番号

N6LTimerMan.timer[id].start()
N6LTimerMan.timer[id].stop()
N6LTimerMan.timer[id].reset()
N6LTimerMan.timer[id].copy(src)
N6LTimerMan.timer[id].now()
N6LTimerMan.timer[id].setalerm(func(id),alm)

//######## N6LVector ########
//./javascripts/nas6lib/vector.js
//######## ベクトル ########

N6LVector:構築

N6LVector.Equal(rh)
N6LVector.EpsEqual(rh, eps)
N6LVector.Str()
N6LVector.Parse(str)
N6LVector.ToX3DOM(b)
N6LVector.FromX3DOM(sf)
N6LVector.To3JS(b)
N6LVector.From3JS(ary)
N6LVector.Add(rh)
N6LVector.Sub(rh)
N6LVector.Mul(rh)
N6LVector.Div(rh)
N6LVector.SetHomo(rh)
N6LVector.Repair(eps)
N6LVector.Dot(rh)
N6LVector.Cross(rh)
N6LVector.isParallel(rh)
N6LVector.Max()
N6LVector.DivMax()
N6LVector.LookAtMat2(rh)
N6LVector.RotArcQuat(rh)
N6LVector.ZeroVec()
N6LVector.UnitVec(a)
N6LVector.NormalVec(a)
N6LVector.SquareAbs()
N6LVector.Abs()
N6LVector.DirectionCosine()
N6LVector.Theta(rh)
N6LVector.ThetaN(rh)
N6LVector.Rot2D(theta)
N6LVector.RotAxis(axis, theta)
N6LVector.RotAxisQuat(axis, theta)
N6LVector.RotAxisVec(rotvec)
N6LVector.ProjectAxis(axis)
N6LVector.DistanceDotLine(p, a, b)
N6LVector.DistancePointLineLine(reta, retb, a0, a1, b0, b1)
N6LVector.PointLineLine(reta, retb, a0, a1, b0, b1)
N6LVector.DistanceLineLine(a0, a1, b0, b1)
N6LVector.Homogeneous()
N6LVector.ToHomo()
N6LVector.ToNormal()
N6LVector.Matrix()
N6LVector.PosVecGetTQ(out)
N6LVector.PosVecSetTQ(t,q)
N6LVector.PosVecMatrix()
N6LVector.PosVecMul(rh)
N6LVector.Sphere4D()
N6LVector.FromLogAxis(base, range, x)
N6LVector.ToLogAxis(base, range, x)
N6LVector.FrustumInfVec(base, range, v)
N6LVector.InvFrustumInfVec(base, range, v, z)

//######## N6LMatrix ########
//./javascripts/nas6lib/matrix.js
//######## 行列 ########

N6LMatrix:構築

N6LMatrix.Equal(rh)
N6LMatrix.EpsEqual(rh, eps)
N6LMatrix.Str()
N6LMatrix.Parse(str)
N6LMatrix.ToX3DOM()
N6LMatrix.FromX3DOM(sf)
N6LMatrix.To3JS()
N6LMatrix.From3JS(ary)
N6LMatrix.GetCol(rh)
N6LMatrix.GetRow(rh)
N6LMatrix.SetCol(rh, val)
N6LMatrix.SetRow(rh, val)
N6LMatrix.Add(rh)
N6LMatrix.Sub(rh)
N6LMatrix.Mul(rh)
N6LMatrix.Div(rh)
N6LMatrix.SetHomo(rh)
N6LMatrix.Repair(eps)
N6LMatrix.Max()
N6LMatrix.DivMax()
N6LMatrix.ZeroMat()
N6LMatrix.UnitMat()
N6LMatrix.NormalMat()
N6LMatrix.TransposedMat()
N6LMatrix.TranslatedMat(rh)
N6LMatrix.ScaleMat(rh)
N6LMatrix.AffineMat(scale, rotate, translate)
N6LMatrix.MoveMat(outmat, outv, d, pyr, v, a, vmin, vmax)
N6LMatrix.LookAtMat(eye, lookat, up)
N6LMatrix.LookAtMat2(rh)
N6LMatrix.InverseMat(dt, sw)
N6LMatrix.InverseMat00(dt)
N6LMatrix.InverseMat01(dt)
N6LMatrix.DeterminMatInvMat(dt)
N6LMatrix.DeterminMat(dt)
N6LMatrix.Jacobi(n, ct, eps, A, A1, A2, X1, X2)
N6LMatrix.EigenVec(ct, eps, A, det, eigen)
N6LMatrix.DiagonalMat(ct, eps)
N6LMatrix.Diagonal(ct, eps)
N6LMatrix.Rot2D(theta)
N6LMatrix.RotAxis(axis, theta)
N6LMatrix.RotAxisQuat(axis, theta)
N6LMatrix.RotAxisVec(rotvec)
N6LMatrix.Homogeneous()
N6LMatrix.ToHomo()
N6LMatrix.ToNormal()
N6LMatrix.Pos()
N6LMatrix.Scale()
N6LMatrix.Trace()
N6LMatrix.Quaternion()
N6LMatrix.Vector()
N6LMatrix.PosVector()
N6LMatrix.FrustumMat(left, right, top, bottom, near, far)
N6LMatrix.OrthoMat(left, right, top, bottom, near, far)
N6LMatrix.Householder()
N6LMatrix.QRMethod()
N6LMatrix.EulerAngle(first, second, third, eps)

//######## N6LQuaternion ########
//./javascripts/nas6lib/quaternion.js
//######## 四元数 ########

N6LQuaternion:構築

N6LQuaternion.Equal(rh)
N6LQuaternion.EpsEqual(rh, eps)
N6LQuaternion.Str()
N6LQuaternion.Parse(str)
N6LQuaternion.Add(rh)
N6LQuaternion.Sub(rh)
N6LQuaternion.Mul(rh)
N6LQuaternion.Div(rh)
N6LQuaternion.DivMax()
N6LQuaternion.Repair(eps)
N6LQuaternion.SquareAbs()
N6LQuaternion.Abs()
N6LQuaternion.ConjugationQuat()
N6LQuaternion.InverseQuat()
N6LQuaternion.ZeroQuat()
N6LQuaternion.UnitQuat()
N6LQuaternion.NormalQuat()
N6LQuaternion.Dot(rh)
N6LQuaternion.RotAxisQuat(axis, theta)
N6LQuaternion.RotAxisVec(rotvec)
N6LQuaternion.Axis(axis, theta)
N6LQuaternion.Matrix()
N6LQuaternion.Lerp(q, t)
N6LQuaternion.Slerp(q, t)
N6LQuaternion.Slerp2(q, t)
N6LQuaternion.Sphere4D()

//######## N6LLnQuaternion ########
//./javascripts/nas6lib/quaternion.js
//######## 対数四元数 ########

N6LLnQuaternion:構築

N6LLnQuaternion.Equal(rh)
N6LLnQuaternion.EpsEqual(rh, eps)
N6LLnQuaternion.Str()
N6LLnQuaternion.Parse(str)
N6LLnQuaternion.Add(rh)
N6LLnQuaternion.Sub(rh)
N6LLnQuaternion.Mul(rh)
N6LLnQuaternion.Div(rh)
N6LLnQuaternion.DivMax()
N6LLnQuaternion.Repair(eps)
N6LLnQuaternion.SquareAbs()
N6LLnQuaternion.Abs()
N6LLnQuaternion.ZeroLnQuat()
N6LLnQuaternion.RotAxisLnQuat(axis, theta)
N6LLnQuaternion.Axis(axis, theta)
N6LLnQuaternion.Lerp(q, t)
N6LLnQuaternion.Lerp2(d0, q, d)

//######## N6LKeyBoard ########
//./javascripts/nas6lib/keyboard.js
//######## キーボード ########

N6LKeyBoard:構築

N6LKeyBoard.setfunc(func)
N6LKeyBoard.setenable(b)
N6LKeyBoard.indexof(str)
N6LKeyBoard.addAlias(ary)
N6LKeyBoard.delAlias(str)
N6LKeyBoard.addUnityAlias(ary)
N6LKeyBoard.delUnityAlias(str)
N6LKeyBoard.UnityAlias(str)
N6LKeyBoard.isPressUnityAlias(str)
N6LKeyBoard.ToAlias(str, ret)
N6LKeyBoard.ToReal(str)