POV-Ray : Newsgroups : povray.binaries.images : Object Labels Server Time
2 May 2024 17:04:36 EDT (-0400)
  Object Labels (Message 7 to 16 of 26)  
<<< Previous 6 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Melody
Subject: Re: Object Labels
Date: 19 Jan 2020 06:35:00
Message: <web.5e243e3328c763ef9da690110@news.povray.org>
if you're fairly quick, u have one more question looming ---
unresolved constant of "88" -

represents a perspective cancel.

how much bigger to stay the same size at a distance?
 ... so that's your home work, resolve the last constant.


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 19 Jan 2020 07:20:00
Message: <web.5e24486728c763ef9da690110@news.povray.org>
"Melody" <nomail@nomail> wrote:
> if you're fairly quick, u have one more question looming ---
> unresolved constant of "88" -
>
> represents a perspective cancel.
>
> how much bigger to stay the same size at a distance?
>  ... so that's your home work, resolve the last constant.

time's up. pencil's down, a trick question doesn't require math.

88 = ground 0.

a constant.

distance at which u see object of size 1 at size 1.

perspective is all about divide by Z.
but that may not be POV, which may include near far points and doodads.

close enough tho.


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 19 Jan 2020 08:15:01
Message: <web.5e24553528c763ef9da690110@news.povray.org>
self adjusting to stay the same size at another FOV

fl = 1/tan(radians(fov/Aspect/2));
// fl * centerx = actual focal length

vlen / 88 becomes ...

vlen / (fl * 23.6)

or simply vlen / fl;

that was the bonus answer nobody got.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Object Labels
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


 

From: kurtz le pirate
Subject: Re: Object Labels
Date: 19 Jan 2020 12:30:00
Message: <5e249218$1@news.povray.org>
On 19/01/2020 18:25, kurtz le pirate wrote:
> 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 {








>> }
>> #end
> 
one question at : #local vl = vlength(objv-CamPos)/88;

88 ???



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 19 Jan 2020 18:35:01
Message: <web.5e24e6ec28c763ef9da690110@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> On 19/01/2020 07:16, Melody wrote:

> Thank for this macro. It seems to be working perfectly.
> My firt try with **label()**
>
>
> Thanks :)
>
> --
> Kurtz le pirate
> Compagnie de la Banquise

Nice sharp font! Is that pov3.7?
Mine never looked that good.

Is that a high camera angle?
Perspective makes them tilt.

something else to understand about text - possibly correct.


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 19 Jan 2020 19:00:00
Message: <web.5e24ec7b28c763ef9da690110@news.povray.org>
"Melody" <nomail@nomail> wrote:
> if you're fairly quick, u have one more question looming ---
> unresolved constant of "88" -
>
> represents a perspective cancel.
>
> how much bigger to stay the same size at a distance?
>  ... so that's your home work, resolve the last constant.

so Kurtz is "fairly quick." : )

kurtz le pirate <kur### [at] gmailcom> wrote:
> On 19/01/2020 18:25, kurtz le pirate wrote:
> one question at : #local vl = vlength(objv-CamPos)/88;
>
> 88 ???
> --
> Kurtz le pirate
> Compagnie de la Banquise


Self adjusting to stay the same size at another FOV, AKA camang -

fl = 1/tan(radians(camang/Aspect/2));
// fl * centerx = actual focal length

vlen / 88 becomes ...
vlen / (fl * 23.6)
or simply vlen / fl; and resize smaller to begin with.


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 19 Jan 2020 19:15:00
Message: <web.5e24f08828c763ef9da690110@news.povray.org>
Aspect = Width/Heigth > 1


Post a reply to this message

From: Melody
Subject: Re: Object Labels
Date: 19 Jan 2020 21:25:00
Message: <web.5e250eab28c763ef9da690110@news.povray.org>
"Melody" <nomail@nomail> wrote:
> Aspect = Width/Heigth > 1
Don't need Aspect, just adjusts for visible height angle.
Text centering failed for different FontSize - fixed.
Screen size same for a camang change. Now its done?
There's always something more?

/*
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;
#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)
#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 } }
  }
  translate -x*((strlen(Text)/2) * FontSize / (2*FontSize))
  scale vl*FontSize
  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)
label("Here are 492",y* 29.9,24*.8,<0.0196, 0.0196, 0.2156>,0)

well there are now much smaller remaining constants, 20 and 1.05.


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: 19 Jan 2020 22:20:01
Message: <web.5e251bc228c763ef9da690110@news.povray.org>
20 is just another a size factor u want to see,
and leave it at that.


Post a reply to this message

<<< Previous 6 Messages Goto Latest 10 Messages Next 10 Messages >>>

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