POV-Ray : Newsgroups : povray.binaries.images : Object Labels Server Time
19 Apr 2024 18:21:12 EDT (-0400)
  Object Labels (Message 17 to 26 of 26)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Melody
Subject: Re: Object Labels
Date: 20 Jan 2020 03:35:00
Message: <web.5e25661a28c763ef9da690110@news.povray.org>
Here's what you can do with it; IF you can rotate around an axis. I don't know
how in POV. vrotate() is not rotation(r,axis,pnt). If you cant, you need
triangulation.inc ... added centering option, and y adjust.
CamAng change, scale stays ...


/*
right=up.eye
eye=right.up
up=eye.right
*/
#declare campos = <0,80,-250>;
#declare cameye = vnormalize(<20,12,0>-campos);
#declare camup = <-1,1,0>;
#declare camright = vnormalize(vcross(camup,cameye));
#declare camup = vnormalize(vcross(cameye,camright));
#declare FontSize = 1.0;
#declare camang = 30;

camera {
  location campos
  right camright
  up camup *(image_height/image_width)
  direction cameye*(image_height/image_width)
  angle camang
}
#include "transforms.inc"
#macro label(Text,objv,r,col,top,center,ydeg)
#local fl = 1/tan(radians(camang/2));
#local vl = vlength(objv-campos)/(fl*20);
#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 1 0
    texture {  pigment { rgb col }  finish { ambient 1 diffuse 0 } }
  }
  #if (center) translate -x*((strlen(Text)/2) * FontSize / (2*FontSize)) #end
  scale vl*FontSize
 #if (ydeg) rotate y* ydeg #end
  Matrix_Trans(vnormalize(vcross(camup,eye)),camup,eye,pnt)
  no_shadow
}
#end
label("HELLO 162",<60,24,80>,48,<0.0196, 0.0196, 0.2156>,1,1,0)
label("Here are 492",y* 29.9,24*.8,<0.0196, 0.0196, 0.2156>,0,1,0)

#declare pnt = rotation(radians(camang/2.04),camup,cameye)*10+campos;
#declare d = 1;
#declare rowh = camang * 0.005;
label("Display Info 0",pnt,0,0,1,0,d)
label("Row 1",pnt,rowh * 1,0,1,0,d)
label("Row 2",pnt,rowh * 2,0,1,0,d)
label("Row 3",pnt,rowh * 3,0,1,0,d)
label("Row 4",pnt,rowh * 4,0,1,0,d)
label("Row 5",pnt,rowh * 5,0,1,0,d)

label("Row 1",pnt,rowh * 0,0,0,0,d)
label("Row 2",pnt,rowh * 1,0,0,0,d)
label("Row 3",pnt,rowh * 2,0,0,0,d)
label("Row 4",pnt,rowh * 3,0,0,0,d)
label("Row 5",pnt,rowh * 4,0,0,0,d)
label(concat("CamAng ",str(camang,0,0)),pnt,rowh * 5,0,0,0,d)


Post a reply to this message


Attachments:
Download 'screeninfo.png' (229 KB)

Preview of image 'screeninfo.png'
screeninfo.png


 

From: Melody
Subject: Re: Object Labels
Date: 20 Jan 2020 05:45:00
Message: <web.5e25841328c763ef9da690110@news.povray.org>
So I took it to Hawaii.
Gave up on axis rotation in POV.

included triangulation.inc,
set up for 2 cameras, because Lego plane has 2 cameras.
Up
Eye
campos

or
Up2
Eye2
campos2

the rest, u can figure out.
http://news.povray.org/povray.text.scene-files/attachment/%3Cweb.5e25818b2dd48e039da690110%40news.povray.org%3E/label_m
aker_headsup.zip


Post a reply to this message


Attachments:
Download 'kauai_16.png' (145 KB)

Preview of image 'kauai_16.png'
kauai_16.png


 

From: kurtz le pirate
Subject: Re: Object Labels
Date: 20 Jan 2020 13:20:12
Message: <5e25ef5c$1@news.povray.org>
On 20/01/2020 00:31, Melody wrote:

> Nice sharp font! Is that pov3.7?
It's 3.8-alpha

> Mine never looked that good.
nothing special though


> Is that a high camera angle?

camera angle=36

> Perspective makes them tilt.

yes, label "ptA2" seems a little bit tilted.


> something else to understand about text - possibly correct.
It's already very good.



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 20 Jan 2020 21:30:01
Message: <web.5e2661bf28c763ef9da690110@news.povray.org>
only way to improve text sharpness is print one letter at a time.
one of the luckier frames in the movie (87)
full size


Post a reply to this message


Attachments:
Download 'kauai_15b.png' (564 KB)

Preview of image 'kauai_15b.png'
kauai_15b.png


 

From: Melody
Subject: Re: Object Labels
Date: 20 Jan 2020 22:05:01
Message: <web.5e266a0028c763ef9da690110@news.povray.org>
"Melody" <nomail@nomail> wrote:
> only way to improve text sharpness is print one letter at a time.
not,
ttf "Arial.ttf" Text .5 0

keeps it sharper than 1


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 21 Jan 2020 02:15:01
Message: <web.5e26a3eb28c763ef9da690110@news.povray.org>
suggest .2 font thickness, or less.
change ydeg to zdeg.
and do something for tilting.

ttf "Arial.ttf" Text .2 0
#if (zdeg) rotate z* zdeg #end


Post a reply to this message


Attachments:
Download 'golfdimples10a.png' (108 KB)

Preview of image 'golfdimples10a.png'
golfdimples10a.png


 

From: Melody
Subject: Re: Object Labels
Date: 21 Jan 2020 02:25:00
Message: <web.5e26a66b28c763ef9da690110@news.povray.org>
i  screw up much as I succeed.
wrong image.


Post a reply to this message


Attachments:
Download 'golfdimples80.png' (121 KB)

Preview of image 'golfdimples80.png'
golfdimples80.png


 

From: Melody
Subject: Re: Object Labels
Date: 21 Jan 2020 21:50:00
Message: <web.5e27b76b28c763ef9da690110@news.povray.org>
if u changed ydeg to zdeg,
auto tilt-correction for left-side display,
 might look something like this.

#macro drwtext()
  #local pnt = rotation(radians(camang/2.04),camup,cameye)*10+campos;
  #local rowh = camang * 0.0036;
  #declare FontSize = .8;
  #local s = array[4] {
    concat("Azimuth     ",str(360-rascension(cameye),0,2)),
    concat("Declination ",str(declination(cameye),0,2)),
    concat("CamAng      ",str(camang,0,1)),
    concat("Time     ",date("%H:%M:%S"))
  }
  #local strtn = 1; // start negative
  #local i = -strtn;
  #while (i < 3)
   #local d = (i*-0.5 - 0.5)*(camang/80);
   label(s[i+strtn],pnt,rowh * i,0,0,0,d)
   #local i = i+1;
  #end
#end


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 21 Jan 2020 22:10:00
Message: <web.5e27bbed28c763ef9da690110@news.povray.org>
higher cam angles with well-behaving text.
and all staying same size.


Post a reply to this message


Attachments:
Download 'well-behaved.png' (115 KB)

Preview of image 'well-behaved.png'
well-behaved.png


 

From: Melody
Subject: Re: Object Labels
Date: 22 Jan 2020 00:45:00
Message: <web.5e27e0a628c763ef9da690110@news.povray.org>
"Melody" <nomail@nomail> wrote:
> higher cam angles with well-behaving text.
> and all staying same size.

 last variable, ImgSize.

  #local imgSzAdj = 640 / image_width;
  #local rowh = camang * 0.0036 * imgSzAdj;
  #declare FontSize = .8 * imgSzAdj;

now it's done.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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