jill:algo:eyes

This shows you the differences between two versions of the page.

Both sides previous revision Previous revision | |||

jill:algo:eyes [2016/04/16 19:24] emeric how compute xd and yd |
jill:algo:eyes [2016/04/20 16:41] (current) emeric Add compute |
||
---|---|---|---|

Line 9: | Line 9: | ||

//iYD// is between -1 to 1.\\ | //iYD// is between -1 to 1.\\ | ||

To compute //iXD// and //iYD//, use right-angle triangle, with hypotenuse equal to 4. | To compute //iXD// and //iYD//, use right-angle triangle, with hypotenuse equal to 4. | ||

+ | |||

+ | {{ :jill:algo:triangle-right-angle.png |}} | ||

+ | |||

+ | tan @ = ps / fs | ||

+ | |||

+ | ps = Player.X - (Eye.X + Lens.OffsetX)\\ | ||

+ | fs = Player.Y - (Eye.Y + Lens.OffsetY) | ||

+ | |||

+ | Lens.OffsetX = 5\\ | ||

+ | Lens.OffsetY = 4 | ||

+ | |||

+ | //iXD// = 4 * sin @\\ | ||

+ | //iYD// = 4 * cos @ |

jill/algo/eyes.txt ยท Last modified: 2016/04/20 16:41 by emeric