Added the "initgrabz()" call in new transform, this is needed to calculate

correct mapping of mouse motion to a 3d vector in perspective mode, e.g.
corrected for depth.
This commit is contained in:
2005-02-25 11:55:03 +00:00
parent 91fbe72115
commit 4ee71094fa

View File

@@ -1837,8 +1837,19 @@ int Rotation(TransInfo *t, short mval[2])
void initTranslation(TransInfo *t)
{
t->num.idx_max = 2;
t->transform = Translation;
/* initgrabz() defines a factor for perspective depth correction, used in window_to_3d() */
if (G.obedit) {
float vec[3];
VECCOPY(vec, t->center);
Mat4MulVecfl(G.obedit->obmat, vec);
initgrabz(vec[0], vec[1], vec[2]);
}
else initgrabz(t->center[0], t->center[1], t->center[2]);
}
int Translation(TransInfo *t, short mval[2])