Text to screen #284
-
Hello there! Is it possible to print text to the screen rather than onto a plane in the scene? I wish to print some data to the screen, say in the top right, but would like it static and not to move relative to the camera. wiggly_well-2020-12-29_11.57.25-2020-12-29_12.08.13.mp4I'd like to print data about the end point as it's animated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
How cool is that! :) from vedo import *
s = Arrow([0,0,1], [1,1,2])
cam = dict(pos=(4.80, -4.56, 3.32),
focalPoint=(0.186, 0.0532, 1.05),
viewup=(-0.230, 0.235, 0.944),
distance=6.90, clippingRange=(4.75, 9.90))
# (press "C" in rendering window to get the above)
axs = Axes(xrange=(-1,1), yrange=(-1,1), zrange=(0,3), yzGrid=0)
vd=Video()
for i in range(100):
s.rotateZ(3.6).addShadow(z=0)
msg1 = Text2D("Some welleng data:\n\Lambda = 10 km",
pos="top-left", font="VictorMono", c='w', bg='db', alpha=1)
msg2 = Text("my |\Psi> vector", font="Theemim", italic=1)
msg2.scale(.075).pos(s.centerOfMass()+[0.2,0,0]).followCamera()
plt = show(s, msg1, msg2, axs, camera=cam, resetcam=0, interactive=0)
vd.addFrame()
plt.remove([msg1, axs], render=False) # need to remove these manually
vd.close()
interactive() movie.mp4 |
Beta Was this translation helpful? Give feedback.
-
Nice!! |
Beta Was this translation helpful? Give feedback.
-
Awesome... you're a star! |
Beta Was this translation helpful? Give feedback.
How cool is that! :)
You have various options, use a "follower" object which is locked to face the camera (you can make any mesh obj become a follower by adding
mesh.followCamera()
) or just overlay some text on the rendering window: