[cairo] 2D Vectors in cairo from 3D

Damian Frank damian.frank at gmail.com
Wed Sep 24 09:49:08 PDT 2008


On Wed, Sep 24, 2008 at 11:32 AM, Stuart Axon <stuaxo2 at yahoo.com> wrote:
> Hi,
>  Is there a way to take something that is in 3d, then get the 2d representation of it into cairo (not the bitmap, but vectors) ? - The program I'm thinking of generates 3d and displays it in opengl.

Sure, although it won't be easy.  Conceptually, you want to do part of
what OpenGL does -- use a projection transformation matrix to
transform each 3D point into a 2D point, projected onto a plane.  Then
you can use them to render in Cairo however you wish.

Explaining how to do *that* is beyond the scope of this mailing list,
but you should be able to use Google to find some resources on
projection matrices and how to use them.

Damian


More information about the cairo mailing list