ãªãç·åœ¢ä»£æ°ãå¿ èŠãªã®ã§ããïŒ
ç·åœ¢ä»£æ°ã®æ¹åã®1ã€ã¯ããã¯ãã«ã®ç 究ã§ãã ã²ãŒã ã§ç»é¢äžã®ãã¿ã³ã®é 眮ã䜿çšããã«ã¡ã©ãšãã®æ¹åããªããžã§ã¯ãã®é床ãæäœããå Žåããã¯ãã«ãåŠçããå¿ èŠããããŸãã ç·åœ¢ä»£æ°ãããç解ããã°ããã»ã©ããã¯ãã«ã®æ¯ãèããã²ããŠã¯ã²ãŒã ããã现ããå¶åŸ¡ã§ããŸãã
ãã¯ã¿ãŒãšã¯äœã§ããïŒ
ã²ãŒã ã§ã¯ããã¯ãã«ã¯äœçœ®ãæ¹åãé床ãä¿åããããã«äœ¿çšãããŸãã 以äžã¯ã2次å ãã¯ãã«ã®äŸã§ãã
ãã±ãŒã·ã§ã³ãã¯ãã«ïŒ "ååŸãã¯ãã«"ãšãåŒã°ããŸãïŒã¯ã人ãåºçºç¹ããæ±2ã¡ãŒãã«ãå1ã¡ãŒãã«ã«ããããšã瀺ããŸãã é床ãã¯ãã«ã¯ãæéåäœã§å¹³é¢ã3ããã¡ãŒãã«äžãå·Šã«2ããã¡ãŒãã«ç§»åããããšã瀺ããŠããŸãã æ¹åãã¯ãã«ã¯ãéãå³ãåããŠããããšã瀺ããŠããŸãã
ã芧ã®ãšããããã¯ãã«èªäœã¯ãã³ã³ããã¹ãã«å¿ããŠäœããã®æå³ãæã€æ°åã®ã»ããã«ãããŸããã ããšãã°ããã¯ãã«ïŒ1ã0ïŒã¯ãå³ã«ç€ºãããã«æŠåšã®æ¹åãšãçŸåšã®äœçœ®ãã1ãã€ã«æ±ã«ããæ§é äœã®åº§æšã®äž¡æ¹ã«ãªããŸãã ãŸãã¯ã1æéããã1ãã€ã«ã®é床ã§å³ã«ç§»åããã«ã¿ãã ãªã®éåºŠïŒ ç¿»èš³è ã®ã¡ã¢ïŒã«ã¿ãã ãªã®å Žåã¯ããªãéãã1ç§ããã44ã»ã³ãã¡ãŒãã« ïŒã
ãŠãããã远跡ããããšãéèŠã§ãã ãã¯ãã«VïŒ3,5,2ïŒããããšããŸãã ããã¯ã»ãšãã©ããããŸããã 3ã€ã®çç±ã5ã€ã®çç±ã¯ïŒ ãªãŒããŒã°ããŒã¹ã²ãŒã ã§ã¯ãè·é¢ã¯ã¡ãŒãã«ã§ãé床ã¯ã¡ãŒãã«/ç§ã§ç€ºãããŸãã ãã®ãã¯ãã«ã®æåã®æ°å€ã¯æ±æ¹åã2çªç®ã¯äžæ¹åã3çªç®ã¯åæ¹åã§ãã è² ã®æ°å€ã¯ã西ãäžãåã®å察æ¹åã瀺ããŸãã 次ã®å³ã«ç€ºãããã«ããã¯ãã«VïŒ3,5,2ïŒã§å®çŸ©ãããäœçœ®ã¯ãæ±3ã¡ãŒãã«ãäž5ã¡ãŒãã«ãå2ã¡ãŒãã«ã«ãããŸãã
ããã§ããã¯ãã«ãæ±ãåºæ¬ãåŠã³ãŸããã 次ã«ããã¯ã¿ãŒã®äœ¿çšæ¹æ³ãåŠã³ãŸãã
ãã¯ãã«å ç®
ãã¯ãã«ãè¿œå ããã«ã¯ãããããã®ã³ã³ããŒãã³ããäºãã«è¿œå ããã ãã§ãã äŸïŒ
ïŒ0ã1ã4ïŒ+ïŒ3ã-2ã5ïŒ=ïŒ0 + 3ã1-2ã4 + 5ïŒ=ïŒ3ã-1ã9ïŒ
ãªããã¯ã¿ãŒãè¿œå ããå¿ èŠãããã®ã§ããïŒ ã»ãšãã©ã®å Žåãã²ãŒã ã§ã®ãã¯ãã«ã®è¿œå ã¯ç©ççãªçµ±åã«äœ¿çšãããŸãã ç©çãªããžã§ã¯ãã«ã¯ãäœçœ®ãé床ãå é床ã®ãã¯ãã«ãå«ãŸããŸãã åãã¬ãŒã ïŒéåžžã¯60åã®1ç§ïŒã§ã2ã€ã®ãã¯ãã«ãçµ±åããå¿ èŠããããŸããäœçœ®ã«é床ãè¿œå ããé床ã«å é床ãè¿œå ããŸãã
ããªãªãžã£ã³ãã®äŸãèŠãŠã¿ãŸãããã äœçœ®ïŒ0ã0ïŒããå§ãŸããŸãã ãžã£ã³ããéå§ãããç¬éããã®é床ïŒ1ã3ïŒã§ãããã«å³äžã«ç§»åããŸãã éåã«ãã£ãŠåŒãäžãããããããå é床ã¯ïŒ0ã-1ïŒã§ãã åçã¯ã圌ã®ãžã£ã³ããã©ã®ããã«èŠãããã7ã€ã®ãã¬ãŒã ã«åããŠç€ºããŠããŸãã é»ãããã¹ãã¯ãåãã¬ãŒã ã®é床ã瀺ããŠããŸãã
æåã®ãã¬ãŒã ã詳现ã«èŠãŠããã¹ãŠãã©ã®ããã«èµ·ããããç解ããŸãããã
æåã®ãã¬ãŒã ã§ã¯ãããªãªã®é床ïŒ1ã3ïŒããã®äœçœ®ïŒ0ã0ïŒã«è¿œå ããæ°ãã座æšïŒ1ã3ïŒãååŸããŸãã 次ã«ãå é床ïŒ0ã-1ïŒã«é床ïŒ1ã3ïŒãè¿œå ããããªãªã®é床ïŒ1ã2ïŒã®æ°ããå€ãååŸããŸãã
2çªç®ã®ãã¬ãŒã ã«ãåãããšãè¡ããŸãã äœçœ®ïŒ1ã3ïŒã«é床ïŒ1ã2ïŒãè¿œå ãã座æšïŒ2ã5ïŒãååŸããŸãã 次ã«ãé床ïŒ1ã2ïŒã«å é床ïŒ0ã-1ïŒãè¿œå ããæ°ããé床ïŒ1ã1ïŒãååŸããŸãã
éåžžããã¬ãŒã€ãŒã¯ããŒããŒããŸãã¯ã²ãŒã ãããã䜿çšããŠã²ãŒã ãã£ã©ã¯ã¿ãŒã®å éãå¶åŸ¡ããã²ãŒã ã¯ç©ççãªè¿œå ïŒãã¯ãã«ã®è¿œå ã«ããïŒã䜿çšããŠé床ãšäœçœ®ã®æ°ããå€ãèšç®ããŸãã ããã¯ç©åèšç®ã§è§£æ±ºãããã®ãšåãåé¡ã§ãããã²ãŒã ã®ããã«åçŽåããã ãã§ãã å ã»ã©èª¬æããå®éã®å¿çšã«ã€ããŠèããŠãç©åèšç®ã«é¢ããè¬çŸ©ã泚ææ·±ãèãæ¹ãã¯ããã«ç°¡åã§ããããšã«æ°ä»ããŸããã
ãã¯ãã«ã®æžç®
æžç®ã¯å ç®ãšåãåçã«åŸã£ãŠèšç®ãããŸã-ãã¯ãã«ã®å¯Ÿå¿ããæåãæžç®ããŸãã ãã¯ãã«ã®æžç®ã¯ãããå Žæããå¥ã®å ŽæãŸã§ã瀺ããã¯ãã«ãååŸããã®ã«äŸ¿å©ã§ãã ããšãã°ããã¬ãŒã€ãŒãã¬ãŒã¶ãŒéã®åº§æšïŒ1ã2ïŒã«ãããæµããããã座æšïŒ4ã3ïŒã«ãããšããŸãã ããããã«åœããã¬ãŒã¶ãŒããŒã ã®åããã¯ãã«ã決å®ããã«ã¯ãããããã®äœçœ®ãããã¬ã€ã€ãŒã®äœçœ®ãæžç®ããå¿ èŠããããŸãã ååŸãããã®ïŒ
ïŒ4ã3ïŒ-ïŒ1ã2ïŒ=ïŒ4-1ã3-2ïŒ=ïŒ3ã1ïŒã
ãã¯ãã«ã«ã¹ã«ã©ãŒãæãã
ãã¯ãã«ã«ã€ããŠè©±ããšããåã ã®æ°å€ãã¹ã«ã©ãŒãšåŒã³ãŸãã ããšãã°ãïŒ3ã4ïŒã¯ãã¯ãã«ã§ã5ã¯ã¹ã«ã©ãŒã§ãã ã²ãŒã ã§ã¯ãå€ãã®å Žåããã¯ãã«ã«æ°å€ïŒã¹ã«ã©ãŒïŒãæããå¿ èŠããããŸãã ããšãã°ãåãã¬ãŒã ã§ãã¬ãŒã€ãŒã®é床ã«0.9ãæããŠãåçŽãªç©ºæ°æµæãã·ãã¥ã¬ãŒãããŸãã ãããè¡ãã«ã¯ããã¯ãã«ã®åã³ã³ããŒãã³ããã¹ã«ã©ãŒã§ä¹ç®ããå¿ èŠããããŸãã ãã¬ãŒã€ãŒã®é床ãïŒ10ã20ïŒã®å Žåãæ°ããé床ã¯æ¬¡ã®ããã«ãªããŸãã
0.9 *ïŒ10ã20ïŒ=ïŒ0.9 * 10ã0.9 * 20ïŒ=ïŒ9ã18ïŒã
ãã¯ãã«ã®é·ã
é床ãã¯ãã«VïŒ4ã3ïŒã®è¹ãããå Žåãã¹ã¯ãªãŒã³ã¹ããŒã¹ã®å¿ èŠæ§ãŸãã¯å¿ èŠãªçæéãèšç®ããããã«ã©ãã ãéãåããã調ã¹ãå¿ èŠããããŸãã ãããè¡ãã«ã¯ããã¯ãã«Vã®é·ãïŒã¢ãžã¥ãŒã«ïŒãèŠã€ããå¿ èŠããããŸãããã¯ãã«ã®é·ãã¯åçŽç·ã§ç€ºãããŸãããã®å Žåããã¯ãã«Vã®é·ãã¯| V |ãšç€ºãããŸãã
Vã蟺4ãš3ã®çŽè§äžè§åœ¢ãšããŠè¡šãããšãã§ãããã¿ãŽã©ã¹ã®å®çã䜿çšããŠãåŒããæ蟺ãååŸããŸããx 2 + y 2 = h 2
ãã®å Žåãå¹³æ¹æ ¹ããæåïŒxãyïŒãæã€ãã¯ãã«Hã®é·ããååŸããŸãïŒsqrtïŒx 2 + y 2 ïŒã
ãããã£ãŠãç§ãã¡ã®è¹ã®é床ã¯æ¬¡ã®ãšããã§ãã
| V | = sqrtïŒ4 2 + 3 2 ïŒ= sqrtïŒ25ïŒ= 5
ãã®ã¢ãããŒãã¯ã3次å ãã¯ãã«ã«ã䜿çšãããŸãã æåïŒxãyãzïŒãå«ããã¯ãã«ã®é·ãã¯ãsqrtïŒx 2 + y 2 + z 2 ïŒãšããŠèšç®ãããŸãã
è·é¢
ãã¬ã€ã€ãŒPããã€ã³ãïŒ3ã3ïŒã«ãããççºããã€ã³ãEã§åº§æšïŒ1ã2ïŒã«ãã£ãŠçºçããå Žåããã¬ã€ã€ãŒã«äžãããããã¡ãŒãžã®çšåºŠãèšç®ããããã«ããã¬ã€ã€ãŒãšççºã®éã®è·é¢ã決å®ããå¿ èŠããããŸãã ããã¯ãäžèšã®2ã€ã®æäœïŒãã¯ãã«ãšãã®é·ãã®æžç®ïŒãçµã¿åãããããšã§ç°¡åã«å®è¡ã§ããŸãã
P-Eãæžç®ããŠããããã®éã®ãã¯ãã«ãååŸããŸãã 次ã«ããã®ãã¯ãã«ã®é·ãã決å®ããŸããããã«ãããæãŸããè·é¢ãåŸãããŸãã ãªãã©ã³ãã®é åºã¯ããã§ã¯é¢ä¿ãããŸãã| E-P | åãçµæãåŸãããŸãã
è·é¢= | P-E | = |ïŒ3ã3ïŒ-ïŒ1ã2ïŒ| = |ïŒ2ã1ïŒ| = sqrtïŒ2 2 +1 2 ïŒ= sqrtïŒ5ïŒ= 2.23
æ£èŠå
ïŒäœçœ®ãé床ã§ã¯ãªãïŒæ¹åãæ±ãå Žåãæ¹åãã¯ãã«ã®é·ãã1ã«çããããšãéèŠã§ãã ããã¯ç§ãã¡ã®ç掻ãå€§å¹ ã«ç°¡çŽ åããŸãã ããšãã°ãéãïŒ1ã0ïŒæ¹åã«å±éãããæ¯ç§20ã¡ãŒãã«ã®é床ã§çºå°äœãçºå°ãããšããŸãã ãã®å Žåãçºå°ãããçºå°äœã®é床ãã¯ãã«ã¯äœã§ããïŒ
æ¹åãã¯ãã«ã®é·ãã¯1ã«çããã®ã§ãæ¹åã«çºå°äœã®é床ãæããŠãé床ãã¯ãã«ïŒ20ã0ïŒãååŸããŸãã ãã ããæ¹åãã¯ãã«ã®é·ãã1以å€ã®å Žåããããè¡ãããšã¯ã§ããŸããã çºå°ç©ã¯éããããé ããããã®ããããã§ãã
é·ãã1ã«çãããã¯ãã«ã¯ããæ£èŠåããšåŒã°ããŸãã ãã¯ãã«ãæ£èŠåããæ¹æ³ã¯ïŒ ãšãŠãç°¡åã§ãã ãã¯ãã«ã®åã³ã³ããŒãã³ãããã®é·ãã§é€ç®ããŸãã ããšãã°ããã¯ãã«Vãã³ã³ããŒãã³ãïŒ3ã4ïŒã§æ£èŠåããå Žåãåã³ã³ããŒãã³ãããã®é·ãã§ãã€ãŸã5ã§é€ç®ããïŒ3/5ã4/5ïŒãååŸããŸãã 次ã«ããã¿ãŽã©ã¹ã®å®çã䜿çšããŠããã®é·ãã1ã«çããããšã確èªããŸãã
ïŒ3/5ïŒ 2 +ïŒ4/5ïŒ 2 = 9/25 + 16/25 = 25/25 = 1
ãã¯ãã«ã®ã¹ã«ã©ãŒç©
ã¹ã«ã©ãŒç©ïŒâ¢ãšè¡šèšïŒãšã¯äœã§ããïŒ 2ã€ã®ãã¯ãã«ã®ã¹ã«ã©ãŒç©ãèšç®ããã«ã¯ããããã®æåãä¹ç®ããçµæãå ç®ããå¿ èŠããããŸã
ïŒa1ãa2ïŒâ¢ïŒb1ãb2ïŒ= a1b1 + a2b2
äŸïŒïŒ3ã2ïŒâ¢ïŒ1ã4ïŒ= 3 * 1 + 2 * 4 =11ãããã¯äžèŠç¡é§ã«æããŸããã詳ããèŠãŠã¿ãŸãããã
ããã§ããã¯ãã«ãäžæ¹åãæããŠããå Žåããããã®ã¹ã«ã©ãŒç©ã¯ãŒããã倧ããããšãããããŸãã ããããäºãã«åçŽã§ããå Žåãã¹ã«ã©ãŒç©ã¯ãŒãã§ãã ãããŠãããããå察æ¹åãæããšãããããã®ã¹ã«ã©ãŒç©ã¯ãŒãæªæºã§ãã
åºæ¬çã«ããã¯ãã«ã®ã¹ã«ã©ãŒç©ã䜿çšããŠãäžæ¹åã«ã©ãã ãã®ãã¯ãã«ãããããèšç®ã§ããŸãã ãããŠãããã¯ã¹ã«ã©ãŒç©ã®å¯èœæ§ã®ã»ãã®äžéšã«ãããŸãããããã§ã«éåžžã«äŸ¿å©ã§ãã
GïŒ1ã3ïŒã«äœçœ®ãã180床ã®èŠè§ã§æ¹åDïŒ1,1ïŒãèŠãŠããã¬ãŒãããããšããŸãã ã²ãŒã ã®äž»äººå ¬ã¯HïŒ3ã2ïŒã®äœçœ®ãã圌ãã¹ãã€ããŸãã äž»äººå ¬ãèŠåå¡ã®èŠçã«ãããã©ãããå€æããæ¹æ³ã¯ïŒ ããã¯ããã¯ãã«DãšVïŒã¬ãŒãããã¡ã€ã³ãã£ã©ã¯ã¿ãŒã«åãããããã¯ãã«ïŒã®ã¹ã«ã©ãŒç©ã«ãã£ãŠè¡ããŸãã 次ã®ãã®ãåŸãããŸãã
V = H-G =ïŒ3ã2ïŒ-ïŒ1ã3ïŒ=ïŒ3-1ã2-3ïŒ=ïŒ2ã-1ïŒ
Dâ¢V =ïŒ1ã1ïŒâ¢ïŒ2ã-1ïŒ= 1 * 2 + 1 * -1 = 2-1 = 1
åäœã¯ãŒããã倧ãããããäž»äººå ¬ã¯èŠåå¡ã®èŠçã«ããŸãã
ã¹ã«ã©ãŒç©ããã¯ãã«ã®æ¹åã®æ±ºå®ã«é¢é£ããŠããããšã¯ãã§ã«ããã£ãŠããŸãã ãããŠãããæ£ç¢ºãªå®çŸ©ã¯äœã§ããïŒ ãã¯ãã«ã®ã¹ã«ã©ãŒç©ã®æ°åŠè¡šçŸã¯æ¬¡ã®ããã«ãªããŸãã
Aâ¢B = | A || B |cosÎ
ããã§ãÎïŒãã·ãŒã¿ããšçºé³ïŒã¯ããã¯ãã«AãšBã®éã®è§åºŠã§ãã
ããã«ããã次ã®åŒã䜿çšããŠÎïŒè§åºŠïŒãèŠã€ããããšãã§ããŸãã
Î= acosïŒ[AB] / [| A || B |]ïŒ
åè¿°ããããã«ããã¯ãã«ã®æ£èŠåã¯ç§ãã¡ã®ç掻ãç°¡çŽ åããŸãã AãšBãæ£èŠåãããŠããå ŽåãåŒã¯æ¬¡ã®ããã«ç°¡ç¥åãããŸãã
Î= acosïŒABïŒ
ã¬ãŒãã·ããªãªãããäžåºŠèŠãŠã¿ãŸãããã ã¬ãŒãã®è§åºŠã120床ã«çãããªãããã«ããŸãã ã¬ãŒãã®ä¿è·ïŒD 'ïŒããã³ã¬ãŒãããã¡ã€ã³ãã£ã©ã¯ã¿ãŒãžã®èªå°ïŒV'ïŒã®æ£èŠåããããã¯ãã«ãååŸããŸãã 次ã«ããããã®éã®è§åºŠã決å®ããŸãã è§åºŠã60床ïŒèŠéè§ã®ååïŒãè¶ ããå Žåãäž»äººå ¬ã¯ã¬ãŒãããèŠããªããªããŸãã
D '= D / | D | =ïŒ1ã1ïŒ/ sqrtïŒ1 2 + 1 2 ïŒ=ïŒ1ã1ïŒ/ sqrtïŒ2ïŒ=ïŒ0.71ã0.71ïŒ
V '= V / | V | =ïŒ2ã-1ïŒ/ sqrtïŒ2 2 +ïŒ-1ïŒ 2 ïŒ=ïŒ2ã-1ïŒ/ sqrtïŒ5ïŒ=ïŒ0.89ã-0.45ïŒ
Î= acosïŒD'V 'ïŒ= acosïŒ0.71 * 0.89 + 0.71 *ïŒ-0.45ïŒïŒ= acosïŒ0.31ïŒ= 72
èŠåå¡ã®èŠçã®äžå¿ãšäž»äººå ¬ã®äœçœ®ãšã®éã®è§åºŠã¯72床ã§ãããããèŠåå¡ã¯åœŒãèŠãŸããã
ããã¯ããªãè€éã«èŠããŸãããããã¯ãã¹ãŠãæåã§è¡ãããã§ãã ããã°ã©ã ã§ã¯ããã¹ãŠéåžžã«ç°¡åã§ãã 以äžã¯ãç§ãæžããC ++ãã¯ãã«ã©ã€ãã©ãªã䜿çšããŠã Overgrowthã²ãŒã ã§ãããã©ã®ããã«è¡ã£ããã瀺ããŠããŸãã
// vec2 guard_pos = vec2(1,3); vec2 guard_facing = vec2(1,1); vec2 hero_pos = vec2(3,2); // vec2 guard_facing_n = normalize(guard_facing); vec2 guard_to_hero = normalize(hero_pos - guard_pos); // float angle = acos(dot(guard_facing_n, guard_to_hero));
ãã¯ã¿ãŒã¢ãŒãã¯ãŒã¯
ã³ãŒã¹ã®å³åŽãšå·ŠåŽãæã€å€§ç ²ãåããè¹ããããšããŸãã ããŒããæ¹åãã¯ãã«ïŒ2ã1ïŒã«æ²¿ã£ãŠé 眮ãããŠãããšä»®å®ããŸãã éã¯ã©ã®æ¹åã«å°æããŸããïŒ
2次å ã°ã©ãã£ãã¯ã¹ã§ã¯éåžžã«ç°¡åã§ãã æ¹åãæèšåãã«90床å転ããã«ã¯ããã¯ãã«ã®ã³ã³ããŒãã³ãã亀æãã2çªç®ã®ã³ã³ããŒãã³ãã®ç¬Šå·ãå€æŽããŸãã
ïŒaãbïŒã¯ïŒbã-aïŒã«ãªããŸãã ãããã£ãŠããã¯ãã«ïŒ2ã1ïŒã«æ²¿ã£ãŠäœçœ®ããè¹ã§ã¯ãå³boardåŽã®éã¯æ¹åïŒ1ã-2ïŒã§çºç ²ããå·ŠportåŽã®éã¯å察æ¹åã«çºç ²ããŸãã ãã¯ãã«ã®æåã®ç¬Šå·ãå€æŽããïŒ-1ã2ïŒãååŸããŸãã
ãããã3次å ã°ã©ãã£ãã¯ã¹ã®ãã¹ãŠãèšç®ãããå Žåã¯ã©ãã§ããããïŒ è¹ã®äŸãèããŠã¿ãŸãããã
ãã¹ããã¯ãã«Mã¯çäžïŒ0ã1ã0ïŒã«åãããã颚åã¯ååæ±E WïŒ1ã0ã2ïŒã§ãã ãããŠãæè¯ã®æ¹æ³ã§ã颚ããã£ãããããããã«ãåžSã®æ¹åãã¯ãã«ãèšç®ããŸãã
ãã®åé¡ã解決ããã«ã¯ããã¯ãã«ç©S = M x Wã䜿çšããŸãã
AïŒa 1 ãa 2 ãa 3 ïŒãšBïŒb 1 ãb 2 ãb 3 ïŒã®ãã¯ãã«ç©ã¯æ¬¡ã®ããã«ãªããŸãã
ïŒa 2 b 3 -a 3 b 2 ãa 3 b 1 -a 1 b 3 ãa 1 b 2 -a 2 b 1 ïŒ
次ã«ãå¿ èŠãªå€ã眮ãæããŸãã
S = MxW =ïŒ0ã1ã0ïŒxïŒ1ã0ã2ïŒ=ïŒ[1 * 2-0 * 0]ã[0 * 1-0 * 2]ã[0 * 0-1 * 1] ïŒ=ïŒ2ã0ã-1ïŒ
æåèšç®ã§ã¯éåžžã«å°é£ã§ãããã°ã©ãã£ã«ã«ã¢ããªã±ãŒã·ã§ã³ãã²ãŒã ã¢ããªã±ãŒã·ã§ã³ã§ã¯ã以äžã«ç€ºããããªé¢æ°ãèšè¿°ãããã®ãããªèšç®ã®è©³çŽ°ã«ã¯è§Šããªãããšããå§ãããŸãã
vec3 cross(vec3 a, vec3 b) { vec3 result; result[0] = a[1] * b[2] - a[2] * b[1]; result[1] = a[2] * b[0] - a[0] * b[2]; result[2] = a[0] * b[1] - a[1] * b[0]; return result; }
ãã¯ãã«ç©ã¯ãã²ãŒã ã§è¡šé¢æ³ç·ãèšç®ããããã«ãã䜿çšãããŸãã ãããŸãã¯ãã®è¡šé¢ããèŠãããæ¹åã ããšãã°ãé ç¹AãBãCã®ãã¯ãã«ãæã€äžè§åœ¢ãèããŠã¿ãŸããããäžè§åœ¢ããèŠãããæ¹åãã€ãŸããã®å¹³é¢ã«åçŽãªæ¹åãã©ã®ããã«ããŠèŠã€ããã®ã§ããããã è€éã«æããŸããããã®åé¡ã解決ããããŒã«ããããŸãã
æžç®ã䜿çšããŠãAããCãžã®æ¹åïŒC-AïŒã決å®ãããface 1ãïŒãšããž1ïŒãAããBãžã®æ¹åïŒB-AïŒããface 2ãïŒãšããž2ïŒã«ããŸãã ã ãããŠããã¯ãã«ç©ãé©çšããŠãäž¡æ¹ã«åçŽãªãã€ãŸããå¹³é¢ã®æ³ç·ããšãåŒã°ããäžè§åœ¢ã®å¹³é¢ã«åçŽãªãã¯ãã«ãèŠã€ããŸãã
ããã¯ã³ãŒãã§ã©ã®ããã«èŠãããã§ãïŒ
vec3 GetTriangleNormal(vec3 a, vec3 b, vec3 c) { vec3 edge1 = ba; vec3 edge2 = ca; vec3 normal = cross(edge1,edge2); return normal; }
ã²ãŒã ã§ã¯ãç §æã®äž»ãªè¡šçŸã¯Nâ¢LãšããŠèšè¿°ãããŸããããã§ãNã¯ç §æãããè¡šé¢ã®æ³ç·ãLã¯å ã®æ£èŠåãããæ¹åãã¯ãã«ã§ãã ãã®çµæãå ãçŽæ¥åœãããšè¡šé¢ã¯æããèŠããå ãåœãããªããšè¡šé¢ãæããªããŸãã
ããã§ãã²ãŒã éçºè ã«ãšã£ãŠãå€æãããªãã¯ã¹ãïŒå€æãããªãã¯ã¹ïŒã®ãããªéèŠãªæŠå¿µãæ€èšããŸãã
ãŸããå€æãããªãã¯ã¹ã®ããã«ãã£ã³ã°ãããã¯ãã調ã¹ãŸãã
åºæ¬ãã¯ãã«
éåžžã«å€ãããŒããŠã§ã¢ã§å°ææã²ãŒã ãæžããŠããããã®å¹³é¢å ã§èªç±ã«å転ã§ããåçŽãª2次å ã®å®å®è¹ãå¿ èŠã ãšããŸãã è¹ã®ã¢ãã«ã¯æ¬¡ã®ããã«ãªããŸãã
ãã¬ã€ã€ãŒãä»»æã®è§åºŠãããšãã°åæèšåãã«49床å転ãããšãã«ãã©ã®ããã«è¹ãæç»ããŸããã äžè§æ³ã䜿çšããŠããã€ã³ãã®åº§æšãšå転è§åºŠãååŸãããªãã»ãããã€ã³ãã®åº§æšãè¿ã2次å å転é¢æ°ãäœæã§ããŸãã
vec2 rotate(vec2 point, float angle){ vec2 rotated_point; rotated_point.x = point.x * cos(angle) - point.y * sin(angle); rotated_point.y = point.x * sin(angle) + point.y * cos(angle); return rotated_point; }
ãã®é¢æ°ã3ã€ã®ãã€ã³ããã¹ãŠã«é©çšãããšã次ã®å³ãåŸãããŸãã
ãµã€ã³ãšã³ãµã€ã³ã®æäœã¯ããªãé ããªããŸããã3ãã€ã³ãã®ã¿ã®èšç®ãè¡ããããããã¯å€ãããŒããŠã§ã¢ã§ãæ£åžžã«æ©èœããŸãïŒ ç¿»èš³è ã®æ³šæïŒã¡ã¢ãªããŒãã«ã¯é¢æ°ããšã«æŽçãããã¢ããªã±ãŒã·ã§ã³ã®èµ·åæã«èšç®ãããŸãããã®åŸãäžè§é¢æ°ãèšç®ãããšãã«ããŒãã«ã«ã¢ã¯ã»ã¹ããã ãã§ã ïŒã
次ã«ãè¹ã次ã®ããã«ããŸãã
ããªãå€æ°ã®ãã€ã³ããå転ãããå¿ èŠããããããå€ãã¢ãããŒãã¯éåžžã«é ããªããŸãã ãã®åé¡ã«å¯Ÿãããšã¬ã¬ã³ããªè§£æ±ºçã®1ã€ã¯ã次ã®ããã«èãããŸãããè¹ã®ã¢ãã«ã®åãã€ã³ããå転ããã代ããã«ãã¢ãã«ã®åº§æšã°ãªãããå転ããããšã©ããªãã§ããããïŒã
ã©ã®ããã«æ©èœããŸããïŒ åº§æšãäœã§ãããã詳ããèŠãŠã¿ãŸãããã
座æšïŒ3ã2ïŒãæã€ãã€ã³ãã«ã€ããŠè©±ããšãããã®äœçœ®ã¯ãX座æšè»žã«æ²¿ã£ãåºæºç¹ãã3ã¹ããããY座æšè»žã«æ²¿ã£ãåºæºç¹ãã2ã¹ãããã§ãããšèšããŸãã
ããã©ã«ãã§ã¯ã座æšè»žã¯æ¬¡ã®ããã«é 眮ãããŸãïŒåº§æšè»žXã®ãã¯ãã«ïŒ1ã0ïŒã座æšè»žYã®ãã¯ãã«ïŒ0ã1ïŒã ãããŠãäœçœ®ãååŸããŸãïŒ3ïŒ1ã0ïŒ+ 2ïŒ0ã1ïŒã ãã ãã座æšè»žã¯ãã®äœçœ®ã«ããå¿ èŠã¯ãããŸããã 座æšè»žãå転ããããšãåæã«åº§æšã°ãªããå ã®ãã¹ãŠã®ãã€ã³ããå転ããŸãã
å転軞Xããã³YãååŸããã«ã¯ãäžèšã®äžè§é¢æ°ã䜿çšããŸãã 49床å転ããå Žåãæ°ãã座æšè»žXã¯ãã¯ãã«ïŒ0ã1ïŒã49床å転ããããšã«ããååŸãããæ°ãã座æšè»žYã¯ãã¯ãã«ïŒ0ã1ïŒã49床å転ããããšã«ããååŸãããŸãã ãããã£ãŠãæ°ãã軞Xã®ãã¯ãã«ã¯ïŒ0.66ã0.75ïŒã«çãããªããæ°ãã軞Yã®ãã¯ãã«ã¯ïŒ-0.75ã0.66ïŒã«ãªããŸãã åçŽãª3ç¹ã¢ãã«ãæåã§å®è¡ããŠãæ£åžžã«æ©èœããããšã確èªããŸãã
äžã®ç¹ã®åº§æšã¯ïŒ0ã2ïŒã§ããã€ãŸããæ°ããäœçœ®ã¯æ°ããïŒå転ããïŒX軞ã§ã¯0ãæ°ããY軞ã§ã¯2ã«ãªããŸãã
0 *ïŒ0.66.0.75ïŒ+ 2 *ïŒ-0.75ã0.66ïŒ=ïŒ-1.5ã1.3ïŒ
å·Šäžã®ãã€ã³ãã¯ïŒ-1ã-1ïŒã§ããã€ãŸãããã®æ°ããäœçœ®ã¯ãå転ããX軞ã§-1ãå転ããY軞ã§-1ã§ãã
-1 *ïŒ0.66.0.75ïŒ+ -1 *ïŒ-0.75ã0.66ïŒ=ïŒ0.1ã-1.4ïŒ
å³äžã®ãã€ã³ãã¯ïŒ1ã-1ïŒã§ããããã¯ãæ°ããäœçœ®ãå転ããX軞ã§1ãå転ããY軞ã§-1ã§ããããšãæå³ããŸãã
1 *ïŒ0.66.0.75ïŒ+ -1 *ïŒ-0.75ã0.66ïŒ=ïŒ1.4ã0.1ïŒ
å転軞ïŒãŸãã¯ãããŒã¹ãã¯ãã«ãïŒãæã€å¥ã®åº§æšã°ãªããã«è¹ã®åº§æšãã©ã®ããã«è¡šç€ºããããã瀺ããŸããã ããã¯ãè¹è¶ã¢ãã«ã®åãã€ã³ãã«äžè§å€æãé©çšããå¿ èŠããªãããããã®å Žåã«äŸ¿å©ã§ãã
åºåºãã¯ãã«ïŒ1ã0ïŒãšïŒ0ã1ïŒãïŒaãbïŒãšïŒcãdïŒã«å€æŽãããã³ã«ã次ã®åŒã䜿çšããŠç¹ïŒxãyïŒã®æ°ãã座æšãèŠã€ããããšãã§ããŸãã
xïŒaãbïŒ+ yïŒcãdïŒ
éåžžãåºåºãã¯ãã«ã¯ïŒ1ã0ïŒãšïŒ0ã1ïŒã§ãããxïŒ1ã0ïŒ+ yïŒ0ã1ïŒ=ïŒxãyïŒãåŸãããã ããªã®ã§ããããããã«åŠçããå¿ èŠã¯ãããŸããã ãã ããå¿ èŠãªãšãã«ä»ã®åºåºãã¯ãã«ã䜿çšã§ããããšãèŠããŠããããšãéèŠã§ãã
è¡å
è¡åã¯2次å ãã¯ãã«ã«äŒŒãŠããŸãã ããšãã°ãå žåçãª2x2ãããªãã¯ã¹ã¯æ¬¡ã®ããã«ãªããŸãã
[acbd]
è¡åã«ãã¯ãã«ãæããå Žåãåè¡ã®ã¹ã«ã©ãŒç©ãšä¹ç®ãçºçãããã¯ãã«ãåèšããŸãã ããšãã°ãäžèšã®è¡åã«ãã¯ãã«ïŒxãyïŒãæãããšã次ã®ããã«ãªããŸãã
ïŒaãcïŒâ¢ïŒxãyïŒ+ïŒbãdïŒâ¢ïŒxãyïŒ
æžãæ¹ãç°ãªããšããã®åŒã¯æ¬¡ã®ããã«ãªããŸãã
xïŒaãbïŒ+ yïŒcãdïŒ
ããªãã¿ã§ããã ããã¯ãåºåºãã¯ãã«ãå€æŽããããã«äœ¿çšããåŒãšãŸã£ããåãã§ãã ããã¯ã2x2è¡åã«2次å ãã¯ãã«ãæããããšã«ãããåºåºãã¯ãã«ãå€æŽããããšãæå³ããŸãã ããšãã°ããããªãã¯ã¹ã®åã®ïŒ1ã0ïŒããã³ïŒ0ã1ïŒã«æšæºåºåºãã¯ãã«ãæ¿å ¥ãããšã次ã®ããã«ãªããŸãã
[1 0 0 1]
ããã¯ãæå®ãããã¥ãŒãã©ã«åºåºãã¯ãã«ããæåŸ ã§ããå¹æãçæããªãåäœè¡åã§ãã ãã ããåºåºãã¯ãã«ã49床å転ãããšã次ã®ããã«ãªããŸãã
[0.66 -0.75 0.75 0.66]
ãã®è¡åã¯ã2次å ãã¯ãã«ãåæèšåãã«49床å転ããŸãã ãã®ãããªè¡åã䜿çšããŠãAsteriodsã²ãŒã ã®ã³ãŒãããããšã¬ã¬ã³ãã«ããããšãã§ããŸãã ããšãã°ãè¹ã®å転é¢æ°ã¯æ¬¡ã®ããã«ãªããŸãã
void RotateShip(float degrees){ Matrix2x2 R = GetRotationMatrix(degrees); for(int i=0; i<num_points; ++i){ rotated_point[i] = R * point[i]; } }
ãã ãããã®ãããªãã¯ã¹ã«å®å®è¹ã®åããå«ããããšãã§ããã°ãã³ãŒãã¯ããã«ãšã¬ã¬ã³ãã«ãªããŸãã 次ã«ããªããžã§ã¯ãã®æ¹åãšç©ºéå ã®äœçœ®ã«é¢ããæ å ±ãæ ŒçŽããã³é©çšããåäžã®ããŒã¿æ§é ãäœæããŸãã
幞ããªããšã«ããããå®çŸããæ¹æ³ããããŸãããéåžžã«ãšã¬ã¬ã³ãã«èŠããŸããã ãã¯ãã«ïŒeãfïŒã䜿çšããŠç§»åããå Žåã¯ãå€æè¡åã«ã®ã¿å«ããŸãã
[acebdf 0 0 1]
ãããŠã次ã®ããã«ããªããžã§ã¯ãã®äœçœ®ã決å®ããåãã¯ãã«ã®æåŸã«è¿œå ã®ãŠããããè¿œå ããŸãã
[xy 1]
ä»ãããããæãããšã次ã®ããã«ãªããŸãïŒ
ïŒaãcãeïŒâ¢ïŒxãyã1ïŒ+ïŒbãdãfïŒâ¢ïŒxãyã1ïŒ+ïŒ0ã0ã1ïŒâ¢ïŒxãyã1ïŒ
ããã¯ã次ã®ããã«èšè¿°ã§ããŸãã
xïŒaãbïŒ+ yïŒcãdïŒ+ïŒeãfïŒ
ããã§ã1ã€ã®ãããªãã¯ã¹ã«å²ãŸããå®å šãªå€æã¡ã«ããºã ãã§ããŸããã ããã¯ãã³ãŒãã®åªé ããèæ ®ããªãå Žåã«éèŠã§ããã³ãŒãã䜿çšãããšãæšæºã®ãããªãã¯ã¹æäœããã¹ãŠäœ¿çšã§ããããã«ãªãããã§ãã ããšãã°ããããªãã¯ã¹ãä¹ç®ããŠç®çã®å¹æãè¿œå ãããããããªãã¯ã¹ãå転ããŠãªããžã§ã¯ãã®æ£ç¢ºãªå察ã®äœçœ®ãååŸãããã§ããŸãã
3Dãããªãã¯ã¹
3次å 空éã®è¡åã¯ã2次å ã®è¡åãšåãããã«æ©èœããŸãã 2次å ã®ç»åã衚瀺ãããã£ã¹ãã¬ã€ã䜿çšãããšç°¡åã«è¡šç€ºã§ããããã2次å ã®ãã¯ãã«ãšè¡åã䜿çšããäŸã瀺ããŸããã åºæ¬ãã¯ãã«ã«ã¯ã2ã€ã§ã¯ãªã3ã€ã®åãå®çŸ©ããå¿ èŠããããŸãã åºåºãã¯ãã«ãïŒaãbãcïŒãïŒdãeãfïŒããã³ïŒgãhãiïŒã®å Žåããããªãã¯ã¹ã¯æ¬¡ã®ããã«ãªããŸãã
[adgbehcfi]
ïŒjãkãlïŒã移åããå¿ èŠãããå Žåãåã«è¿°ã¹ãããã«ãè¿œå ã®åãšè¡ãè¿œå ããŸãã
[adgjbehkcfil 0 0 0 1]
ãããŠã次ã®ããã«ããŠããã[1]ããã¯ãã«ã«è¿œå ããŸãã
[xyz 1]
äºæ¬¡å å転
ç§ãã¡ã®å ŽåãïŒãã£ã¹ãã¬ã€äžã«ããïŒå転軞ã1ã€ãããªããããç¥ãå¿ èŠãããã®ã¯è§åºŠã ãã§ãã ããã«ã€ããŠã¯ãäžè§é¢æ°ã䜿çšããŠã次ã®ãããª2次å å転é¢æ°ãå®è£ ã§ããããšã説æããŸããã
vec2 rotate(vec2 point, float angle){ vec2 rotated_point; rotated_point.x = point.x * cos(angle) - point.y * sin(angle); rotated_point.y = point.x * sin(angle) + point.y * cos(angle); return rotated_point; }
ããã¯ããããªãã¯ã¹åœ¢åŒã§ãããšã¬ã¬ã³ãã«è¡šçŸã§ããŸãã ãããªãã¯ã¹ã決å®ããããã«ãè§åºŠÎã®è»žïŒ1ã0ïŒãšïŒ0ã1ïŒã«ãã®é¢æ°ãé©çšãããããªãã¯ã¹ã®åã«çµæã®è»žãå«ããããšãã§ããŸãã ããã§ã¯ã座æšè»žXïŒ1ã0ïŒããå§ããŸãããã é¢æ°ãé©çšãããšã次ã®çµæãåŸãããŸãã
ïŒ1 * cosïŒÎïŒ-0 * sinïŒÎïŒã1 * sinïŒÎïŒ+ 0 * cosïŒÎïŒïŒ=ïŒcosïŒÎïŒãsinïŒÎïŒïŒ
次ã«ã座æšè»žYïŒ0ã1ïŒãå«ããŸãã ååŸãããã®ïŒ
ïŒ0 * cosïŒÎïŒ-1 * sinïŒÎïŒã0 * sinïŒÎïŒ+ 1 * cosïŒÎïŒïŒ=ïŒ-sinïŒÎïŒãcosïŒÎïŒïŒ
ååŸãã座æšè»žããããªãã¯ã¹ã«å«ãã2次å ã®å転ãããªãã¯ã¹ãååŸããŸãã
[cosïŒÎïŒ-sinïŒÎïŒ sinïŒÎïŒcosïŒÎïŒ]
ãã®ãããªãã¯ã¹ããBlenderã°ã©ãã£ãã¯ããã±ãŒãžã®ç¿ã§ããSusannahã«é©çšããŸãã å転è§Îã¯æèšåãã«45床ã§ãã
ã芧ã®ãšãããåäœããŸãã ããããïŒ0ã0ïŒä»¥å€ã®ç¹ãäžå¿ã«å転ããå¿ èŠãããå Žåã¯ã©ãã§ããããïŒ
ããšãã°ããµã«ã®é ãè³ã«ãããã€ã³ãã®åšãã«å転ãããŸãã
ãããè¡ãã«ã¯ãéå§ç¹ããç¿ã®è³ã®å転ç¹ã«ãªããžã§ã¯ãã移åããå€æè¡åTãšãéå§ç¹ãäžå¿ã«ãªããžã§ã¯ããå転ãããå転è¡åRãäœæããããšããå§ããŸãã ããŠãè³ã«ããç¹ã®åšããå転ãããã«ã¯ããŸãT -1ãšæžãããè¡åTãå転ããããšã«ãããè³ã®ç¹ãéå§ç¹ã®äœçœ®ã«ç§»åããŸãã 次ã«ããããªãã¯ã¹Rã䜿çšããŠéå§ç¹ãäžå¿ã«ãªããžã§ã¯ããå転ããããããªãã¯ã¹Tãé©çšããŠå転ç¹ãå ã®äœçœ®ã«æ»ããŸãã
以äžã«ã説æããåã¹ãããã®å³ã瀺ããŸãã
ããã¯ãåŸã§é©çšããéèŠãªãã³ãã¬ãŒãã§ãã2ã€ã®å察ã®å€æã«å転ã䜿çšãããšããªããžã§ã¯ããå¥ã®ã空éãã§å転ãããããšãã§ããŸãã ããã¯éåžžã«äŸ¿å©ã§äŸ¿å©ã§ãã
次ã«ã3次å ã®å転ãæ€èšããŸãã
3Då転
Z軞ãäžå¿ãšããå転ã¯ã2次å 空éã§ã®å転ãšåãåçã§æ©èœããŸãã åãšè¡ãè¿œå ããŠãå€ããããªãã¯ã¹ãå€æŽããã ãã§ãã
[cosïŒÎïŒ-sinïŒÎïŒ0 sinïŒÎïŒcosïŒÎïŒ0 0 0 1]
ãã®ãããªãã¯ã¹ããBlenderããã±ãŒãžã®ç¿ã§ããSusannaã®3次å ããŒãžã§ã³ã«é©çšããŸãã å転è§Îã¯ãæèšåãã«45床ã«çããããå¿ èŠããããŸãã
åãããšã Z軞ãäžå¿ã«å転ããã ãã§ã¯å¶éãããŸãããä»»æã®è»žãäžå¿ã«å転ããã®ã¯ã©ãã§ããïŒ
軞è§å転
軞ãšè§åºŠã«ãã£ãŠå®çŸ©ãããå転ã®è¡šçŸã¯ãææ°åº§æšã®å転ãšãåŒã°ãã2ã€ã®éã®å転ã«ãã£ãŠãã©ã¡ãŒã¿ãŒåãããŸãã ã¬ã€ã軞ïŒçŽç·ïŒã®å転ãå®çŸ©ãããã¯ãã«ãšããã®è»žã®åšãã®å転éãè¡šãè§åºŠã å転ã¯å³æã®èŠåã«åŸã£ãŠè¡ãããŸãã
ãã®ãããå転ã¯2ã€ã®ãã©ã¡ãŒã¿ãŒïŒè»žãè§åºŠïŒã§å®çŸ©ãããŸããããã§ã軞ã¯å転軞ã®ãã¯ãã«ãè§åºŠã¯å転è§åºŠã§ãã ãã®ææ³ã¯éåžžã«åçŽã§ãããç§ã䜿çšããä»ã®å€ãã®å転æäœã®åºçºç¹ãšãªããŸãã 軞ãšè§åºŠã«ãã£ãŠæ±ºå®ãããå転ãå®éã«é©çšããæ¹æ³ã¯ïŒ
次ã®å³ã«ç€ºãããã«ãå転軞ãæ±ã£ãŠãããšããŸãã
Z軞ãäžå¿ã«ãªããžã§ã¯ããå転ãããæ¹æ³ãç¥ã£ãŠãããä»ã®ç©ºéã§ãªããžã§ã¯ããå転ãããæ¹æ³ãç¥ã£ãŠããŸãã ãããã£ãŠãå転軞ãZ軞ã«ãªãã¹ããŒã¹ãäœæããã ãã§ããã®è»žãZ軞ã§ããå ŽåãX軞ãšY軞ã¯ã©ããªããŸããïŒ èšç®ãããŸãããã
æ°ãã軞XãšYãäœæããã«ã¯ãæ°ããZ軞ã«åçŽã§ãäºãã«åçŽãª2ã€ã®ãã¯ãã«ãéžæããã ãã§ãã 2ã€ã®ãã¯ãã«ãåãããããã«åçŽãªãã¯ãã«ãäžãããã¯ãã«ä¹ç®ã«ã€ããŠã¯æ¢ã«èª¬æããŸããã
1ã€ã®ãã¯ãã«ããããŸããããã¯å転軞ã§ããAãšåŒã³ãŸãããã次ã«ããã¯ãã«Aãšåãæ¹åã§ã¯ãªãã©ã³ãã ãªä»ã®ãã¯ãã«BãåããŸããããšãã°ãïŒ0ã0ã1ïŒãšããŸãã
å転軞Aãšã©ã³ãã ãªãã¯ãã«Bãããããã¯ãã«ç©AãšBãä»ããŠæ³ç·CãååŸã§ããŸããCã¯ãã¯ãã«AãšBã«åçŽã§ãã次ã«ããã¯ãã«Bããã¯ãã«ç©ãšãã¯ãã«AãšCã«åçŽã«ããŸãã ããã ãã§ããå¿ èŠãªãã¹ãŠã®åº§æšè»žããããŸãã
èšèã§èšãã°ãããã¯è€éã«èãããŸãããã³ãŒããåçã«è¡šç€ºããããšéåžžã«åçŽã«èŠããŸãã
以äžã¯ããããã³ãŒãã§ã©ã®ããã«èŠãããã瀺ããŠããŸãã
B = (0,0,1); C = cross(A,B); B = cross(C,A);
åã¹ãããã®å³ã次ã«ç€ºããŸãã
æ°ãã座æšè»žã«é¢ããæ å ±ãåŸãããã®ã§ãå軞ããã®è¡åã®åãšããŠå«ããããšã§è¡åMãæ§æã§ããŸãã æ°ãã座æšè»žZã«ãªãããã«ããã¯ãã«Aã3çªç®ã®åã§ããããšã確èªããå¿ èŠããããŸãã
[B0 C0 A0 B1 C1 A1 B2 C2 A2]
ããã¯ã2次å 空éã§å転ããããã«è¡ã£ãããšã«äŒŒãŠããŸãã éè¡åMã䜿çšããŠæ°ãã座æšç³»ã«ç§»åããè¡åRã«åŸã£ãŠå転ããŠãªããžã§ã¯ããZ軞ãäžå¿ã«å転ããè¡åMãé©çšããŠå ã®åº§æšç©ºéã«æ»ãããšãã§ããŸãã
ããã§ãä»»æã®è»žãäžå¿ã«ãªããžã§ã¯ããå転ã§ããŸãã æçµçã«ã¯ããããªãã¯ã¹T = T = M -1 RMãäœæããŠãäœåºŠã䜿çšããããšãã§ããŸãã 軞ãšè§åºŠã§å®çŸ©ãããå転ãããããªãã¯ã¹ã§å®çŸ©ãããå転ã«å€æããããå¹ççãªæ¹æ³ããããŸãã å ã»ã©èª¬æããã¢ãããŒãã¯ãåã«èª¬æããå€ãã®ããšã瀺ããŠããŸãã
軞ãšè§åºŠã«ãã£ãŠå®çŸ©ãããå転ã¯ãããããæãçŽæçãªæ¹æ³ã§ãã ããã䜿çšãããšãè§ã®èšå·ãå€æŽããããšã§å転ãå転ããã®ãéåžžã«ç°¡åã«ãªããè§åºŠãè£éããããšã§ç°¡åã«è£éããããšãã§ããŸãã ãã ããé倧ãªå¶éãããããã®ãããªå転ã¯åèšã§ã¯ãªããšããäºå®ã«ãããŸãã ã€ãŸãã3çªç®ã®è»žãšè§åºŠã§å®çŸ©ããã2ã€ã®å転ãçµã¿åãããããšã¯ã§ããŸããã
軞ãšè§åºŠã§å®çŸ©ãããå転ã¯éå§ããã®ã«è¯ãæ¹æ³ã§ãããããè€éãªå Žåã«äœ¿çšããããã«ä»ã®äœãã«å€æããå¿ èŠããããŸãã
ãªã€ã©ãŒè§
ãªã€ã©ãŒè§ã¯ãXãYãZ軞ãåºæºã«ãã¹ãããã3ã€ã®å転ã§æ§æãããå¥ã®å転æ¹æ³ãè¡šããŸããã«ã¡ã©ã1人称ãŸãã¯3人称ã®ã¢ã¯ã·ã§ã³ã瀺ãã²ãŒã ã§äœ¿çšãããããšããããŸãã
äžäººç§°ã·ã¥ãŒãã£ã³ã°ã²ãŒã ããã¬ã€ããå·Šã«30床å転ããŠãã40床èŠäžãããšããŸãã æçµçã«ã圌ãã¯ããªããæã¡ãããªãã«ã¶ã€ãããäžæã®çµæãšããŠãã«ã¡ã©ã¯ãã®è»žãäžå¿ã«45床å転ããŸãã ãªã€ã©ãŒè§ïŒ30ã40ã45ïŒã䜿çšããå転ã以äžã«ç€ºããŸãã
ãªã€ã©ãŒè§ã¯äŸ¿å©ã§äœ¿ããããããŒã«ã§ãã ãããããã®æ¹æ³ã«ã¯2ã€ã®æ¬ ç¹ããããŸãã
1ã€ã¯ã ã軞ããã¯ããŸãã¯ããžã³ãã«ããã¯ããšåŒã°ããç¶æ³ã®å¯èœæ§ã§ãã äžäººç§°èŠç¹ã®ã·ã¥ãŒãã£ã³ã°ã²ãŒã ããã¬ã€ããŠãå·Šãå³ãäžäžãèŠãããã«ã¡ã©ãèŠè»žãäžå¿ã«å転ããããããããšãæ³åããŠãã ããã ä»ãããªãããŸã£ããèŠäžããŠãããšæ³åããŠãã ããã ãã®ç¶æ³ã§ã¯ãå·ŠãŸãã¯å³ãèŠãããšããããšã¯ãã«ã¡ã©ãå転ãããããšããããšã«äŒŒãŠããŸãã ãã®å Žåã«ã§ããããšã¯ãã«ã¡ã©ããã®è»žãäžå¿ã«å転ãããããäžãèŠãããšã§ãã ãæ³åã®ãšããããã®å¶éã«ããããã©ã€ãã·ãã¥ã¬ãŒã¿ã§ãªã€ã©ãŒè§ã䜿çšããããšã¯å®çšçã§ã¯ãããŸããã
2çªç®-2ã€ã®ãªã€ã©ãŒå転è§éã®è£éã¯ããããã®éã®æççµè·¯ãäžããŸããã
ããšãã°ã2ã€ã®åäžã®å転éã«2ã€ã®è£éããããŸãã 1ã€ç®ã¯ãªã€ã©ãŒè§è£éã䜿çšãã2ã€ç®ã¯çé¢ç·åœ¢è£éïŒSLERPïŒã䜿çšããŠæççµè·¯ãèŠã€ããŸãã
ããã§ã¯ãå転ã®è£éã«ããé©ããŠããã®ã¯äœã§ããïŒãã¶ããããªãã¯ã¹ïŒ
ãããªãã¯ã¹å転
åè¿°ããããã«ãå転è¡åã«ã¯3ã€ã®è»žã«é¢ããæ å ±ãæ ŒçŽãããŸããããã¯ã2ã€ã®ãããªãã¯ã¹éã®è£éãå軞ã®ã¿ãç·åœ¢è£éããããšãæå³ããŸãããã®çµæãããã¯ç§ãã¡ã«å¹æçãªæ¹æ³ãæäŸããæ°ããåé¡ããããããŸããããšãã°ã2ã€ã®å転ãš1ã€ã®è£éãããåå転ã次ã«ç€ºããŸãã
ã芧ã®ãšãããè£éãããå転ã¯å ã®å転ãããã¯ããã«å°ããã2ã€ã®è»žã¯äºãã«åçŽã§ã¯ãããŸãããèããŠã¿ããšãããã¯è«ççã§ã-çäœäžã®ä»»æã®2ç¹ãçµã¶ã»ã°ã¡ã³ãã®äžå€®ã¯ãçäœã®äžå¿ã«ããè¿ãé 眮ãããŸãã
ããã«ãããéªšæ Œã¢ãã¡ãŒã·ã§ã³ã䜿çšãããšãã«ããç¥ãããŠãããã£ã³ãã£ã©ãããŒãšãã§ã¯ããçºçããŸãã以äžã¯ããªãŒããŒã°ããŒã¹ã²ãŒã ã®ãŠãµã®ã®äŸã䜿çšãããã®å¹æã®ãã¢ã§ããïŒããŒã翻蚳è ïŒãŠãµã®ã®äœã®çãäžã«æ³šæãæã£ãŠãã ããïŒã
ãããªãã¯ã¹æäœã«åºã¥ãå転ã¯ããžã³ãã«ããã¯ãªã©ã®åé¡ãªãå転ãèç©ã§ããã·ãŒã³å ã®ãã€ã³ãã«éåžžã«å¹æçã«é©çšã§ãããããéåžžã«äŸ¿å©ã§ãããããããããªãã¯ã¹å転ãµããŒããã°ã©ãã£ãã¯ã«ãŒãã«çµã¿èŸŒãŸããŠããçç±ã§ããã©ã®ã¿ã€ãã®3次å ã°ã©ãã£ãã¯ã¹ã§ãããããªãã¯ã¹å転圢åŒã¯åžžã«æçµçã«é©çšãããæ¹æ³ã§ãã
ãã ããæ¢ã«ç¥ã£ãŠããããã«ããããªãã¯ã¹ã¯ããŸãããŸãè£éãããŠããããããŸãçŽæçã§ã¯ãããŸããã
ãããã£ãŠãã¡ã€ã³ã®ããŒããŒã·ã§ã³åœ¢åŒã¯1ã€ãããããŸãããæåŸã«ãããã§ãéèŠã§ãã
åå æ°
ã¯ã©ãŒã¿ããªã³ãšã¯äœã§ããïŒèŠããã«ãããã¯ç©ºéã«ååšãã軞è§åºŠïŒè»žè§åºŠå転ïŒã«åºã¥ãã代æ¿å転ã§ãã
ãããªãã¯ã¹ãšåæ§ã«ããããã¯å転ãèç©ããããšãã§ããŸããã€ãŸãããããããå転ã®ãã§ãŒã³ãäœæããããšãã§ããæããããšãªãã軞ããã¯ïŒãžã³ãã«ããã¯ïŒãååŸã§ããŸããåæã«ããããªãã¯ã¹ãšã¯ç°ãªããããäœçœ®ããå¥ã®äœçœ®ã«ããŸãè£éã§ããŸãã
ã¯ã©ãŒã¿ããªã³ã¯ä»ã®å転圢åŒãããåªãããœãªã¥ãŒã·ã§ã³ã§ããïŒ
ä»æ¥ã§ã¯ãä»ã®å転æ¹æ³ã®ãã¹ãŠã®é·æãçµã¿åãããŠããŸãããããããããã«ã¯2ã€ã®åŒ±ç¹ããããã©ã¡ããæ€èšãããã«ãã£ãŠãåå æ°ãäžéå転ã«æé©ã§ãããšããçµè«ã«éããŸãããåå æ°ã®æ¬ ç¹ã¯äœã§ããã
第äžã«ãåå æ°ã¯3次å 空éã§è¡šç€ºããã®ã¯ç°¡åã§ã¯ãããŸããããããŠãæã ã¯åžžã«ããç°¡åãªæ¹æ³ã§å転ãå®è£ ãããããå€æããããšã匷å¶ãããŸãã第äºã«ãåå æ°ã¯å¹æçã«ç¹ãå転ãããããšãã§ãããããªãã®æ°ã®ç¹ãå転ãããããã«ããããè¡åã«å€æããããšãäœåãªããããŸãã
ããã¯ãã¯ã©ãŒã¿ããªã³ã䜿çšããŠäžé£ã®å転ãéå§ãŸãã¯çµäºããªãå¯èœæ§ãé«ãããšãæå³ããŸãããããã圌ãã®å©ããåããŠãä»ã®ã¢ãããŒããããå¹ççã«äžéå転ãå®è£ ã§ããŸãã
åå æ°æ©æ§ã®ãå éšãããã³ãã¯ããŸãæ確ã§ã¯ãªããç§ã«ãšã£ãŠã¯èå³æ·±ããã®ã§ã¯ãããŸããããããŠãããªããæ°åŠè ã§ãªãéããããã¯ããªãã«ãšã£ãŠé¢çœããªããããããŸããããŸããã¯ã©ãŒã¿ããªã³ã§åäœããã©ã€ãã©ãªãèŠã€ããŠãåé¡ã解決ããããããããšããå§ãããŸãã
BulletãŸãã¯Blenderæ°åŠã©ã€ãã©ãªã¯ãéå§ããã®ã«é©ããå Žæã§ãã