Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
back2root:archives:denthor:part-03 [2023/05/18 20:35] – frater | back2root:archives:denthor:part-03 [2023/05/18 21:07] (Version actuelle) – frater | ||
---|---|---|---|
Ligne 97: | Ligne 97: | ||
0.005 seem to be best for the 320x200 screen. | 0.005 seem to be best for the 320x200 screen. | ||
- | < | + | <WRAP round info> |
ASPHYXIA does not use this particular circle algorithm, ours is in assembly language, but this one should be fast enough for most. If it isn't, give us the stuff you are using it for and we'll give you ours. | ASPHYXIA does not use this particular circle algorithm, ours is in assembly language, but this one should be fast enough for most. If it isn't, give us the stuff you are using it for and we'll give you ours. | ||
</ | </ | ||
Ligne 109: | Ligne 109: | ||
{{drawio> | {{drawio> | ||
- | |||
- | Ie. o (X1,Y1) | ||
- | ooooooooo | ||
- | | ||
- | oooooooo | ||
Again, sorry about my drawings ;-) | Again, sorry about my drawings ;-) | ||
Ligne 137: | Ligne 132: | ||
As you can see, the slopes are real numbers. | As you can see, the slopes are real numbers. | ||
- | < | + | <WRAP round info> |
XSlope = 1 / YSlope | XSlope = 1 / YSlope | ||
</ | </ | ||
Ligne 150: | Ligne 145: | ||
{{drawio> | {{drawio> | ||
- | |||
- | o | ||
- | o | ||
- | o | ||
Instead of this : | Instead of this : | ||
{{drawio> | {{drawio> | ||
- | ooo | ||
- | ooo | ||
- | ooo | ||
Well, the solution is as follows : | Well, the solution is as follows : | ||
- | {{drawio>back2root: | + | <code> |
- | + | *\``|``/* | |
- | | + | ***\|/*** |
- | | + | ----+---- |
- | | + | ***/|\*** |
- | | + | */``|``\* |
- | | + | </ |
If the slope angle is in the area of the stars (*) then use the first equation, if it is in the other section (`) then use the second one. | If the slope angle is in the area of the stars (*) then use the first equation, if it is in the other section (`) then use the second one. | ||
What you do is you calculate the variable on the left hand side by putting the variable on the right hand side in a loop and solving. Below is our finished line routine : | What you do is you calculate the variable on the left hand side by putting the variable on the right hand side in a loop and solving. Below is our finished line routine : | ||
+ | |||
+ | === function: === | ||
<code pascal> | <code pascal> |