Skip to content

Commit

Permalink
...what was the purpose of light and dark? I don't remember
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith committed Nov 21, 2024
1 parent 6ba543b commit 01fc17c
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/progressed/graphics/draw3d/Fill3D.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void quad(float x1, float y1, float z1,
quad(x1, y1, z1, color, x2, y2, z2, color, x3, y3, z3, color, x4, y4, z4, color);
}

public static void tube(float x, float y, float rad, float z2, Color baseColorLight, Color baseColorDark, Color topColorLight, Color topColorDark){
public static void tube(float x, float y, float rad, float z2, Color baseColor, Color topColor){
float scl = Perspective.scale(x, y, z2);
if(scl < 0) return;

Expand All @@ -60,26 +60,15 @@ public static void tube(float x, float y, float rad, float z2, Color baseColorLi
x2 = x + rad * cos2,
y2 = y + rad * sin2;

float cLerp1 = 1f - Angles.angleDist(a, 45f) / 180f,
cLerp2 = 1f - Angles.angleDist(a + space, 45f) / 180f;
Color bc1f = Tmp.c1.set(baseColorLight).lerp(baseColorDark, cLerp1),
tc1f = Tmp.c2.set(topColorLight).lerp(topColorDark, cLerp1),
bc2f = Tmp.c3.set(baseColorLight).lerp(baseColorDark, cLerp2),
tc2f = Tmp.c4.set(topColorLight).lerp(topColorDark, cLerp2);

quad(
x1, y1, 0, bc1f,
x2, y2, 0, bc2f,
x2, y2, z2, tc2f,
x1, y1, z2, tc1f
x1, y1, 0, baseColor,
x2, y2, 0, baseColor,
x2, y2, z2, topColor,
x1, y1, z2, topColor
);
}
}

public static void tube(float x, float y, float rad, float z2, Color baseColor, Color topColor){
tube(x, y, rad, z2, baseColor, baseColor, topColor, topColor);
}

public static void slantTube(float x1, float y1, float x2, float y2, float z2, float rad, Color baseColor, Color topColor){
//Draw
float scl = Perspective.scale(x2, y2, z2);
Expand Down

0 comments on commit 01fc17c

Please sign in to comment.