POV-Ray : Newsgroups : povray.newusers : Placing a stopwatch in a fixed position on the image : Re: Placing a stopwatch in a fixed position on the image Server Time
5 Sep 2024 12:18:03 EDT (-0400)
  Re: Placing a stopwatch in a fixed position on the image  
From: John VanSickle
Date: 2 Oct 2000 19:21:48
Message: <39D9198F.A21F0A06@erols.com>
Bill Brehm wrote:
> 
> I've found your page and the description is helping me to understand.
> 
> 1) I don't know if I'll ever need a zoom of 0.1. But I generally used a zoom
> of 1.0 and I see the effect. I will work to understand the cause and find a
> fix.

If you make the object very thin in the z-direction, the effect will
br greatly reduced.

> 2) Acknowledged. I'm guessing that one of the vcross results is a zero
> length vector and that is the cause of the error. I'll through some checks
> in before the matrix operation.

(Nods head.)

> 3) I was trying to scale the text to zero thickness, but it seems that a
> zero scale factor is interpretted as one. When I set the text thickness to
> zero, it worked perfectly.

Uh-uh.  Specify zero thickness in the text object parameters.  It's the
third parameter.

> 4b) Is there a way to determine the length in units of a text object?
> Something like textObject.length?

I'm told this will be added to version 3.5.  Until then (if you don't
use MegaPOV), here's some code I use:

//START OF CODE

#local A=6.243;
camera { direction z*16 location -z*12+x*A look_at x*A }

plane { -z,0 pigment { gradient x
    color_map { [0 rgb 0 ][1 rgb 1] }
    scale A
  }
  finish { ambient 1 diffuse 0 }
}

text { ttf "c:\windows\fonts\tahoma.ttf",
  "What's taking them so long?",0,0 no_shadow hollow
  matrix <1,0,0, 0,1,0, 0,0,1, -A,-0.375,-.0001>
  pigment { rgb <1,0,0>}
  finish { ambient 1 diffuse 0 }
} 

// END OF CODE

Render this at 512x384.  Replace the text and the font with the ones you
want, and adjust the value of A until the right edge of the text falls
directly on the border between the black and white areas.  This will give
you the amount needed to move the text in the -x direction in order to
center it on the origin; double it to right-align it.

> 4c) Is there a way to determine the height or depth of a text object or any
> object in general?

For text, they have the depth you specify in the depth parameter, subject
to whatever scaling you apply after that.  Capital letters of text are .75
units tall in the y-direction.

For other objects, unless you have MegaPOV (or when V3.5 comes out), you'll
have to calculate it from what was modelled.

> 4d) Is there a way to extract parameters from the current camera, without
> "passing" them in as "#local"s. Something like cameraObject.look_at.x?

Nope.  That's why I use the method I demonstrated here.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

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