POV-Ray : Newsgroups : povray.advanced-users : Bending text into a curve or partial arc? Is this possible? Server Time
26 Nov 2024 19:38:55 EST (-0500)
  Bending text into a curve or partial arc? Is this possible? (Message 1 to 2 of 2)  
From: Handler
Subject: Bending text into a curve or partial arc? Is this possible?
Date: 2 Oct 1999 07:41:38
Message: <37f5ef72@news.povray.org>
Its sounds to easy .. but I imagine there's alot of mathmatical work behind
what I want to do.  I would have to think somebody out there has done
something similar to this somewhere along the line and that is to bend text
in an arc or curve.  Is there a function or utility to do such a thing?

I put a sample of what I'm talking about in povray.binaries.images (under
the same subject) it's a sample of something simlar that a person did for me
many years ago.  It was ray-traced, with what I have no idea.

Could somebody clue me in? Please?

--
Of all the things I've lost ...
  I miss my mind the most :)

Handler
han### [at] taconicnet
http://members.xoom.com/Handler
ICQ 2286606


Post a reply to this message

From: Remco de Korte
Subject: Re: Bending text into a curve or partial arc? Is this possible?
Date: 2 Oct 1999 08:18:12
Message: <37F5F841.958C44A3@xs4all.nl>
Handler wrote:
> 
> Its sounds to easy .. but I imagine there's alot of mathmatical work behind
> what I want to do.  I would have to think somebody out there has done
> something similar to this somewhere along the line and that is to bend text
> in an arc or curve.  Is there a function or utility to do such a thing?
> 
> I put a sample of what I'm talking about in povray.binaries.images (under
> the same subject) it's a sample of something simlar that a person did for me
> many years ago.  It was ray-traced, with what I have no idea.
> 
> Could somebody clue me in? Please?
> 
> --
> Of all the things I've lost ...
>   I miss my mind the most :)
> 
> Handler
> han### [at] taconicnet
> http://members.xoom.com/Handler
> ICQ 2286606

I sent you a reply to the message you sent me by mail but it bounced. 
I'm glad I didn't do all the typing absolutely for nothing. 

Here's the story:


> Handler wrote:
> 
> Hello!!
> 
> I downloaded your Softtext program .. so far I think what it does it great.
> But, what would be a good default camera setting to work from?  Also, I'd like
> to know how to be able to bend text on a curve, if that's possible.  Please
> let me know so I can keep on playing!
> 
> Thanks!
> 

The camera-setting in the test-render is simply at <0,0,-distance> with the
default angle, looking at <0,0,0>. 
The output of the program is a blob object which you can use as any other object
(scale, translate etc.).
To bend the text keep in mind that you create the object by looping through the
coordinates. You can either bend the text by translating or rotating each
element. For instance if you to bend it round the z-axis (so it stays flat in
the visible plane), translating will keep the verticals intact while rotating
will ...ehr rotate the verticals.

Here is (more or less) how to do it:

method 1:

#declare tt=0; #while (tt<pcount)
  sphere{<px[tt],py[tt],0>,ss,1
  translate y*sin(px[tt]*pi/pcount)*size_vert
  }
#declare tt=tt+1; #end

First you put the sphere-element at it's normal place, then you translate it in
the y-direction, relative to the horizontal place (with a sin() to make it a
nice curve).

method 2:

#declare tt=0; #while (tt<pcount)
  sphere{<0,py[tt],0>,ss,1
  rotate z*rot_angel*px[tt]/size_hor
  }
#declare tt=tt+1; #end

Here you put the sphere-element at it's vertical position but centered
horizontally. Then you rotate it: rot_angle is the total angle you want the text
to cover (if you set this at 360 the result will be a circle, 180 will give a
half circle), and px[tt]/size_hor gives you the rotation relative to the
horizontal position. 

Please not that this code is far from accurate and there are probably some
mistakes but it's just to get the general idea. I guess you can use this for
further experimentation.

Have fun!

Remco


Post a reply to this message

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