how to convert the CGAffineTransform to CGTransform3D?

user734380 picture user734380 · May 2, 2011 · Viewed 8.6k times · Source

how to convert the CGAffineTransform to CGTransform3D?

I use UIImagePickerController as the Camera Controler. and i add a 3d layer on the upper of the camera view.

then when i want to add a 3d model to the 3d layer . i muset set the 3d scene campera projection matrix . and model view matrix.

but the UIImagePickerController just have a CGAffineTransform .

Answer

landweber picture landweber · Dec 20, 2011

Try CATransform3DMakeAffineTransform. From Apple's documentation:

Return a transform with the same effect as affine transform 'm'.

CATransform3D CATransform3DMakeAffineTransform (CGAffineTransform m)

Available in iOS 2.0 and later. Declared In:

CATransform3D.h