> black parts of an object are drawn as if they were transparent;
> ãã®èšå®ã¯ãªããžã§ã¯ãã®é»ãéšåã¯éæã«æãããŸãã
ä»®å®æ³ãªã®ã§ããããããéæã§ãããã®ããã«æãããŸãããããã®æ¹ã誀解ãç¡ããããããŸããã
> (you might want to try experimenting with larger or smaller numbers)
> ïŒè©Šéšçã«ãã£ãšå€§ããªæ°åãå°ããªæ°åãè©Šããããšæãããç¥ããŸãããïŒ
you might want to ... ã¯ã...ããŠã¿ããšè¯ãã§ããããã®ãããªèš³ãæ¹ãè¯ãããšæããŸããïŒæ
£çšå¥ã§ãïŒ
http://eow.alc.co.jp/you+might+want+to
> The way I've found it easiest to understand is that each object is created as a dictionary (or hashtable, or associative array) and then is turned into a fully-fledged object by putting values into it. The object's fields are simply entries in the dictionary that map to values, and the methods are entries that map to functions. Now, we add to that the fact that for single-word keys, the syntax foo.bar is a valid JavaScript shortcut for foo["bar"], and you can see how you get syntax similar to other languages' from a very different starting point.
> ç§ãèŠã€ããç解ããããã®æãç°¡åãªæ¹æ³ã¯ãããããã®ãªããžã§ã¯ãã¯èŸæžïŒãŸãã¯ããã·ã¥ããŒãã«ãé£æ³é
åãšãåŒã°ããïŒãšããŠçæãããå€ãè¿œå ããããšã«ãã£ãŠå®å
šãªãªããžã§ã¯ãã«ãªããšèããäºã§ãããªããžã§ã¯ãã®ãã£ãŒã«ãã¯å€æ°ãšããŠããããããåãªãèŸæžã®èŠçŽ ã§ãã¡ãœããã¯é¢æ°ã«ããããããèŠçŽ ãšãªããŸããããã«ãèŸæžã®1èªãããªãããŒã«ã€ããŠãfoo.barãšããæžãæ¹ãfoo["bar"]ã®JavaScriptã§ã®æå¹ãªã·ã§ãŒãã«ããã§ããããšãä»ãå ããŸããããã§ä»ã®èšèªã®ææ³ãšåãã ãšç解ããããæ¹æ³ããããªãé ãäœçœ®ããåããŠç解åºæ¥ãŸãããã
ãã®èŸºãæ©ãã ãšããã§ãããã? ãããªæãã ãšæå³ãå°ããããããããªããããããŸããã
ãç§ãæãç°¡åã ãšèããç解ã®ä»æ¹ã§èª¬æãããšãããããã®ãªããžã§ã¯ãã¯èŸæžïŒãŸãã¯ããã·ã¥ããŒãã«ããŸãã¯é£æ³é
åïŒãšããŠçæãããããã«å€
ãè¿œå ããããšã«ãã£ãŠå®å
šãªãªããžã§ã¯ãã«ãªããŸãããªããžã§ã¯ãã®ãã£ãŒã«ãã¯ãã®èŸæžã§å€ã«å¯Ÿå¿ãããšã³ããªã§ãããã¡ãœããã¯ãã®èŸæžã§é¢æ°ã«
察å¿ãããšã³ããªã§ãããããŠããã1èªã®ããŒã«ã€ããŠãfoo.barãšããææ³ã¯ãfoo["bar"]ãšããJavaScriptã®æå¹ãªççž®æ§
æã§ããããšèããã°ãä»ã®èšèªã«é¡äŒŒãããã®ææ³ããå
šãéãèŠç¹ããç解ã§ããããšæããŸããã
> when you're in any JavaScript function, there is an implicitly-bound variable called this which refers to the function's "owner".
> JavaScriptã®ã©ããªé¢æ°ã®äžã«ããŠãæé»çã«çµã³ã€ããâthisâãšåŒã°ããé¢æ°ã®ãªãŒããŒã«çµã³ã€ããå€ãååšããŸãã
ãJavaScriptã®ãããªãé¢æ°ã®äžã«ããå Žåã§ãããã®é¢æ°ã®ããªãŒããŒããè¡šããæé»çã«ãã€ã³ããããthisãšããå€æ°ãååšããŸ
ããã
ïŒèªç¹ããããšåèªã®ä¿ãåããæ確ã«ãªããŸããïŒ
> For global functions this is a global per-page "window" object,
> ã°ããŒãã«é¢æ°ã®å Žåã«ã¯"this"ã¯ããŒãžæ¯ã®"window"ãªããžã§ã¯ãã§ãã
ã°ããŒãã«é¢æ°ã®å Žåã«ã¯"this"ã¯ããŒãžæ¯ã®ã°ããŒãã«"window"ãªããžã§ã¯ãã§ãã
> there's one special attribute associated with a function, prototype. This is a dictionary of values that are associated with every object that is created using the new keyword with that function; this is a good way of setting values that will be the same for every object of that "class" â for example, methods.
> PrototypeãšåŒã°ããé¢æ°ã«é¢é£ããç¹å¥ãªå±æ§ïŒattributeïŒãååšããŸããããã¯ãªããžã§ã¯ãçæã®ããã®é¢æ°ã«newã䜿ã£ãŠäœããããå
šãŠã®ãªããžã§ã¯ãã«é¢é£ããå€ã®æ ŒçŽãããèŸæžã§ãïŒããã¯"class"ã®ãªããžã§ã¯ãå
šãŠã«å
±éãªå€ãç»é²ããè¯ãæ¹æ³ã§ãã-äŸãã°ãã¡ãœããã
ãprototypeãšåŒã°ããé¢æ°ã«é¢é£ããç¹å¥ãªå±æ§ïŒattributeïŒãååšããŸããããã¯ããã®é¢æ°ã«newããŒã¯ãŒããä»ããŠçæãããª
ããžã§ã¯ãã®å
šãŠã«é¢é£ä»ããããã¹ãå€ããã€èŸæžã§ãã
ãã®ãã¯ã©ã¹ãã®å
šãŠã®ãªããžã§ã¯ãã§å
±éããå€ïŒäŸãã°ã¡ãœããïŒãèšå®ããã«ã¯ããããè¯ãæ¹æ³ãšãªããŸããã
ïŒJavaScriptã¯å€§æåå°æåãèå¥ããã®ã§ãPrototypeã§ã¯ãŸããã§ãã2æç®ã¯ãprototypeãé©çšããã察象ããnewã§
çæãããå
šãŠã®ãªããžã§ã¯ããã§ã¯ãªããããã®é¢æ°ãã«newã䜿çšããŠçæããããªããžã§ã¯ãã®ã¿ã§ããããšåããããã«æžãæããŠããŸãã3æç®
ã®ãã¯ã©ã¹ãã®åã®ããã®ããåãç®çã§ããïŒ
> So, draw is defined to take the parameters we passed in to it back in the main drawScene function.
> "drawã¡ãœããã¯ãã©ã¡ã¿ãåãåãããã«å®çŸ©ãããæ¢ã«èª¬æããdrawSceneé¢æ°ã®äžã§åŒã³åºãããŸãã
drawã¡ãœããã¯ãå
ã®ã¡ã€ã³ã®drawSceneé¢æ°ã«ãããåŒã³åºãã§ç€ºãããšããã®ãã©ã¡ãŒã¿ãåãåãããå®çŸ©ãããŠããŸãã
ïŒæç¯ãåºåããšãdraw is defined / to take [the parameters we passed [in to it
(draw method)] [(as described) back in the main drawScene function] ] ãš
ããæãã§ãããããïŒ
> æèªèº«ãæãåã«ç°ãªãè²ã§å転ããªãæãæç»ããŸãã
æèªèº«ãæãåã«ãç°ãªãè²ã®ãå転ããªãæãæç»ããŸãã
> elapsedTime is in milliseconds, and so we want an effective frames-per-millisecond of 60 / 1000.
elapsedTimeã¯ããªç§ã§ãããå®éã®ããªç§éãã¬ãŒã ã¬ãŒãã 60 / 1000 ã«ããããšããŠããŸãã
ïŒèš³ãæãïŒ
> Starã®prototyãæ§æããæåŸã®éšåã¯ãæ§ç¯åŠçã®äžãšä»èŠãã¢ãã¡ãŒã·ã§ã³åŠçã®äžã§èŠãç¬ãçšãšãã®ä»ã®ïŒã€ã®è²ãã©ã³ãã ã«æ±ºå®ããåŠçã§ãã
prototype
> ...and we're done with the star's prototype. So, that's how a star object is created, complete with methods to draw and animate it. Now, just above these functions, you can see the (rather dull) code that draws the star: it just draws a square in a manner that will be familiar from the first lesson, using an appropriate texture and vertex position/texture coordinate buffers:
> "ããã§Startã®prototypeã¯å®äºã§ãããããæç»ãšã¢ãã¡ãŒã·ã§ã³ã®ã¡ãœãããæã£ãstar objectãã©ã®ããã«äœããããã§ãã"
ãããã§ãã®æã®prototypeã¯å®äºã§ããã€ãŸããããããæãªããžã§ã¯ããã©ãçæããããã®æç»ãšã¢ãã¡ãŒã·ã§ã³ãè¡ãã¡ãœãããã©ãèšå®ã
ããããè¡šãããã®ã§ããããŠããããŸã§ã®é¢æ°ã§ãæãæç»ããïŒéå±ãªïŒã³ãŒããèªãããšãåºæ¥ãŸãããé©åãªãã¯ã¹ãã£ãšè¡åã®äœçœ®/ãã¯ã¹ãã£åº§
æšãããã¡ã䜿çšããŠã第1åã®ã¬ãã¹ã³ããããªãã¿ã®æ£æ¹åœ¢ãæç»ããã ãã§ããã
ïŒå€§æåã¯ååãå°æåã¯äžè¬èªãšè§£éããŠããŸããããšè¶³ããªããšãããé©åœã«èš³ããŸããïŒ
> ãã£ãŠããããšã¯æã®drawã¡ãœããã§ã»ãããããè²ãuniformããåãåºããŠã¢ãã¯ãã®ãã¯ã¹ãã£ã«å¯ŸããŠå©çšããŸãã
ããã§ãã£ãŠããã®ã¯ãæã®drawã¡ãœããã§ã»ãããããè²ãuniformããåãåºããŠã¢ãã¯ãã®ãã¯ã¹ãã£ã«å¯ŸããŠå©çšããããšããããšã§
ãã
> As always, I'm deeply in debt to NeHe for his OpenGL tutorial for the script for this lesson.
> ãã€ãã®ããã«NeHeã®OpenGLãã¥ãŒããªã¢ã«ã®ãã®ã¬ãã¹ã³ã®ããã®ã¹ã¯ãªããã«ãšãŠãæè¬ããŠããŸãã
ããã®ã¬ãã¹ã³ã®ã¹ã¯ãªããã®äœæã«ã€ããŠã¯ããã€ãã®ããã«ãNeHeã®OpenGLãã¥ãŒããªã¢ã«ã«ãšãŠãæè¬ããŠããŸããã
ïŒNeHeã«ã¹ã¯ãªãããããããã«èªããã®ã§ä¿®æ£ïŒ
----
以äžãåèãŸã§âŠ
Atsushi Eno
On Feb 19, 2:10 am, tmasda <yukiponnek...@gmail.com> wrote:
> tmasdaã§ãã
> Learning WebGLã®9ç« ã®ç¿»èš³ãçµãã£ãã®ã§ã©ãªãã確èªããé¡ãããŸãã
>
> https://sites.google.com/site/hackthewebgl/learning-webglhon-yaku/hon...
>
> ã¡ãã£ãšèªä¿¡ãç¡ãå Žæãäºã«æã»ã©ãããŸãã
>
> ãããããé¡ãããŸãã