POV-Ray : Newsgroups : povray.binaries.images : Object Labels : Object Labels Server Time
16 May 2024 03:09:59 EDT (-0400)
  Object Labels  
From: Melody
Date: 18 Jan 2020 22:50:00
Message: <web.5e23d1b255a34c109da690110@news.povray.org>
/*
right=up.eye
eye=right.up
up=eye.right
*/
#declare campos = <0,80,-250>;
#declare cameye = vnormalize(<20,12,0>-campos);
#declare camup = <0,1,0>;
#declare camright = vnormalize(vcross(camup,cameye));
#declare camup = vnormalize(vcross(cameye,camright));
#declare FontSize = _clamp(1.7,0.1,2);
#declare camang = 40;

camera {
  location campos
  right camright
  up camup *(image_height/image_width)
  direction cameye*(image_height/image_width)
  angle camang
}

#macro label(Text,objv,r,col)
#local vl = vlength(objv-campos)/88;
#local pnt = camup*((r*.95)+vl*FontSize)+objv;
#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.28)
  scale <vl*FontSize,vl*FontSize,vl*FontSize>

popmatrix(vnormalize(vcross(camup,eye)),vnormalize(vcross(eye,vcross(camup,eye))),eye,pnt)
  no_shadow
}
#end
label("HELLO 162",<60,24,80>,48,<0.0196, 0.0196, 0.2156>)
label("Here are 492",y* 29.9,24*.8,<0.30196, 0.0196, 0.2156>)

so u can likely tweak to get the result


Post a reply to this message


Attachments:
Download 'labels9.png' (213 KB)

Preview of image 'labels9.png'
labels9.png


 

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