force text to be in front of other objects in 3d

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

force text to be in front of other objects in 3d

Ben Highley
Hi, I'm wondering if there is a way to create text at a specific location in 3d space, but still have it be readable when other objects are in front of it.
There are a couple images of what I'm trying to avoid under demonstration 2 and 4 on this page: https://octave.sourceforge.io/octave/function/text.html .
Thanks.


Reply | Threaded
Open this post in threaded view
|

Re: force text to be in front of other objects in 3d

Pantxo
Ben Highley wrote
> Hi, I'm wondering if there is a way to create text at a specific location
> in 3d space, but still have it be readable when other objects are in front
> of it.
> There are a couple images of what I'm trying to avoid under demonstration
> 2
> and 4 on this page:
> https://octave.sourceforge.io/octave/function/text.html
> .
> Thanks.

Hi,

No, it is not possible to disable depth sorting for a specific object (text
in you case). On the other hand, you can put all you text objects in an
overlay invisible axes. The second text demo would become

---------------------------------------------------------------------------------------
 clf;
 h = mesh (peaks, "edgecolor", 0.7 * [1 1 1], ...
                  "facecolor", "none", ...
                  "facealpha", 0);

 caxis ([-100 100]);
 title ("Vertically Aligned at Bottom");

 ## here comes the trick
 hax = gca ();
 axes ("visible", "off", "xlim", xlim (hax), "ylim", ylim (hax), "zlim",
zlim (hax));

 for t = 0:45:359;
   text (25, 25, 0, "Vertical Alignment = Bottom", ...
                    "rotation", t, ...
                    "horizontalalignment", "left", ...
                    "verticalalignment", "bottom");
 endfor
---------------------------------------------------------------------------------------
 
HTH,

Pantxo



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html