C語言返回值不能直接寫數組
#ifndef _VMATH_H #define _VMATH_H #ifdef _cplusplus extern "C" { #endif typedef float Matrix44f[16]; Matrix44f translate(float x, float y, float z); Matrix44f scale(float x, float y, float z); Matrix44f rotateX(float radian); Matrix44f rotateY(float radian); Matrix44f rotateZ(float radian); Matrix44f rotateXYZ(float radian, float x, float y, float z); Matrix44f perspectiveFrustum( float left, float right, float top, float bottom, float near, float far); //透視投影 Matrix44f orthoPerspect( float left, float right, float top, float bottom, float near, float far); //正交投影 #ifdef _cplusplus } #endif #endif
float *translate(float x, float y, float z);