我有在 3d 空间中旋转的绘图(具有 x 和 y 坐标的点数组): http ://www.motiondraw.com/md/as_samples/Testing/_mindreader/main.html
就像现在一样,这幅画看起来就像包裹在一个立方体上,角落里有一个令人讨厌的 90° 度。相反,它应该看起来好像被包裹在一个圆柱体上。在开始旋转之前,我调用一个函数(在 ActionScript 中)“bendDrawing”,它为每个点设置一个初始 z 值:
for (var j = 0; j < numPoints; j++ ) {
// 绘图居中 – 中心左侧的点 < 0 var distFromCenter = Math.abs(shape[i].points[j].x);
var wid = 350;// this could be the radius of the cylinder
// NOTE: suboptimal, as the image gets a 90° corner in the center, at its highest point
// what it should look like: as if the image was wrapped around a cylinder, i.e. in a circular shape
// is that pythagoras? draw triangle, calc distance from base, add to this to c?
var z = wid - distFromCenter;
shape[i].points[j].z = Math.abs( z);
}
我只是无法解决这个问题;-) 任何指针都非常感谢!
安德烈亚斯·韦伯