Skip to content

Commit

Permalink
fix: cone rendering sometimes overshooting (#4616)
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonflatval-cognite authored Jun 19, 2024
1 parent 3e67ad7 commit 49aea0a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void main()
vec3 intersectionPoint = E + dist * D;
float theta = atan(intersectionPoint.y, intersectionPoint.x);
if (theta < v_angle) theta += 2.0 * PI;
if (theta < v_angle) theta += 2.0 * PI;

// Intersection point in camera space
vec3 p = rayTarget + dist * rayDirection;
Expand All @@ -116,7 +117,10 @@ void main()
intersectionPoint = E + dist * D;
theta = atan(intersectionPoint.y, intersectionPoint.x);
p = rayTarget + dist * rayDirection;

if (theta < v_angle) theta += 2.0 * PI;
if (theta < v_angle) theta += 2.0 * PI;

if (intersectionPoint.z <= 0.0 ||
intersectionPoint.z > height ||
theta > v_angle + v_arcAngle ||
Expand Down

0 comments on commit 49aea0a

Please sign in to comment.