From 7e48c57e1c76d4ef874a2e15bfe9fd43e33f60a8 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Thu, 1 Jan 2026 09:49:59 -0800 Subject: Notes on coordinate systems --- include/swgfx.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include') 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 @@ Software rendering library. Coordinate systems: -- Pixel coordinates (i,j) refer to the center of the pixel. - Thus, real-valued coordinates (x,y) with no fractional part point at the pixel center. -- Viewport origin is the top-left corner of the screen. - The viewport axes extend down and to the right. +- The coordinate systems for image addressing and texture sampling are the same + except in scale. + Origin is in the top-left corner of the image. + Axes extend down and to the right. +- Image addressing: + (i,j) integer coordinates refer to the center of the pixel. +- Texture addressing: + (u,v) range in [0,1]. + (0,0) is the center of the top-left pixel. + (1,1) is the center of the bottom-right pixel. Multi-threading: - Internal resources (swgfx context) are externally synchronized. -- cgit v1.2.3