charlieroberts / marching

A JavaScript library that compiles GLSL ray marchers.
MIT License
208 stars 13 forks source link

Grouped translation of primitives fails when one of them has the Twist modifier #9

Open khoparzi opened 3 years ago

khoparzi commented 3 years ago

When we try to translate the Union as a group, the combined shape should move forward, instead only the first primitive translates.

march( Union( Torus(), Twist(Torus(Vec2(.5, .125), 8)) ).translate(0, 0, 3) ).render(5, true)

khoparzi commented 3 years ago

Ok, turns out Bend has the same issue and you don't have to apply any combinators in either of them.

march( Bend(Torus()).translate(0, 0, 2) ).render(5, true)