[cairo] [patch] enable projective transformations
Andrea Canciani
ranma42 at gmail.com
Tue Aug 17 03:56:19 PDT 2010
On Tue, Aug 17, 2010 at 12:52 PM, Arjen Nienhuis <a.g.nienhuis at gmail.com> wrote:
>> To use it for 3D transformations you would need 4x3 (and 4x4 if you
>> want projections, too).
>> The question was: what would 3D transformations be used for?
>> (Remember: cairo uses 2D surfaces, thus the third dimension input
>> would be constant and its output would get discarded "soon")
>>
>
> Use case: 2 windows with buttons that 'stick out'.
>
> def draw_window(ctx, w):
> draw_background(ctx, w.background)
> ctx.save()
> ctx.translate_z(-10)
> draw_buttons(ctx, w.buttons)
> ctx.restore()
>
> def main():
> draw_window(ctx, w1)
> ctx.rotate_y(0.5)
> ctx.translate(300, 0)
> draw_window(ctx, w2)
>
> I think this needs a 4x3 matrix. You need the value of the rotation
> around the y axis to make translate_z have the right effect.
Are you saying that if you want to use 4x3 transforms (rotate_y), you
need 4x3 transforms?
More information about the cairo
mailing list