ã²ãŒã ã®äœè ã§ãããããã¯ãã©ã®ããã«ããŠåœŒã®ã©ã³ãã ãªãäžçããå°çã®åºå€§ãã«äŒŒãããã®ã«ããã®ã§ããããïŒ ãã®ãããã¯ã§ã¯ããã®çš®ã®äººå·¥çãªã©ã³ãã¹ã±ãŒããæ§ç¯ããæ¹æ³ã®1ã€ãæ€èšãïŒãŸããä»ã®ããã€ãã®æ¹æ³ãç°¡åã«èª¬æããŸãïŒãããã©ãŒãã³ã¹ãèããäœäžãããããšãªãã©ã³ãã¹ã±ãŒãã®ãµã€ãºãå€§å¹ ã«å¢å ã§ãããã®ã¢ã«ãŽãªãºã ã®å°ããªæ¹åã«ã€ããŠã説æããŸã
å éšã«ã¯ãããã€ãã®ã¹ããŒã ãšçŸããåçãããªãã®æ°ã®æåãã¢ã«ãŽãªãºã ã®å®è£ äŸãžã®ãªã³ã¯ããããŸãã
è¡åèšç»
äžè¬çã«ã©ã³ãã¹ã±ãŒãçæãšã¯ã©ãããæå³ã§ããïŒ å®éã«Minecraftãªã©ã®ã³ã³ãã¥ãŒã¿ãŒã²ãŒã ã®ã¬ãã«ã®äœæïŒã»ãŒãªã¢ã«ã¿ã€ã ïŒã«ã€ããŠè©±ãå Žåããã®ããã»ã¹ã¯æ¬¡ã®ãã€ã³ãã§æ§æãããŸãã
- é«ãããããäœæããŸã ã æåã«ãå¹³åŠãª2次å ã°ãªãããäœæããåã»ã«ã«ç¹å®ã®é«ããå²ãåœãŠãŸãã ã©ããã£ãŠïŒ ããã«ã€ããŠã¯åŸã§èª¬æããŸãã ã¡ãªã¿ã«ãã°ãªããã¯é·æ¹åœ¢ã§ããå¿ èŠã¯ãããŸãããããšãã°ãäžè§åœ¢ã§æ§æãããã°ãªããã®åæ§ã®ã¢ã«ãŽãªãºã ãããã§èª¬æããŸã ã ãã ããã»ãšãã©ã®å Žåãæ£æ¹åœ¢ã®ãã¯ã»ã«ã»ã«ã§æ§æãããã°ãªããã®æ¹ã䟿å©ã§ãã é«ãããããšãšãã«ãæ°Žã§èŠããããšãªã¢ãå®çŸ©ãããŸã-å°ãªããšãæµ·ãšæµ·ïŒéåžžãç¹å®ã®ã¬ãã«ããäžã«ããã»ã«ã¯æ°Žã«ãªããŸãïŒã
- ãã€ãªãŒã ååž ã ããã§ã¯ãå°çã®ç¥èãå¿ èŠã«ãªããŸãïŒãã ããã©ã³ãã¹ã±ãŒããäœæããããã»ã¹å šäœã§ãããå¿ èŠã§ãïŒã ãã³ãã©ãã©ãã«ããã¹ãããç æŒ ãã©ãã«ãããããããŠç±åž¯éšæãã©ãã«ãããã決å®ããããã«ããã§ã«äœæãããé«ãããããšãäŸãã°ã氎空éãŸãã¯ããã€ãã®æå®ã®ãã€ã³ãïŒèµ€é/極ïŒãŸã§ã®è·é¢ã圹ç«ã¡ãŸãã 次ã«ããã€ãªãŒã ã¯ä»ã®å€ãã®ãã©ã¡ãŒã¿ãŒãèšå®ããŸã-äŸãã°ãèå°ãå²©å Žã®æ°ãæ€ç©ãå·ãæ¹ã®æ°ãªã©ã
- å°çãæµ·æŽãæµ·ãäœæããå°ççãŸãŒã³ãåæ£ãããŸããã äœãå¿ããŸãããïŒ ãã¡ãããå·ãããŸããã ïŒ å±±ããæµããŠæµ·ã«æµã蟌ãããŸãã¯ç©ºæŽã«æ¹ã圢æããæ°Žèªäœã«å ããŠãå°è¡šé¢ãžã®åœ±é¿ããšãã¥ã¬ãŒãããå¿ èŠããããŸã-å·åºã圢æãããç ãæãããåå£ãæ²³å·ã«æ²¿ã£ãŠéã°ããæ¹ãä»ã®æ°Žåã®ããŒãã圢æãããŸãã æ®å¿µãªãããä»ã®ã¿ã€ãã®äŸµé£ãšåæ§ã«ã 氎䟵é£ãšåŒã°ãããã®ããã»ã¹ã¯ããã®èšäºã®ç¯å²å€ã«ããå¿ èŠããããŸãã ããã§ããåèæç®ã®ãªã¹ãã«ã¯ããã®ãããã¯ã«é¢ããéåžžã«åªããè³æãžã®ãªã³ã¯ãããã€ããããŸãã
- è¿œå ã®ã¢ã¯ã·ã§ã³ ã å®éãæ¯èŠ³ã¯ãã§ã«äœæãããŠããŸãããæ¹åã§ãããã®ã¯ãŸã å€ããããŸããããšãã°ãMinecraftã§ã¯ãå°äžç©ºéãå®å šã«èªç¶ã®æŽçªã§èŠãããå€ãã®æš¹æšãè¡šé¢ã«çããŠããŸãã ããã«ããã¡ããããã€ãªãŒã ã«ãã£ãŠã¯ãåæ€ç©ãå€æ§åããããšãå¯èœã§ã-ç®æšãçŸå®ã«èµ·ããŠããããšã«ã§ããã ãè¿ã¥ãããšã§ããå Žåã
æåŸã«ãçæãããã©ã³ãã¹ã±ãŒããæç»ããã ãã§æžã¿ãŸãã ããã§è©³çŽ°ã1ã€ã ã確èªããŸããäžèšã®äžè§åœ¢ã®ã°ãªããã¯ã3次å ãããã®åŸæ¥ã®èŠèŠåã®å Žåã«åœ¹ç«ã¡ãŸããã ãã¯ã»ã«ã®äœ¿çšã¯æ£æ¹åœ¢ã®ã»ã«ã«ã¯éåžžã«åœ¹ç«ã¡ãŸãã ãã ããããã¯ãŸã£ããå¥ã®è©±ã§ãã
é«ãããããäœæããæ¹æ³
ããã§ã¯ãã©ã³ãã¹ã±ãŒããæ§ç¯ããäžã§æãéèŠãªæ®µéãèŠãŠã¿ãŸããããå°è¡šã®åãã€ã³ãã®é«ãã決å®ããŸãã æãäžè¬çãªã¢ã€ãã¢ã¯ãäž¡æ¹ã®åº§æšã調ã¹ãŠããã[x] [y] =ã©ã³ãã ïŒïŒã«ããããšã§ããå¥åŠãªããšã«ã蚱容ã§ããçµæãåŸãããªãããããã£ãšsomethingãªãã®ã䜿çšããå¿ èŠããããŸãã
ãæåã§ãäžãäœæãã
ããªãåçŽãªã¢ã«ãŽãªãºã ïŒæåããããã¹ãŠã®ãã€ã³ãã¯åãã¬ãã«ã«ãããä»»æã®å ŽæïŒé«ãã®ç°ãªãäžïŒã«äœããã®ããã«ãžããè¿œå ãå§ãããšèããŠããŸãã æ éã«ãããã®äžãäºãã®äžã«æ·èšããçµæïŒããã³ãäžèšã®å°ãã®ãã€ãºãè¿œå ãããå¯èœæ§ããããŸãïŒããã§ã«çå®ã«äŒŒããã®ãåŸãããšãã§ããŸãã ãã ãã以äžã«ãªã¹ãããã¢ã«ãŽãªãºã ã䜿çšãããšãã¯ããã«çŸå®çãªã©ã³ãã¹ã±ãŒããå®çŸã§ããŸãããã®ããããäžãæ¹åŒã«ã€ããŠã¯èª¬æããŸããã
ãããã€å³ã«åºã¥ã颚æ¯
å®éãæè¿ãŸã§ã次ã®ã¢ãããŒãã¯ç§ã«ã¯ãŸã£ããç¥ãããŠããŸããã§ããããéåžžã«å°è±¡çãªçµæãåºãããšãã§ããããšã«éåžžã«é©ããŸããã
ããã¯ãã¹ãŠã誀ã£ãŠãããäžã«ãã€ã³ããæããããšããå§ãŸããŸãã 次ã«ããããã®ç¹ãããããã€å³ ïŒããã³ãããã«å¿ããŠDelaunayäžè§åœ¢åå² ïŒãæ§ç¯ããããã€ãã®ç·©åã®ããã€ãã®å埩ãå®è¡ãããŠãå°ããããããªãŽã³ãåé€ãããŸãã
åã®æ®µèœãæ確ã§ãªãå Žå-æããªãããã®æ¬è³ªã¯å³ã®å³ã®ãããªã°ãªããã«ã€ããŠäœæããããšã«ãªããŸãã ãã®äž»ãªç¹æ§ã¯äžèŠåæ§ã§ãã ããã«ãããåºç€ã«åºã¥ããŠæ§ç¯ãããã©ã³ãã¹ã±ãŒãããæ£æ¹åœ¢ãã«èŠããããªãããã«ã§ããŸãã
ãã以äžã®ã¢ã¯ã·ã§ã³ã¯ç°¡åã§ããæ°Žã§æºããããªãŽã³ãã©ã³ãã ã«éžæããæ®ãã®ããªãŽã³ã«å±ãããã€ã³ãã®é«ããsea-okiyanaãŸã§ã®æçè·é¢ã«çããããŸãã åããã€ãºïŒé«åºŠèªäœãšããªãŽã³ã®å¢çã®äž¡æ¹ïŒãè¿œå ããããã«æ®ããŸã-ãããŠãéåžžã«çŽ æŽããã島ïŒãŸãã¯èŠæš¡ã«å¿ããŠæ¬åïŒãååŸããŸãã
ç§ã¯ãã®ã¢ã«ãŽãªãºã ã®å®è£ ãæ±ã£ãŠããŸããã§ããããããŠãèšäºãç°¡åã«ããããã«ãããã€ãã®è©³çŽ°ãšäžéã®ãã®ãçç¥ããŸããã 詳现ãªèšäºïŒåçãšã»ãšãã©ã®æ å ±ã®åºå žïŒã¯ãã ïŒè±èªïŒã«ãããŸãããŸããããã»ã¹ã®ãã¹ãŠã®æ®µéãéåžžã«æ確ã«ç€ºãçŽ æŽãããswfãã¢ããããŸãã
ãã€ã¢ã¢ã³ãã¹ã¯ãšã¢ã¢ã«ãŽãªãºã
æãäžè¬çã§æãçŸå®çãªçµæãããããã®ã¯ã1次å äžç¹å€äœã¢ã«ãŽãªãºã ã2次å å¹³é¢ã«æ¡åŒµãããã€ã¢ã¢ã³ãã¹ã¯ãšã¢ïŒãŸãã¯ã¹ã¯ãšã¢ãã€ã¢ã¢ã³ãïŒã¢ã«ãŽãªãºã ã§ãã ãã®å©ããåããŠåŸããã颚æ¯ã¯ãååãšããŠãã©ã¯ã¿ã«ãšåŒã°ããŸããã確ãã«ãå®éã«ã¯ããã»ã©èªå·±é¡äŒŒã§ã¯ãããŸãã-å察ã«ã以äžã§èŠãããã«ãããŸãå¿«é©ã§ã¯ãªãç¹æ§ã¯ã倧èŠæš¡ã«æ¯èŒçæ»ããã«ãªãããšã§ããå°ããªãã®ã¯äžçš®ã®ãµã³ãããŒããŒã«å€ãããŸãã
ããåçŽãªäžç¹å€äœã¢ã«ãŽãªãºã ããå§ããŸãããã æ¢ã«è¿°ã¹ãããã«ã2次å ã®å¹³é¢ã§ã¯ãªãã1次å ã®ã»ã°ã¡ã³ãäžã§æ©èœããŸãïŒãããã£ãŠãããšãã°ãããã䜿çšããŠæ°Žå¹³ç·ãäœæã§ããŸãïŒã
ãã®ã¢ã«ãŽãªãºã ããã©ã¯ã¿ã«ã«é¢é£ããŠãããšããäºå®ã¯ããã®ååž°çãªåäœã§ãã æåã«ãã»ã°ã¡ã³ãã®äž¡ç«¯ã®é«ããäœããã®æ¹æ³ã§èšå®ããäžå€®ã®ãã€ã³ãã§2ã€ã®ãµãã»ã°ã¡ã³ãã«åå²ããŸãã ãã®ãã€ã³ããã©ã³ãã ãªå€ã§ã·ããããååŸãããµãã»ã°ã¡ã³ãããšã«ããŒãã£ã·ã§ã³ãšã·ãããç¹°ãè¿ããŸãã ãªã©-ã»ã°ã¡ã³ãã®é·ãã1ãã¯ã»ã«ã«ãªããŸã§ã ãããã¢ã«ãŽãªãºã å šäœã§ãïŒå³ã®å³ãåç §ïŒã ãããã¯ã-éèŠãªæ³šæïŒã©ã³ãã ãªå€äœã¯ãããŒãã£ã·ã§ã³ãäœæãããã»ã°ã¡ã³ãã®é·ãã«æ¯äŸããå¿ èŠããããŸãã ããšãã°ãé·ãlã®ã»ã°ã¡ã³ããåå²ããŸã-äžå€®ã®ãã€ã³ãã¯é«ããæã€å¿ èŠããããŸã
h =ïŒ h L + h R ïŒ/ 2 +ã©ã³ãã ïŒ -R * l ã R * l ïŒ
ïŒ h Lãšh Rã¯ã»ã°ã¡ã³ãã®å·Šç«¯ãšå³ç«¯ã®é«ãã§ãå®æ°Rã¯çµæã®ããªã©ã€ã³ã®ãç²ããã決å®ãããã®ã¢ã«ãŽãªãºã ã®äž»èŠãªãã©ã¡ãŒã¿ãŒã§ãïŒã
ãã®ã¢ã«ãŽãªãºã ã2次å ã®é«ããããã«äžè¬åããŠã¿ãŸãããã ãŸãããããå šäœã®4ã€ã®è§ã«ã©ã³ãã ãªé«ããå²ãåœãŠããããïŒäŸ¿å®äžãæ£æ¹åœ¢ã®ãããã§äœæ¥ãããã®èŸºã¯2ã®ã¹ãä¹ã§ãããšä»®å®ããŠïŒ4ã€ã®çããæ£æ¹åœ¢ã«åå²ããŸãã ãããã®ããããã§ãè§åºŠã®1ã€ã®æå³ãç¥ãããŠããŸãã æ®ãã¯ã©ãã§å ¥æã§ããŸããïŒ
1次å ã®äžç¹å€äœã®å Žåãšåæ§ã«ããã¹ãŠåãè£é-äžå¿ã®ç¹ã¯ã4ã€ã®ã³ãŒããŒç¹ãã¹ãŠã®é«ããå¹³åããŠåŸããã倧ããªæ£æ¹åœ¢ã®åŽé¢ã®åäžç¹ã¯ã察å¿ãã蟺ã®ç«¯ã«ãã1çµã®ç¹ãå¹³åããŸãã ïŒæ£æ¹åœ¢ã®èŸºã«æ¯äŸããç¯å²å ã§ïŒäžå¿ç¹ãã©ã³ãã ã«äžäžã«ã·ããããããã«ãå°ããã€ãºãå°å ¥ããçµæã®ãµãæ£æ¹åœ¢ã«å¯ŸããŠååž°çã«ã¢ã¯ã·ã§ã³ãç¹°ãè¿ãããšãã§ããŸãã ããã ãã§ããïŒ ããã§ãã¹ãŠã§ããããã¹ãŠã§ã¯ãããŸããã
ããã¯ãŸã ãã€ã¢ã¢ã³ãã¹ã¯ãšã¢ã§ã¯ãããŸãã-ãã®ã¢ã«ãŽãªãºã ã¯ãååãšããŠãäžç¹å€äœã¢ã«ãŽãªãºã ãšãåŒã°ããŸããæ¯èŒç蚱容ã§ããçµæãåŸããããšããäºå®ã«ãããããããçµæã®ç»åã§ãã®ããŸã£ãããªãæ§è³ªã«ç°¡åã«æ°ä»ãããšãã§ããŸãã
ãã€ã¢ã¢ã³ãã¹ã¯ãšã¢ã¢ã«ãŽãªãºã ïŒãå®éã®ããã©ã¯ã¿ã«ã©ã³ãã¹ã±ãŒããååŸã§ããã¢ã«ãŽãªãºã ïŒã¯ã2ã€ã®ã¹ãããã§æ§æããããšããç¹ã§2次å ã®äžç¹å€äœãšã¯ç°ãªããŸãã æåã¯ãããããã§ãã ãSquareã-åæ§ã«ãè§åºŠãå¹³åããå®éã®å€äœãå ç®ããããšã«ãããæ£æ¹åœ¢ã®äžå¿ç¹ã決å®ããŸã 'a-ã©ã³ãã åå·®ã 2çªç®ã®ã¹ãããããã€ã€ã¢ã³ããã¯ã蟺ã®äžå€®ã«ãããã€ã³ãã®é«ãã決å®ããããã«èšèšãããŠããŸãã ããã§ã¯ã2ã€ã®ãã€ã³ããã€ãŸããäžããšãäžãïŒåçŽåŽã®ãã€ã³ãã«ã€ããŠèª¬æããŸãïŒã§ã¯ãªãããå·Šããšãå³ãã®ãã€ã³ãã®ãã¢ãã€ãŸããæ£æ¹åœ¢ãã®ã¹ãããã§åŸããã2ã€ã®äžå¿ç¹ãå¹³åããŸãã åã®ã¹ãããã§ååŸãããããã®2ã€ã®é«ãã¯ãã§ã«ã«ãŠã³ããããŠããããšã«æ³šæããããšãéèŠã§ãããããã£ãŠãèšç®ã¯ãã¬ã€ã€ãŒãã§å®è¡ããæåã«ãã¹ãŠã®æ£æ¹åœ¢ã«å¯ŸããŠãæ£æ¹åœ¢ãã¹ããããå®è¡ãã次ã«ãã¹ãŠã®è±åœ¢ã«å¯ŸããŠããã€ã€ã¢ã³ããã¹ããããå®è¡ããããå°ããªæ£æ¹åœ¢ã«ã
説æã¯ãããã«ãããããããŸããã®ã§ãæ·»ä»ã®ã¹ããŒã ã泚ææ·±ãæ€èšããããšããå§ãããŸããåã¹ããŒã ã§ãã€ã³ãã®é«ããã©ã®ããã«èšç®ãããããããæ確ã«ããå¿ èŠããããŸãã
æ·±ããæ©ãã®ã§ã¯ãªãå¹ ãæ©ãå¿ èŠãããããšã«å ããŠãå¥ã®åŸ®åŠãªç¹ããããŸã-颚æ¯ã®ç«¯ã®ç¶æ³ã§ãã å®éããã€ã€ã¢ã³ãã®æ®µéã§ã¯ãã¢ã«ãŽãªãºã ã¯çŸåšã®æ£æ¹åœ¢ã®å€åŽã«ãããã€ã³ãã®é«ãã䜿çšããå Žåã«ãã£ãŠã¯ãããå šäœã䜿çšããŸãã ã«ãªãæ¹æ³ 2ã€ã®ãªãã·ã§ã³ããããŸãïŒãã¡ãããç¬èªã«èãåºãããšãã§ããŸãïŒïŒãããã®é«ãã0ïŒãŸãã¯1ããŸãã¯ä»ã®å®æ°ãããã¯ãç§ãã¡ã®é¢šæ¯ã®ç«¯ãæ°Žã«æµžãã®ã«äŸ¿å©ã§ãïŒã«çããããé£è¡æ©ãæãç³ãŸããŠãããšæ³åããŠãã ããããŒã©ã¹ïŒããã€ãã«ææãããŒã...ïŒãšãããã®å·Šå¢çç·ã®å·Šã«64ãã¯ã»ã«ããç¹ã®é«ããèŠã€ããããšãããšã å³å¢çç·ãã64ãã€ã³ãé¢ããç¹ã®é«ããèŠã€ããŸãã ããã¯éåžžã«ç°¡åã«å®è£ ãããŸãïŒãã ããæåã®ãªãã·ã§ã³ãšããŠïŒ-ãããã®ãµã€ãºã«çããã¢ãžã¥ã座æšãåãããšã§å©ããããŸãã
ãããã£ãŠããããã¯ã人工çã«çæãããæ¯èŠ³ã®é«åºŠããããæ§ç¯ããããã®åºæ¬çãªã¢ã«ãŽãªãºã ã§ãã ç§ã®æèŠã§ã¯ãæãçŸå®çãªçµæã¯ãããã®æåŸã®ãã€ã¢ã¢ã³ãã¹ã¯ãšã¢ã«ãã£ãŠäžããããŸã-ããã¯ããã€ãã®æ¬ ç¹ããªãããã§ã¯ãããŸãããã ããšãã°ã匷åãªè¿äŒŒã§èŠæ ãã®è¯ãããããäœæããããšã§ãå šäœã衚瀺ãããšãããã€ãã®å€§ããªå€§éžãæµ·ã®ä»£ããã«ãå€ãã®å°ããªå³¶ïŒãŸãã¯éå§æã®ãã€ãºïŒã衚瀺ãããŸãã èªå·±çžäŒŒæ§ã¯åºãŠããŸããã ããã¯ãç°ãªãã¹ã±ãŒã«ã®ãã©ã¯ã¿ã«ã©ã³ãã¹ã±ãŒãã®ããŸããŸãªçµã¿åããã«ãã£ãŠä¿®æ£ã§ããŸãã ãããã®å€ã¯ãä¹ç®ãå ç®ãããŸããŸãªä¿æ°ã§ã®äœ¿çšããŸãã¯ãããšãã°ããããã€å³ã䜿çšããŠååŸããããŒã¿ãåã蟌ãããšãã§ããŸããäžè¬ã«ãå®éšã®ç¯å²ã¯ååã«åºãã§ãã ãšããã§ã1ã€ã®ãã€ã¢ã¢ã³ãã¹ã¯ãšã¢ã®ã¿ã䜿çšããŠããååŸããå€ïŒä»¥åã¯æ£èŠåããããã€ãŸã0.0ãã1.0ã®ç¯å²ïŒãäºä¹ãããšäŸ¿å©ã§ããããã«ãããå¹³éãããç©ããã«ãªããå±±ã®åŸæãæ¥ã«ãªããŸãïŒæµžé£ã«ã€ããŠèŠããŠããŸããïŒïŒã
倧ããªå°å³çšã®è±åœ¢ã¢ã«ãŽãªãºã ã®ä¿®æ£
æåŸã«ããã€ã¢ã¢ã³ãã¹ã¯ãšã¢ã¢ã«ãŽãªãºã ã®å®è£ ã«ã€ããŠå°ã説æããŸãã ã©ã³ãã¹ã±ãŒããçæãããšãã«å°ããäž»ãªè³ªåã¯ããã®ãµã€ãºãå€§å¹ ã«å¢å ãããæ¹æ³ã§ãã 説æããã¢ã«ãŽãªãºã ã®æšæºå®è£ ã«ããã詳现ïŒãæ·±ããã«ç§»åïŒãç°¡åã«å¢ããããšãã§ããŸããã次å ïŒãå¹ ãïŒã«ã¯ã§ããŸããã
ç§ã¯ãã®åé¡ã次ã®ããã«è§£æ±ºããŸããã ããããªã-ããããããã®æ±ºå®ã¯èª°ãã«ããç¥ãããŠããããéåžžã«æçœã§ããããšãå€æãããããããŸãããããã®åã«ç§ã¯ããã«æ°ä»ãããããã«æãä»ããŸããã§ãããããŠå€±æããŸãã-ãã®äžã®è©³çŽ°ïŒã
ãã®ãããã¢ãããŒãã¯æ¬¡ã®ããã«ãªããŸããç§ãã¡ã®ã©ã³ãã¹ã±ãŒãã¯ãããšããšå·šå€§ãªãµã€ãºïŒããšãã°ã16777216x16777216ãã¯ã»ã«ã§ãããããã¯éçããã¯ã»ã©é ãïŒã§æ§æ³ãããŠããŸãã éèŠãªããšã¯ã åãã€ã³ãã®é«ãã調ã¹ãã®ã§ã¯ãªããããªãå°ããªããŠã£ã³ããŠãïŒããšãã°ã128x128ãã¯ã»ã«ïŒãååŸããé«ããããäžã移åããå¿ èŠãããããšã§ãã å ã®ã¢ã«ãŽãªãºã ã¯ç°¡åã«å€æŽã§ããããããŠã£ã³ããŠã®ãµã€ãºã«æ¯äŸããæäœã®æ°ã§ããããŠã£ã³ããŠããèšç®ããå¿ èŠããããŸãããã©ã³ãã¹ã±ãŒãã®ãµã€ãºã«ã¯ã»ãšãã©äŸåããŸããã ãã®ãããæåã¯ã©ã³ãã¹ã±ãŒããã»ãŒä»»æã«å€§ããèšå®ã§ããŸãã
ã¬ã€ãžãŒãã€ããã¯ã¹ãšåŒã°ããææ³ã圹ç«ã¡ãŸãã ç§ã話ããŠããããšãç¥ã£ãŠãã人ã«ãšã£ãŠã¯ãç§ã説æããåé¡ãç¥ããªã人ã«ãšã£ãŠã¯ããã§ã«æããã«ãªã£ãŠãããšæããŸãã ããã»ã¹å šäœãè£è¿ããŸã-倧ããªæ£æ¹åœ¢ããå§ããŠåãã¯ã»ã«ã«è¡ã代ããã«ãããã€ã³ãïŒxãyïŒã§é«ããèŠã€ããããšãã圢åŒã®ãªã¯ãšã¹ããåãå ¥ããäžã«ç§»åããŸããä»ã®4ã€ã®ãã€ã³ããšã©ã³ãã ã·ãããå¹³åããããšã§åŸãããŸããã æãé£ããã®ã¯ããããã®4ã€ã®ãã€ã³ããäœã§ãã£ãããç解ããããšã§ãã ãããç解ããåŸããé«ãã調ã¹ãããšãããªã¯ãšã¹ããç¹°ãè¿ãã ãã§ååã§ããããããã®ãã€ã³ãã®ããããã«ã€ããŠã§ãã ãããã®ãªã¯ãšã¹ãã¯ãé çªã«1ã¬ãã«é«ããªããæäžéšã«å°éããŠãããã®ã³ãŒããŒãã€ã³ãã«éãããŸã§ç¶ããŸãïŒç§ã«ãšã£ãŠã¯ããããã®å€åŽã®ãã€ã³ããšåæ§ã«ã0.0ã«çããïŒã ãœãŒã¹ã§ã¯ããã¹ãŠæ¬¡ã®ããã«ãªããŸãã
function val(x, y, v) { if (typeof(v) != 'undefined') data[x + '_' + y] = Math.max(0.0, Math.min(1.0, v)); else { if (x <= 0 || x >= size || y <= 0 || y >= size) return 0.0; if (data[x + '_' + y] == null) { // . base = 1; while (((x & base) == 0) && ((y & base) == 0)) base <<= 1; if (((x & base) != 0) && ((y & base) != 0)) squareStep(x, y, base); else diamondStep(x, y, base); } return data[x + '_' + y]; } } function displace(v, blockSize, x, y) { return (v + (randFromPair(x, y, seed) - 0.5) * blockSize * 2 / size * roughness); } function squareStep(x, y, blockSize) { if (data[x + '_' + y] == null) { val(x, y, displace((val(x - blockSize, y - blockSize) + val(x + blockSize, y - blockSize) + val(x - blockSize, y + blockSize) + val(x + blockSize, y + blockSize)) / 4, blockSize, x, y)); } } function diamondStep(x, y, blockSize) { if (data[x + '_' + y] == null) { val(x, y, displace((val(x - blockSize, y) + val(x + blockSize, y) + val(x, y - blockSize) + val(x, y + blockSize)) / 4, blockSize, x, y)); } }
äž»ãªããšã¯ããã§ã«èšç®ãããã¹ãŠã®é«åºŠå€ãèšæ¶ïŒããã³ãã£ãã·ã¥ã«è¿œå ïŒããããšã§ãã ããã«ãããåãããšãäœåºŠãè¡ãããšãã§ããªããªããŸãã å®éãããŠã£ã³ããŠãã®æåã®ãã€ã³ããèšç®ãããšããŠãããã®ããŠã£ã³ããŠãã«å±ããä»ã®å€ãã®ãã€ã³ããåæã«èªèããŸãã å®éãããŠã£ã³ããŠãã®ãã¹ãŠã®ãã€ã³ããå®è¡ããã®ã§ãäžå¿ èŠãªæäœã¯ããŸãè¡ããŸããããã ãããã®æ£ç¢ºãªæ°ã¯ãããŠã£ã³ããŠãïŒå·Šäžé ãšãµã€ãºïŒã2ã®ã¹ãä¹ã§æŽåããŠãããã©ããã«å€§ããäŸåããŸãã
æ¢ã«è¿°ã¹ãããã«ãã¢ã«ãŽãªãºã ã«ã¯ããã€ãã®éæ³ã®è¡ããããŸã-ããã«ãããŸãïŒ
base = 1; while (((x & base) == 0) && ((y & base) == 0)) base <<= 1; if (((x & base) != 0) && ((y & base) != 0)) squareStep(x, y, base); else diamondStep(x, y, base);
ããã§ã¯ãçŸåšã®ç¹ãæ£æ¹åœ¢ãŸãã¯è±åœ¢ã®äžå¿ã§ãããã©ãããããã³ãã®å³åœ¢ã®ãµã€ãºã¯äœãã決å®ããŸãã æ£çŽã«èšããšããã®ã³ãŒãã¯çŽæã«ãã£ãŠæžããããã®ã§ãããæ£ç¢ºãªæ°åŠçæ£åœæ§ã瀺ãããšã¯ã§ããŸããã å°ãªããšãããããã®åº§æšã§ãŒã以å€ã®æäžäœããããèŠã€ããã ãã§ã-æãŸãããµã€ãºã«ãªããŸãã ãããŠãå³ãæ£æ¹åœ¢ãã©ãããå€æããããã«ããã®ããããäž¡æ¹ã®åº§æšã«èšå®ãããŠããããšã確èªããŸãã ããã§ã¯ãäž¡æ¹ã®åº§æšã«nullã€ã³ããã¯ã¹ãä»ããããŠããŸãã
ãããŠæåŸã«ãäºæ³å€ã®èœãšãç©ŽïŒæ¬äŒŒä¹±æ°ãžã§ãã¬ãŒã¿ãŒã ç§ã®ã³ãŒãã§ã¯ãç°åžžãªèŠä»¶ã課ãããŠããŸãããåãã€ã³ãïŒxãyïŒã«å¯ŸããŠãåžžã«åãä¹±æ°ãååŸãããã®ã§ãããã«ãããè¡ããŸãã ä¹±æ°ãžã§ãã¬ãŒã¿ãŒã®å€ãã®ããã°ã©ãã³ã°èšèªã«ã¯ããããã çæãããæ°å€ã®æ¬¡ã®ã·ãŒã±ã³ã¹å šäœãäŸåãããã·ãŒããïŒJavaScriptã§ã¯ããã¯ç°ãªããŸããã圌ã«ã¯åºç¯å²ã«ãããMersenne vortexã®å®è£ ããããŸãïŒã åé¡ã¯ãã·ãŒã±ã³ã¹ãç§ãã¡ã«åããªããšããããšã§ã-ãŠã£ã³ããŠãã·ããïŒããã³ãã£ãã·ã¥ãã¯ãªã¢ïŒãããšãå®å šã«ç°ãªãåŽã®1ã€ã®ãã€ã³ãã«è¿ã¥ããã©ã³ãã ã·ãããç°ãªããŸãã ã©ããªç¶æ³ã§ãããããèæ ®ããŠãéçãªæ¯èŠ³ãå¿ èŠã§ãã äž¡æ¹ã®åº§æšã«å¿ããŠãç²åãã§æ¯åã¡ã«ã»ã³ã枊ãåæåããè©Šã¿ã¯å€±æããŸããïŒåæåã«æéãããããããŸãã
å°ãèããŠããã2ã€ã®åº§æšããããã«ã»ãšãã©çžé¢ããªãæ°ã«å€æããç°¡åãªæ¹æ³ã¯ãååãšããŠäžå¯èœã§ãããšããçµè«ã«éããŸããã ãã®çµæãåçŽãªã¢ãžã¥ãŒã«ã«ããè€æ°ã®æ°åã®ååŸã«ããã蚱容å¯èœãªçµæãåŸããããããªé¢æ°ã«æ±ºããŸããã
function randFromPair(x, y) { for (var i = 0; i < 80; i++) { var xm7 = x % 7; var xm13 = x % 13; var xm1301081 = x % 1301081; var ym8461 = y % 8461; var ym105467 = y % 105467; var ym105943 = y % 105943; y = x + seed; x += (xm7 + xm13 + xm1301081 + ym8461 + ym105467 + ym105943); } return (xm7 + xm13 + xm1301081 + ym8461 + ym105467 + ym105943) / 1520972.0; }
ããã«ããã®é¢æ°ã«ãã°ããŒãã«ã°ã¬ã€ã³ããç°¡åã«å°å ¥ããããšãã§ããŸãããããã¯ãã©ã³ãã¹ã±ãŒãå šäœã決å®ããæ®åºã®ååŸã«ããããã®æ»ãå€ã¯[0ã1ïŒã®ç¯å²ã«ããªãåçã«ååžããããšãå€æããŸããã ããããç§ã¯ããªããããéããšã¬ã¬ã³ããªãœãªã¥ãŒã·ã§ã³ãæãã€ãããšãã§ãããšç¢ºä¿¡ããŠããŸã-ãã®èšäºã§ãã®ã宿é¡ããèæ ®ããããšãã§ããŸã:)
ãããã誰ããæšæž¬ããããã«ãJavaScriptã§å®è£ ãäœæãããããå€ãšãœãŒã¹ã³ãŒãã®äž¡æ¹ãç°¡åã«è©Šãããšãã§ããŸãã ããŒãžèªäœã¯http://denull.ru/terrain.htmã§å ¥æã§ãããã¹ãŠã®ã³ãŒãã¯ãã¡ã€ã«http://denull.ru/terrain.jsã«ãããŸãã 衚瀺ããã«ã¯ãhtml5ããµããŒããããã©ãŠã¶ãŒãå¿ èŠã§ãïŒæ£çŽãªãšãããGoogle Chromeã§ã®ã¿ãã¹ãããŸããïŒãããã¯ãã¬ã³ããªã³ã°ããã£ã³ãã¹ã«éãããããã§ãïŒãŸããã¬ã³ããªã³ã°èªäœã«ãæéãããããŸãïŒã
é¢é£è³æ
- ãªã¢ã«ã¿ã€ã æç¶ãåå°åœ¢çæ ïŒPDFã1.52 MbïŒã å°åœ¢ã®äœæã«é¢ããéåžžã«è©³çŽ°ã§èå³æ·±ãè³æ-ãããã€å³ãšãã€ã¢ã¢ã³ãã¹ã¯ãšã¢ã¢ã«ãŽãªãºã ã®äž¡æ¹ã䜿çšãã䟵é£æ¹æ³ã®èª¬æãšå€ãã®å³ãšåŒã䜿çšããŸãã
- Polygonal Map Generation ããããã€å³ã«åºã¥ããã©ã³ãã¹ã±ãŒãã®æ§ç¯ã«é¢ããçŽ æŽãããèšäºã ãã説æãããŠããããã«ããã¢swfãã¡ã€ã«ãä»ã®è³æãžã®å€ãã®ãªã³ã¯ããããŸãã
- GPUã§ã®é«éæ²¹å§äŸµé£ã·ãã¥ã¬ãŒã·ã§ã³ãšå¯èŠå ã PDFããã³ç»åã ãã§ãªãããããäœã§ããããç解ããã®ã«åœ¹ç«ã€ããã€ãã®ãããªãååšããå Žåã®æ°Žã®æµžé£ã®ã·ãã¥ã¬ãŒã·ã§ã³ã®æé©åã«é¢ããèšäºã GPUã®è² è·ãã·ããããŠããã»ã¹ãæé©åãããšããã¢ã€ãã¢ãã©ãã§ããããã®ããã¥ã¡ã³ãã«ã¯äŸµé£ã¡ã«ããºã ã«é¢ããååãªæ å ±ããããŸãã
- ãã©ã¯ã¿ã«ã¢ã«ãŽãªãºã ã«é¢ããçãèšäºïŒ ã©ã³ãã ãã©ã¯ã¿ã«ãã¬ã€ã³ã®çæ ã ãã©ã¯ã¿ã«ã©ã³ãã¹ã±ãŒã ã ãã©ã¯ã¿ã«ãã¬ã€ã³ ã ãã€ã¢ã¢ã³ãã¹ã¯ãšã¢ã¢ã«ãŽãªãºã ã