curv3d / curv

a language for making art using mathematics
Apache License 2.0
1.14k stars 73 forks source link

Bad baground color after two rotation transformations #157

Closed jasonrohrer closed 2 years ago

jasonrohrer commented 2 years ago

This occurs whenever ray_max_depth=inf, and thus became default behavior after 196f512572ef1bc92588f154e312fc729a752fef

It can also be reproduced in previous curv versions by setting

-O ray_max_depth=inf

Sample code:

cube
>> rotate { angle: (-90*deg), axis: Y_axis }
>> rotate { angle: (-90*deg), axis: X_axis }

Note that this bug seems to be specific to 90 degrees as a rotation angle.

Screenshot from 2021-12-10 11-30-24

jasonrohrer commented 2 years ago

Whoa, setting one of them to 45 produces a very odd result:

cube
>> rotate { angle: (-90*deg), axis: Y_axis }
>> rotate { angle: (-90*deg), axis: X_axis }

Screenshot from 2021-12-10 11-33-22

lf94 commented 2 years ago

Doug is working on fixing this soon via constraining ray-max-depth to bounding box.

doug-moen commented 2 years ago

This only happens when you set ray_max_depth to infinity, which is now officially unsupported :-) The default value is no longer infinity, it's 2000, so nobody will now see this behaviour by accident.