差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
cgfs:shaded_triangles [2024/06/14 21:26] – freemikan | cgfs:shaded_triangles [2025/05/18 15:41] (現在) – freemikan | ||
---|---|---|---|
行 1: | 行 1: | ||
- | < | + | ====== DrawPixelだけで三角形を描く (3) 明暗をつける ====== |
+ | |||
+ | {{: | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | <file cpp> | ||
#include < | #include < | ||
行 124: | 行 130: | ||
for (int x = x_l; x <= x_r; ++x) { | for (int x = x_l; x <= x_r; ++x) { | ||
- | | + | |
- | PutPixel(x, y, shaded_color); | + | PutPixel(x, y, color_scaled(color, |
} | } | ||
} | } | ||
行 147: | 行 153: | ||
} | } | ||
} | } | ||
- | </codeprism> | + | </file> |