POV-Ray : Newsgroups : povray.newusers : is 2D - text possible? Server Time
5 Nov 2024 11:21:06 EST (-0500)
  is 2D - text possible? (Message 1 to 9 of 9)  
From: Söllner Matthias
Subject: is 2D - text possible?
Date: 13 May 2001 14:19:20
Message: <3AFED043.3AF9E7F9@t-online.de>
Hello!
I have a question:
Is it possible to create a 2D-Text in the rendered image?
I need a text which is always at the same position in the picture 
and does not depend on the camera-position.
I want to create subtitles in an animation. Is this possible?
Which directive must I use?

Thanks
Matthias


Post a reply to this message

From: Chris Colefax
Subject: Re: is 2D - text possible?
Date: 14 May 2001 06:29:54
Message: <3affb3a2@news.povray.org>

> I have a question:
> Is it possible to create a 2D-Text in the rendered image?
> I need a text which is always at the same position in the picture
> and does not depend on the camera-position.
> I want to create subtitles in an animation. Is this possible?
> Which directive must I use?

There are two approaches you could use: rendering the text into the
animation, or adding it after the animation is rendered.  Both can be done
using POV-Ray; for the first option, you need to use a little code that will
position your subtitles so they always appear in the same apparent location,
e.g.:

#declare camera_location = [ from your camera statement ];
#declare camera_look_at = [ from your camera statement ];
#declare camera_sky = y [ or from your camera statement ];

#declare Z = vnormalize(camera_look_at - camera_location);
#declare X = vnormalize(vcross(vnormalize(camera_sky), Z));
#declare Y = vnormalize(vcross(Z, X));

text {ttf "Arial", "Copyright notice", 0.01, 0
    pigment {rgb 1} finish {ambient 1 diffuse 0} no_shadow
    scale 0.05 translate <.2, -.4, 1> // Adjust position and size
    matrix <X.x, X.y, X.z, Y.x, Y.y, Y.z, Z.x, Z.y, Z.z, 0, 0, 0>
    scale 1/100 translate camera_location}

The first three vectors should match your camera as it changes through the
animation, e.g. if you have:

    camera {rotate <10, clock*360, 0>
        location y*clock*20
        look_at <0, sin(clock*2*pi*4), 0>}

you would replace this with:

#declare camera_sky = vrotate(y, <10, clock*360, 0>);
#declare camera_location = y*clock*20;
#declare camera_look_at = <0, sin(clock*2*pi*4), 0>;

camera {sky camera_sky location camera_location look_at camera_look_at}

From these declared values the camera matrix is calculated, which is used to
transform your subtitle object (this could also be a union, a
semi-transparent disc, etc.) so it sits very close to the camera, appearing
in a static location without affecting the rest of your scene.

The other method is to render your animation without subtitles first, and
then use POV-Ray to re-render the frames with an overlay, e.g.:

plane {z, 0 pigment {
        image_map {tga concat("Frame", str(clock*[number of frames], -3,
0))}
        translate -0.5 scale <4/3, 1, 1>}
    finish {ambient 1}
    }

text {ttf "Arial", "Copyright notice", 0.01, 0
    pigment {rgb 1} finish {ambient 1 diffuse 0} no_shadow
    scale 0.05 translate <.2, -.4, -1> // Adjust position and size
    }

camera {orthographic right x*4/3 up y location -z*100}

Again, various objects/textures could be used for the overlay.  The
advantage of this method is that you can keep a copy of the animation
without subtitles, although obviously extra rendering is required.  The
first method means that anyone can render your animation with the
subtitles/overlays, and (using POV objects/textures) the overlays are
resolution independent.


Post a reply to this message

From: Peter Popov
Subject: Re: is 2D - text possible?
Date: 14 May 2001 10:24:42
Message: <850vft4ordop42feel6ef1lqa03901g1gt@4ax.com>

<soe### [at] t-onlinede> wrote:

>Hello!
>I have a question:
>Is it possible to create a 2D-Text in the rendered image?
>I need a text which is always at the same position in the picture 
>and does not depend on the camera-position.
>I want to create subtitles in an animation. Is this possible?
>Which directive must I use?

What people usually do is place a shadowless 3D object near the
camera. One very easy way to do it is to use a lens flare
macro/include, since this is how they work. You have to define a
custom lens flare object consisting of your text, and the macro will
place in front of the camera for you.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: marabou
Subject: Re: is 2D - text possible?
Date: 24 Oct 2001 14:00:34
Message: <3bd701c2@news.povray.org>
i have the same question. but in a scene without animation. i can not 
follow the executions of chris colefax (because my english).





> Hello!
> I have a question:
> Is it possible to create a 2D-Text in the rendered image?
> I need a text which is always at the same position in the picture
> and does not depend on the camera-position.
> I want to create subtitles in an animation. Is this possible?
> Which directive must I use?
> 
> Thanks
> Matthias


Post a reply to this message

From: Bonsai
Subject: Re: is 2D - text possible?
Date: 25 Oct 2001 09:20:43
Message: <3bd811ab@news.povray.org>
"marabou" <not### [at] availableyet> schrieb im Newsbeitrag
news:3bd701c2@news.povray.org...
>
> i have the same question. but in a scene without animation. i can not
> follow the executions of chris colefax (because my english).
>

Have a look at the screen.inc include file that comes with POV-Ray 3.5 beta

So long,

Bonsai


Post a reply to this message

From: marabou
Subject: Re: is 2D - text possible?
Date: 25 Oct 2001 15:59:11
Message: <3bd86f0f@news.povray.org>
i use povray3.1 until version 3.5 is official. since i can use the features 
of the new version i have much to learn. may saving me from downloading the 
sources by sending the file screen.inc?

Bonsai wrote:

> Have a look at the screen.inc include file that comes with POV-Ray 3.5
> beta
> 
> So long,
> 
> Bonsai


Post a reply to this message

From: Ken
Subject: Re: is 2D - text possible?
Date: 25 Oct 2001 21:03:13
Message: <3BD8B646.7880B4B5@pacbell.net>
marabou wrote:
> 
> may saving me from downloading the sources by sending the file screen.inc?

It uses features not available in POV-Ray v3.1. You will have to use v3.5
if you want to try to use that file.

-- 
Ken Tyler - POV-Ray Technical Assitance Group


Post a reply to this message

From: marabou
Subject: Re: is 2D - text possible?
Date: 26 Oct 2001 10:43:25
Message: <3bd9768d@news.povray.org>
Ken wrote:

> 
> 
> marabou wrote:
>> 
>> may saving me from downloading the sources by sending the file
>> screen.inc?
> 
> It uses features not available in POV-Ray v3.1. You will have to use v3.5
> if you want to try to use that file.
> 

i search for possibilities in pov3.1...


Post a reply to this message

From: Peter Popov
Subject: Re: is 2D - text possible?
Date: 27 Oct 2001 03:29:27
Message: <ad3ktt8u0864om4mfbvf29e15fbgdc4s5r@4ax.com>
On Wed, 24 Oct 2001 20:01:17 +0200, marabou <not### [at] availableyet> wrote:

>i have the same question. but in a scene without animation. i can not 
>follow the executions of chris colefax (because my english).

I knew Gilles was a tough guy but hey, should they not have let him go
after the first one failed? And what did he do anyway, use MAX or
something?

Just a lame joke in a moment of somnambulism.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

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