Bonsoir,
Cylinder and cone operations are not consistent with the others. Indeed they are not centered on origin and thus need translation before rotation.
Moreover, it could be nice to enhance the language by predefining some attributes.
For instance, It would be nice to do that:
c = cylinder(2, 5)
emit(translate(c.bottom_center_to_origin) * c)
It requires:
function my_cylinder(r, h)
c = translate(0, 0, -h/2) * cylinder(r, h)
c.center = v(0, 0, 0)
c.bottom_center_to_origin = v(0,0, h/2)
c.top_center_to_origin = v(0,0, -h/2)
c.radius = r
c.height = h
return c
end
More generally exploiting Lua's objects implementation can lead to a more descriptive language.
What do you think?
Cordialement,