update
This commit is contained in:
@@ -11,9 +11,6 @@ draw_line :: (screen: *Screen, p1: Vec2s64, p2: Vec2s64, char: u8 = DEFAULT_PIXE
|
||||
p1_c := p1;
|
||||
p2_c := p2;
|
||||
|
||||
// p1_c.y /= 2;
|
||||
// p2_c.y /= 2;
|
||||
|
||||
dx := abs(p2_c.x - p1_c.x);
|
||||
dy := -abs(p2_c.y - p1_c.y);
|
||||
sx := ifx p1_c.x < p2_c.x then 1 else -1;
|
||||
|
||||
18
src/main.jai
18
src/main.jai
@@ -52,20 +52,32 @@ cool_demo_1 :: (screen: *Screen, offset: s64, theta: s64) {
|
||||
};
|
||||
|
||||
scale(.{0.5, 0.8}, *t1);
|
||||
translate(.{0, 20}, *t1);
|
||||
translate(.{50, 5}, *t1);
|
||||
translate(.{50, 20}, *t1);
|
||||
rotate(theta, get_triangle_centroid(t1), *t1);
|
||||
|
||||
draw_triangle(screen, t1, #char "%");
|
||||
|
||||
t2 := t1;
|
||||
|
||||
scale(.{0.5, 0.5}, *t1);
|
||||
scale(.{0.2, 0.2}, *t1);
|
||||
draw_triangle(screen, t1, #char "%");
|
||||
|
||||
// draw centroid lines
|
||||
// draw_line(screen, get_triangle_centroid(t1), get_triangle_centroid(t2), #char ".");
|
||||
|
||||
// draw_line(screen, get_triangle_centroid(t1), t1.p1, #char ".");
|
||||
// draw_line(screen, get_triangle_centroid(t1), t1.p2, #char ".");
|
||||
// draw_line(screen, get_triangle_centroid(t1), t1.p3, #char ".");
|
||||
|
||||
// draw_line(screen, get_triangle_centroid(t2), t2.p1, #char ".");
|
||||
// draw_line(screen, get_triangle_centroid(t2), t2.p2, #char ".");
|
||||
// draw_line(screen, get_triangle_centroid(t2), t2.p3, #char ".");
|
||||
|
||||
// connect triangles to eachother for fake 3d effect
|
||||
draw_line(screen, t1.p1, t2.p1, #char "%");
|
||||
draw_line(screen, t1.p2, t2.p2, #char "%");
|
||||
draw_line(screen, t1.p3, t2.p3, #char "%");
|
||||
|
||||
}
|
||||
|
||||
cool_demo_2 :: (screen: *Screen, offset: s64, theta: s64) {
|
||||
|
||||
Reference in New Issue
Block a user