Cocos 镜面反射变换出错

仿着写了个 反射变换矩阵
function cc.exports.calReflectMat(p, n)
local normal = cc.vec3normalize(n)
local dist = cc.pDot(p,normal)

local k = -2.0 * dist
local mat = cc.mat4.new(cc.mat4.createIdentity())
mat = 1.0 - 2.0 * normal.x * normal.x
mat = -2.0 * normal.x * normal.y
mat = -2.0 * normal.x * normal.z
mat = 0
mat = mat
mat = 1.0 - 2.0 * normal.y * normal.y
mat = -2.0 * normal.y * normal.z
mat = 0
mat = mat
mat = mat
mat = 1.0 - 2.0 * normal.z * normal.z
mat = 0
mat = k * normal.x
mat = k * normal.y
mat = k * normal.z
mat = 1.0

return mat
end

显示出来后如图,
local matr = calReflectMat(cc.vec3(0,0,0), cc.vec3(1.0,0.0,0.0))
sprite3D:setAdditionalTransform(matr)
是不是cocos就是不能使用反射变换的。。。还是水面原因

搞定了。。。
翻转之后,三角形顺序反了,GPU计算也就反了。
使用MeshCommand::setCullFaceEnabled(bool enable),关闭面剔除。
@lion。。。大神