cgfs:shaded_triangles
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
cgfs:shaded_triangles [2024/06/14 00:52] – freemikan | cgfs:shaded_triangles [2024/07/12 03:20] (現在) – freemikan | ||
---|---|---|---|
行 1: | 行 1: | ||
- | <codeprism lang=cpp el=true css=full> | + | {{: |
+ | |||
+ | |||
+ | <file cpp> | ||
#include < | #include < | ||
行 119: | 行 122: | ||
auto x_r = static_cast< | auto x_r = static_cast< | ||
- | //~ h_segment.resize(x_r - x_l + 1); | ||
h_segment.clear(); | h_segment.clear(); | ||
Interpolate(x_l, | Interpolate(x_l, | ||
行 125: | 行 127: | ||
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, |
} | } | ||
} | } | ||
行 132: | 行 134: | ||
int main() { | int main() { | ||
- | InitWindow(Cw, | + | InitWindow(Cw, |
VertexPositionIntensity p0{-100, 200, 1.0}; | VertexPositionIntensity p0{-100, 200, 1.0}; | ||
行 148: | 行 150: | ||
} | } | ||
} | } | ||
- | </codeprism> | + | </file> |
cgfs/shaded_triangles.1718293972.txt.gz · 最終更新: 2024/06/14 00:52 by freemikan