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
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?
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]:
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.
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.