POV-Ray : Newsgroups : povray.animations : Rotating text around center? Server Time
28 Jul 2024 18:12:59 EDT (-0400)
  Rotating text around center? (Message 1 to 10 of 10)  
From: Larkril
Subject: Rotating text around center?
Date: 18 Jun 1999 23:29:22
Message: <376b0e92@news.povray.org>
I am making an animation, and I am trying to rotate a single word around in
a circle.  The problem is that since text starts at the lower left corner(in
POVray, which is what I'm using) it rotates by its edge instead of by the
middle.  For example, it rotates more like the hand of a clock than a plane
propeller.  How can I get around this.  There must be some fancy thing I can
do with sin and cosine, etc...  If you wouldn't mind, please email me a copy
of your reply at rla### [at] mbhsedu.  Thanks a lot for any help!


Post a reply to this message

From: Brian Mason
Subject: Re: Rotating text around center?
Date: 18 Jun 1999 23:40:07
Message: <376B106A.7817@gvn.net>
Larkril wrote:
> 
> I am making an animation, and I am trying to rotate a single word around in
> a circle.  The problem is that since text starts at the lower left corner(in
> POVray, which is what I'm using) it rotates by its edge instead of by the
> middle.  For example, it rotates more like the hand of a clock than a plane
> propeller.  How can I get around this.  There must be some fancy thing I can
> do with sin and cosine, etc...  If you wouldn't mind, please email me a copy
> of your reply at rla### [at] mbhsedu.  Thanks a lot for any help!
Larkrill,

You need to translate your text to the left by half of the length of the
text.  This will center your text at 0,0.  All rotations rotate about
this point.


-- 
-------------------------------------------------------------------------

Brian Mason
bri### [at] gvnnet
http://www.gvn.net/~brian448/

-------------------------------------------------------------------------


Post a reply to this message

From: Cliff Bowman
Subject: Re: Rotating text around center?
Date: 19 Jun 1999 00:37:45
Message: <376b1e94.13274473@news.povray.org>
On Fri, 18 Jun 1999 20:37:14 -0700, Brian Mason <bri### [at] gvnnet>
wrote:

>Larkril wrote:
>> 
>> I am making an animation, and I am trying to rotate a single word around in
>> a circle.  The problem is that since text starts at the lower left corner(in
>> POVray, which is what I'm using) it rotates by its edge instead of by the
>> middle.  For example, it rotates more like the hand of a clock than a plane
>> propeller.  How can I get around this.  There must be some fancy thing I can
>> do with sin and cosine, etc...  If you wouldn't mind, please email me a copy
>> of your reply at rla### [at] mbhsedu.  Thanks a lot for any help!
>Larkrill,
>
>You need to translate your text to the left by half of the length of the
>text.  This will center your text at 0,0.  All rotations rotate about
>this point.
>
This is one area where POV could really do with some extra functions.
Charwidth, Charheight, Stringwidth and Stringheight would make some
things sooooo much easier!

In the short term, it's possible that some assistance may be found at
http://quark.gmi.edu/~redbeard/raytracing/POVRay-util.html

Bear in mind though that the "font.inc" file was written for POV 3.0,
and only works (correctly) with the font distributed with POV.


Cheers,

Cliff Bowman
Why not pay my 3D Dr Who site a visit at
http://www.geocities.com/Area51/Dimension/7855/
PS change ".duffnet" to ".net" if replying via e-mail


Post a reply to this message

From: TonyB
Subject: Re: Rotating text around center?
Date: 19 Jun 1999 10:13:56
Message: <376B9741.97DE5AD6@panama.phoenix.net>
If you're willing to try out the SuperPatch, then your problems are solved.

This is what you would write to center the text:

#declare String = text {ttf "yourfont.ttf", "yourstring", 2, 0}

object {String rotate whatever translate
-(min_extent(String)+max_extent(String))/2}

//or using my center() macro

#macro center(obj)
 translate -(min_extent(obj)+max_extent(obj))/2
#end

#declare String = ...

object {String rotate whatever center(String)}

It's just that simple. Go out and get that patch today!

--
Anthony L. Bennett
http://welcome.to/TonyB

Graphics rendered
by the Dreamachine.


Post a reply to this message

From: Jerry
Subject: Re: Rotating text around center?
Date: 21 Jun 1999 17:25:29
Message: <jerry-2106991425330001@cerebus.acusd.edu>
In <376b1e94.13274473@news.povray.org>, who### [at] spamcitycom (Cliff Bowman) wrote:
>This is one area where POV could really do with some extra functions.
>Charwidth, Charheight, Stringwidth and Stringheight would make some
>things sooooo much easier!

Ron Parker's Object Bounds patch (which is part of the Superpatch, and is
also easy to add to 3.1) is a more general solution; it allows you to find
the minimum and maximum "bounds" of any object, which, for text objects,
ends up being what is needed to manipulate them. Now that I've started
using it, I can't use POV without it! I am desperately hoping it makes it
into POV 3.5.

Jerry


Post a reply to this message

From: Josh English
Subject: Re: Rotating text around center?
Date: 21 Jun 1999 17:47:17
Message: <376EB2A8.DA5459C2@spiritone.com>
Hmm... I sense a challenge..... You can create a custom macro to do this... here
is a start

#macro CirclingText(string,font,depth,arc,rad)

  #local length = strlen(string);
  #local last = length + 1;
  #local s = 1;

  #local r = arc/length;

  #while ( s < last )
     text { ttf   font,
            substr(string,s,1)      // the string to create
            depth,              // the extrusion depth
            0               // inter-character spacing
            pigment { rgb 1 }
            translate rad*y
            rotate r*(s-1)*-z}
     #local s = s + 1;
  #end

#end // macro

CirclingText ("Joshua","crystal.ttf",0.25,270,1)

This should give you a starting point.

Joshua
eng### [at] spiritonecom

Larkril wrote:

> I am making an animation, and I am trying to rotate a single word around in
> a circle.  The problem is that since text starts at the lower left corner(in
> POVray, which is what I'm using) it rotates by its edge instead of by the
> middle.  For example, it rotates more like the hand of a clock than a plane
> propeller.  How can I get around this.  There must be some fancy thing I can
> do with sin and cosine, etc...  If you wouldn't mind, please email me a copy
> of your reply at rla### [at] mbhsedu.  Thanks a lot for any help!


Post a reply to this message

From: Remco de Korte
Subject: Re: Rotating text around center?
Date: 21 Jun 1999 22:10:27
Message: <376EEFF3.C4A51F35@xs4all.nl>
Larkril wrote:
> 
> I am making an animation, and I am trying to rotate a single word around in
> a circle.  The problem is that since text starts at the lower left corner(in
> POVray, which is what I'm using) it rotates by its edge instead of by the
> middle.  For example, it rotates more like the hand of a clock than a plane
> propeller.  How can I get around this.  There must be some fancy thing I can
> do with sin and cosine, etc...  If you wouldn't mind, please email me a copy
> of your reply at rla### [at] mbhsedu.  Thanks a lot for any help!

Though it's not really what you asked, perhaps this can be of help:
http://www.xs4all.nl/~remcodek/zip/softtext.zip
It's a small utility I made (Windows only!) that makes a blob-object from any
text in any font you like which allows you to twist, rotate, stretch or do any
other sadistic thing you can think of to your textobject.
I'll post some examples in the appropriate binaries-groups.

Remco
http://www.xs4all.nl/~remcodek/


Post a reply to this message

From: Nieminen Mika
Subject: Re: Rotating text around center?
Date: 22 Jun 1999 01:40:44
Message: <376f21dc@news.povray.org>
Jerry <jer### [at] acusdedu> wrote:
: it allows you to find the minimum and maximum "bounds" of any object

  I'm curious about how does it work.
  For example, how can it find the boundaries of a poly, a blob, a bicubic
patch or even a difference csg? What about infinite objects?
  Or is it just an approximation?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Jerry
Subject: Re: Rotating text around center?
Date: 22 Jun 1999 15:15:42
Message: <jerry-2206991215430001@cerebus.acusd.edu>
In article <376f21dc@news.povray.org>, Nieminen Mika <war### [at] cctutfi> wrote:
>Jerry <jer### [at] acusdedu> wrote:
>: it allows you to find the minimum and maximum "bounds" of any object
>  I'm curious about how does it work.
>  For example, how can it find the boundaries of a poly, a blob, a bicubic
>patch or even a difference csg? What about infinite objects?
>  Or is it just an approximation?

Ask Ron, but  I believe that what it does is just return POV's
pre-calculated bounding box, which is used to determine whether or not a
ray *might* be hitting this object. My experience has been that it works
perfectly on text; I've never tried it on a plane, that would be
interesting...

Jerry


Post a reply to this message

From: Cliff Bowman
Subject: Re: Rotating text around center?
Date: 24 Jun 1999 13:47:55
Message: <37726a7f.143007749@news.povray.org>
On Tue, 22 Jun 1999 12:15:43 -0700, jer### [at] acusdedu (Jerry) wrote:

>In article <376f21dc@news.povray.org>, Nieminen Mika <war### [at] cctutfi> wrote:
>>Jerry <jer### [at] acusdedu> wrote:
>>: it allows you to find the minimum and maximum "bounds" of any object
>>  I'm curious about how does it work.
>>  For example, how can it find the boundaries of a poly, a blob, a bicubic
>>patch or even a difference csg? What about infinite objects?
>>  Or is it just an approximation?
>
>Ask Ron, but  I believe that what it does is just return POV's
>pre-calculated bounding box, which is used to determine whether or not a
>ray *might* be hitting this object. My experience has been that it works
>perfectly on text; I've never tried it on a plane, that would be
>interesting...
>
Ouch! Still - since it works on text... should do nicely for me.

Actually, I already have it, although I'm concerned about possible
differences in results obtained by "straight" 3.1e as the 3.1e sources
aren't available yet (or weren't when last I checked).

All I really need is a big book called "POV-Ray and Superpatch for
idiots" <g>


Cheers,

Cliff Bowman
Why not pay my 3D Dr Who site a visit at
http://www.geocities.com/Area51/Dimension/7855/
PS change ".duffnet" to ".net" if replying via e-mail


Post a reply to this message

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