Skip to content

Commit f1fc637

Browse files
authored
Merge pull request #67 from ekatrukha/lines3Dends
Fixes rendering of 3D lines, mentioned in #63
2 parents 3975cb8 + 391b9b0 commit f1fc637

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

code/chapter-09/linestrip-3d-better.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
vec2 t1 = normalize(screen_next.xy - screen_curr.xy);
4646
vec2 n1 = vec2(-t1.y, t1.x);
4747
v_uv = vec2(uv.x, uv.y*w);
48-
if (prev.xy == curr.xy) {
48+
if (prev.xyz == curr.xyz) {
4949
v_uv.x = -w;
5050
position = screen_curr.xy - w*t1 + uv.y*w*n1;
51-
} else if (curr.xy == next.xy) {
51+
} else if (curr.xyz == next.xyz) {
5252
v_uv.x = linelength+w;
5353
position = screen_curr.xy + w*t0 + uv.y*w*n0;
5454
} else {

code/chapter-09/linestrip-3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
vec2 t1 = normalize(screen_next.xy - screen_curr.xy);
3636
vec2 n1 = vec2(-t1.y, t1.x);
3737
v_uv = vec2(uv.x, uv.y*w);
38-
if (prev.xy == curr.xy) {
38+
if (prev.xyz == curr.xyz) {
3939
v_uv.x = -w;
4040
position = screen_curr.xy - w*t1 + uv.y*w*n1;
41-
} else if (curr.xy == next.xy) {
41+
} else if (curr.xyz == next.xyz) {
4242
v_uv.x = linelength+w;
4343
position = screen_curr.xy + w*t0 + uv.y*w*n0;
4444
} else {

0 commit comments

Comments
 (0)