Keep text3d size constant while zooming


I am having a small issue setting the size of the Text3d object to seem contsant while zooming in and out.

first it worked by making the size depends on the drwaing plane width but I want to have more control on the size. so I set the number of pixels for the Text3d object it must use the same number of pixels after zooming.

I will appreciate any given help regarding my problem

Hi @med.ayssar,

If I understand correct, you’d like to draw some text in a viewport. And when you zoom in and out, you’d like the size of the text to remain constant, like how Rhino’s text dots display. Is this correct?

– Dale

Hi @dale,

as an answer for the first part, yeah it is exactly what I want, but I really what is meant with Rhino dots here?

in my trivial solution, I took the min(width, height) of the Rectangle3d object and set my size to be the min divided by a number. It worked, but it does not give a full control of the size that I want to have. As far as I understand zooming in/out and by mapping the frustum to cube, I take the 4 points of the cube that lies on the front and construct my Rectangle3d object and pass it to my drawing functions. And by zooming in/out the width/height of the constructed Rectangle3d get always smaller.

In order to keep my drawn object constant while zooming, I was applying the following:
given that u and v are in [0, 1]:

Hi @med.ayssar,

Here is a code sample that may help:


If not, then please provide additional information on what you are trying to do. Often, providing reason behind this (the why) can be helpful. And if possible, please provide any sample code that isn’t working for you so we can run it here and try to help.


– Dale

Thank you @dale,

in the given sample, the draw2dText has been used which is more restrictive, as I can not simply rotate the text as in the Text3d case.

Maybe it is better to ask the question in a different way. Using Text3d and DrawEventArgs.Display.DrawText3d(params), how can I control the size of the text so that it keep having the same relative size in the view plane.
let rec1 be the initial Rectangle3d object which we get after starting rhino and rec2 the new constructed Rectangle3d after zooming in or out. Given that I can get the view plane from the Rectangle3d, how can I set the size of the Text3d correctly so it keeps having the relative size in the rectangle where it is being drawn.

So if there was an override to Display.Draw2dText that accepted a rotation angle, would this work?


– Dale