geometry curling back on itself #24

Closed
opened 2026-02-27 01:52:40 +00:00 by jaynuine · 1 comment
Owner

in perspective projection geometry will fold onto itself when advancing the camera along the x axis

in perspective projection geometry will fold onto itself when advancing the camera along the x axis
jaynuine added this to the todo project 2026-02-27 01:52:40 +00:00
jaynuine added this to the bonus milestone 2026-02-27 01:53:15 +00:00
jaynuine referenced this issue from a commit 2026-04-30 08:13:37 +00:00
Author
Owner

this was happening because we didn't take the signs of the vector's components in urot, as if they are opposed, the resulting angle from asin should be negated
currently this was fixed by bodging a negation on negative x values, but really this should depend on the xor of the signs being positive (or multiplying sgn(vector.x) * sgn(vector.y))

also we were reseting the norm to 1 if it were 0 so as to avoid dividing by zero in the call to asin, which explains why the geometry was mirrored on the x axis and didn't just disappear

this was happening because we didn't take the signs of the vector's components in urot, as if they are opposed, the resulting angle from asin should be negated currently this was fixed by bodging a negation on negative x values, but really this should depend on the xor of the signs being positive (or multiplying `sgn(vector.x) * sgn(vector.y)`) also we were reseting the norm to 1 if it were 0 so as to avoid dividing by zero in the call to asin, which explains why the geometry was mirrored on the x axis and didn't just disappear
Sign in to join this conversation.
No labels
bug
mlx
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaynuine/fdf#24
No description provided.