From cd1d2289a61437b0e99d80859946a1fc69599999 Mon Sep 17 00:00:00 2001 From: tangziwen Date: Wed, 15 Oct 2014 11:36:44 +0800 Subject: [PATCH] bug fix --- cocos/3d/CCSprite3D.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 4e2bc1c039..5f0fa52b44 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -576,8 +576,8 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) if (mesh->_isTransparent) { Vec4 local_pos(_position.x,_position.y,_positionZ,1); - Vec4 result = Camera::getVisitingCamera()->getViewMatrix() *getNodeToWorldTransform()* local_pos; - globalZ = -result.z; + Mat4 result = Camera::getVisitingCamera()->getViewMatrix() *transform; + globalZ = -result.m[14]; } meshCommand.init(globalZ, textureID, programstate, _blend, mesh->getVertexBuffer(), mesh->getIndexBuffer(), mesh->getPrimitiveType(), mesh->getIndexFormat(), mesh->getIndexCount(), transform);