image
This commit is contained in:
parent
e148b07be7
commit
3c296b52eb
|
|
@ -48,7 +48,7 @@
|
|||
<ul class="navigationBar" >
|
||||
<li class="navigationBar" onclick="previusPage()">< < Previous</li>
|
||||
<li class="navigationBar" onclick="homePage()"> Home </li>
|
||||
<!-- <li class="navigationBar" onclick="nextPage()">Next > ></li> -->
|
||||
<li class="navigationBar" onclick="nextPage()">Next > ></li>
|
||||
</ul>
|
||||
|
||||
<footer>
|
||||
|
|
|
|||
|
|
@ -43,9 +43,11 @@ mat2 rotate2d(float _angle){
|
|||
}
|
||||
```
|
||||
|
||||
According to the way we've been drawing shapes, this is not exactly what we want. Our cross shape is drawn in the center of the canvas which corresponds to the position ```vec2(0.5)```. So, before we rotate the space we need to move shape from the `center` to the ```vec2(0.0)``` coordinate, rotate the space, then finally move it back to the original place.
|
||||
|
||||

|
||||
|
||||
According to the way we've been drawing shapes, this is not exactly what we want. Our cross shape is drawn in the center of the canvas which corresponds to the position ```vec2(0.5)```. So, before we rotate the space we need to move shape from the `center` to the ```vec2(0.0)``` coordinate, rotate the space, then finally move it back to the original place.
|
||||
That will looks like the following code:
|
||||
|
||||
<div class="codeAndCanvas" data="cross-rotate.frag"></div>
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
<ul class="navigationBar" >
|
||||
<li class="navigationBar" onclick="previusPage()">< < Previous</li>
|
||||
<li class="navigationBar" onclick="homePage()"> Home </li>
|
||||
<li class="navigationBar" onclick="nextPage()">Next > ></li>
|
||||
<!-- <li class="navigationBar" onclick="nextPage()">Next > ></li> -->
|
||||
</ul>
|
||||
|
||||
<footer>
|
||||
|
|
|
|||
BIN
08/rotate.jpg
BIN
08/rotate.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 60 KiB |
Loading…
Reference in New Issue