Transform 3d to 2d

Can some please help me? I want to take vertices and go from

vertices-> object co-ord -> camera co-ords using matrix math.

But cannot seem to get the order correct.

Is it OBmatCAMmatvert will give final transformed vertice? Or is there a lot that I am missing. Any help would be greatly appreciated.

Cheers :slight_smile:

It think that would be.

local coord -> global coord
by applying the object’s matrix to the vertice coord

global coord -> camera coord
in two steps.
First, substract the translation included in the camera matrix from the global coord.
Second, multiply by the inverse of the rotation matrix.

Should work

If you need a module for vectorial math, try: http://clubinfo.bdeb.qc.ca/~theeth/vecf.py

Martin

Thanks for the tips, had things a little backwards…now back to work…