diff options
| author | 3gg <3gg@shellblade.net> | 2026-01-01 09:49:59 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2026-01-01 09:49:59 -0800 |
| commit | 7e48c57e1c76d4ef874a2e15bfe9fd43e33f60a8 (patch) | |
| tree | 2e6f9435c62ef5212a41ff4d0ae952a0408bb98f /include/swgfx.h | |
| parent | 7b9162ea7f4c78aa56a4a73187b22593b5d54913 (diff) | |
Notes on coordinate systems
Diffstat (limited to 'include/swgfx.h')
| -rw-r--r-- | include/swgfx.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/swgfx.h b/include/swgfx.h index 4a98116..d1f56df 100644 --- a/include/swgfx.h +++ b/include/swgfx.h | |||
| @@ -2,10 +2,16 @@ | |||
| 2 | Software rendering library. | 2 | Software rendering library. |
| 3 | 3 | ||
| 4 | Coordinate systems: | 4 | Coordinate systems: |
| 5 | - Pixel coordinates (i,j) refer to the center of the pixel. | 5 | - The coordinate systems for image addressing and texture sampling are the same |
| 6 | Thus, real-valued coordinates (x,y) with no fractional part point at the pixel center. | 6 | except in scale. |
| 7 | - Viewport origin is the top-left corner of the screen. | 7 | Origin is in the top-left corner of the image. |
| 8 | The viewport axes extend down and to the right. | 8 | Axes extend down and to the right. |
| 9 | - Image addressing: | ||
| 10 | (i,j) integer coordinates refer to the center of the pixel. | ||
| 11 | - Texture addressing: | ||
| 12 | (u,v) range in [0,1]. | ||
| 13 | (0,0) is the center of the top-left pixel. | ||
| 14 | (1,1) is the center of the bottom-right pixel. | ||
| 9 | 15 | ||
| 10 | Multi-threading: | 16 | Multi-threading: |
| 11 | - Internal resources (swgfx context) are externally synchronized. | 17 | - Internal resources (swgfx context) are externally synchronized. |
