|
楼主 |
发表于 2022-2-12 18:51:32
|
显示全部楼层
Pos2D Bone3toBone2(Pos p)
{
Pos2D v;
float vx, vy, vz, vy2, suo;
vz = View[0][2] * p.x + View[1][2] * p.z + View[2][2] * p.y + View[3][2];
suo = 1 / vz;
vx = Cenx + (View[0][0] * p.x + View[1][0] * p.z + View[2][0] * p.y + View[3][0]) * suo * Cenx;
vy = Ceny - (View[0][1] * p.x + View[1][1] * p.z + View[2][1] * p.y + View[3][1]) * suo * Ceny;
vy2 = Ceny - (View[0][1] * p.x + View[1][1] * (p.z + 50) + View[2][1] * p.y + View[3][1]) * suo * Ceny;
v.x = vx;
v.y = vy;
return v;
} |
|