我一直在写一个简单的3d渲染器,并且一直在研究绘制顺序。引擎将3d多边形(按正确绘制顺序的3d点组)渲染到2d空间,返回表示给定多边形投影的2d点列表。我这样做的方法可能有点非正统,因为我想看看我自己是否能够做到这一点,所以我将我的代码附加在下面进行投影:/*position is the position of the camera, x, y, z;
cameraRotation is the rotation of the camera, in the order of rotation about x, rotation about y,
即使正确设置了所有偏移量,zbuffer仍未正确更改。如果有人知道这可能不起作用的原因,那就太好了。width, int height, int depth, int xcenter, int zcenter, if (offset<0 || offset>=projectionsize) offset = 0;
atomicMin(&zbuffer</