POV-Ray : Newsgroups : povray.binaries.images : Object Labels : Re: Object Labels Server Time
26 Apr 2024 14:37:24 EDT (-0400)
  Re: Object Labels  
From: kurtz le pirate
Date: 19 Jan 2020 12:25:33
Message: <5e24910d@news.povray.org>
On 19/01/2020 07:16, Melody wrote:

> #macro label(Text,objv,r,col,top)
> #local vl = vlength(objv-campos)/88;
> #if (top)
> #local pnt = camup*(r*1.05)+objv;
> #else
> #local pnt = -camup*(vl*FontSize+r)+objv;
> #end
> #local eye = vnormalize(pnt-campos);
> object {
>    text {
>      ttf "Arial.ttf" Text 2 0
>      texture {  pigment { rgb col }  finish { ambient 1 diffuse 0 } }
>    }
>    translate x*(strlen(Text)*-0.15*FontSize)
>    scale vl*FontSize
>    Matrix_Trans(vnormalize(vcross(camup,eye)),camup,eye,pnt)
>    no_shadow
> }
> #end


Thank for this macro. It seems to be working perfectly.
My firt try with **label()**


Thanks :)

-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message


Attachments:
Download 'norma_triangle2.jpg' (43 KB)

Preview of image 'norma_triangle2.jpg'
norma_triangle2.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.