Hi, I’d like to have text orient to the viewport camera and came across a script by David Rutten that did this exactly:
Text Tag 3D oriented to camera
However, the VB script has this text left-justified and would ideally want this centre-justified.
Can someone help to add/edit the code to allow for this?
Thank you in advance.
Does this need to be in VB?
Below is a solution with a line of python:
text_oriented_to_camera.gh (7.3 KB)
Replace this lines
Dim tag As New Rhino.Display.Text3d(text, textPlane, textSize) pipeline.Draw3dText(tag, Color.Black)
Dim tag As New Rhino.Display.Text3d(text) pipeline.Draw3dText(text, Color.Black, textPlane, textSize, "Ariel", False, False, 1, 3)
Brilliant! Thank you. I prefer a Python node as I know my way around it better.
I measure the distance between the points and the camera origin plane, and use that to factor the Text size S, to keep a constant height of text as one zooms in and out (something the original VB script did).
Thank you, again!
At that point you could also use dots.
This is great, I understand the parameters and the order. Thank you!
Hi Martin, can you elaborate on this point? I saw [Dot Display] but I don’t think you mean this…
Text Dots can be created with Elefront
Text Dots are in front of geometry and their size does’t change based on zoom level.
Elefront dots, dimensions or texts can be baked efficiently with attributes, which is a big plus when you’re working with lots of geometry.
You call use the
Edit: Here’s a quick GHPython example (adding to this old example):
200401_GHPython_DrawViewportWires_03.gh (16.4 KB)