# Draw text with Python in 3d coordinate system

I know that I can use the blf module to draw 2d text, but is there a method to draw text at certain positions in 3d space?

I want to add a text right to a specific point in 3d.

• Do you mean on the 2D projection of a 3D location, as in, for example, the MeasureIt addon, or in full perspective? Or.. in perspective, but always facing the viewpoint? – Robin Betts Apr 23 '19 at 7:49
• Thx, I found an example in the MeasureIt addon – Jayanam Apr 25 '19 at 8:56
• @RobinBetts can set blf.rotation(..) (and aspect) to rotate text on screen. I remember fiddling with this and accidentally rotated all the GUI text too. (oops meant to comment under answer comment) – batFINGER Apr 25 '19 at 11:48

Thx, I found an example in the MeasureIt addon and here is some code from my Fast Carve addon to draw 2d text:

rv3d = self._view_context.region_3d
region = self._view_context.region
pos_text = location_3d_to_region_2d(region, rv3d, self._center)

blf.position(2, pos_text[0], pos_text[1], 0)

import bpy