We are trying to draw some text with a conduit on a detailed view in a page layout. For this we want to draw the text always in the same height that it looks like a technical drawing. But when the detail view has a paper - model scaling other than 1:1 we cannot retrieve the right transformation.
What we have done so far to draw a 2mm height text on a detail view with 1:1 scaling:
- Get view transformation to orient the text always horizontal and in view direction
ON_Xform w2s_neu;
ON_3dVector y = vp.VP().CameraUp();
ON_3dVector z = vp.VP().CameraDirection(); z.Reverse();
ON_3dVector x = ON_CrossProduct(y, z);
w2s_neu.Rotation(ON_3dVector::XAxis, ON_3dVector::YAxis, ON_3dVector::ZAxis, x, y, z);
- Get text scale
ON_Xform scalePos;
scalePos.Scale(posTextHeight * corr, posTextHeight * corr, posTextHeight * corr);
- Get point translation
ON_Xform trans;
trans.Translation(sp);
- Set model transformation of the viewport
dp.GetRhinoVP().SetModelXform(trans * scalePos * w2s_neu);
- Draw text
CRhinoText rt;
rt.SetString(val);
dp.DrawString(ON_Plane(ON_3dPoint(0.1, 0.1, 0), ON_3dVector::ZAxis), ON_Color(0, 0, 0), rt);
If i now change the scaling of the detail view the text size also changes accordingly which is not wanted!
My question: how can i retrieve the paper - model scaling of the detail view which i am currently draw on?