Applications of numerical optimization in graphics and games