![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Sebastian H
Subject: Re: How can I print a vector to the screen?
Date: 15 Apr 2002 01:11:37
Message: <3CBA6181.40902@web.de>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Steve wrote:
> Is there a way to print a vector using #debug? And if so could someone
> please give an example?
>
Try this:
// ----------
//
// Simply "returns" a vector in a string in POV-Ray notation
//
#macro v_string (V)
concat ("<", str (V.x, 0, 4),", ", str (V.y, 0, 4),", ", str (V.z, 0,
4),">")
#end
#declare Wanna_see_this_vector = <2, 0.1, 12.5>;
// Should print <2, 0.1, 12.5> to the debug output
#debug v_string (Wanna_see_this_vector)
// ----------
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Sebastian H. <seb### [at] web de> wrote:
> #macro v_string (V)
> concat ("<", str (V.x, 0, 4),", ", str (V.y, 0, 4),", ", str (V.z, 0,
> 4),">")
> #end
Why not use vstr() instead?
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Tom Melly
Subject: Re: How can I print a vector to the screen?
Date: 15 Apr 2002 08:35:28
Message: <3cbac910@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Steve" <ste### [at] zeropps uklinux net> wrote in message
news:slr### [at] zero-pps localdomain...
> a working solution for either of the problems posted above, I'd be grateful
> if someone could post an example of how to center an object.
>
It's worth noting that "centering an object" rarely makes sense, since most
things don't have a centre in human terms, and nothing has a centre in POV
terms. Using the bounding box is a workaround, but, for example, the centre of
an L-shaped shape, according to its bounding box, is going to be an empty area
(half way and half way along).
I realise that this isn't really an issue when thinking about a text-string, but
conceptually you can get very stuck if you think of POV objects as having a
centre (generally because, if you decide that objects have a centre, then you
expect transformations to work with those centres).
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Sun, 14 Apr 2002 20:56:34 -0500, Christopher James Huff wrote:
> In article <slr### [at] zero-pps localdomain>,
> Steve <ste### [at] zeropps uklinux net> wrote:
>
>> Is there a way to print a vector using #debug? And if so could someone
>> please give an example?
>
> The #debug statement only takes strings, so you will need to convert the
> vector to a string first. Since you seem to be using POV-Ray 3.5, look
> up the documentation for the vstr() function.
Thanks Chris, I'm suffereing severely as there isn't a text version of the
3.5 docs available yet (or wasn't last night).
>
>> This is only part of my current problem, I'm trying to center text but
>> there is NO documentation on this, though in both the POV docs and in the
>> VFAQ this is listed as a question that is answered - but the question is
>> not answered it just says use min and max_extent.
>
> The answer is to use min_extent() and max_extent(). ;-)
> Once you have the coordinates of each corner of the bounding box, it is
> very simple to translate it so it is centered over the origin or any
> other desired point. Just find the center and translate by -CenterPos.
> Or you could use the standard macro for this: Center_Trans() in
> transforms.inc.
Thanks, I'll have a go at this. Now that I can #debug vectors I'll be
able to sort something out.
--
sphere{z*5,1pigment{rgb.5}finish{reflection.3specular.5}}box{<-50,-3,-50>
<50,-2,50>pigment{checker/*\__\\__/ * \_\\__*/scale 2}finish{ambient.7}}
light_source/*__\\__\\__\\__\\__\( ~ )\__\\__\\__\\__\\*/{<2,5,1>*4,1}
/*\\__\\__\\__\\__\\__\\__\\__\\__\~ -/__\\__\\__\\__\\__\\*//* Steve */
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Mon, 15 Apr 2002 07:13:37 +0200, Sebastian H. wrote:
> Steve wrote:
>> Is there a way to print a vector using #debug? And if so could someone
>> please give an example?
>>
>
> Try this:
>
> // ----------
> //
> // Simply "returns" a vector in a string in POV-Ray notation
> //
> #macro v_string (V)
> concat ("<", str (V.x, 0, 4),", ", str (V.y, 0, 4),", ", str (V.z, 0,
> 4),">")
> #end
Thanks that syntax is what I needed.
>
> #declare Wanna_see_this_vector = <2, 0.1, 12.5>;
>
> // Should print <2, 0.1, 12.5> to the debug output
> #debug v_string (Wanna_see_this_vector)
> // ----------
>
Thanks again, I may incorporate soemthing liek this. I just hope my
3.5 hasn't expired on me.
--
#local i=.1;#local I=(i/i)/i;#local l=(i+i)/i;#local ll=(I/i)/l;box{<-ll,
-((I/I)+l),-ll><ll,-l,ll>pigment{checker scale l}finish{ambient((I/l)/I)+
(l/I)}}sphere{<i-i,l-l,(I/l)>l/l pigment{rgb((I/l)/I)}finish{reflection((
I/l)/I)-(l/I)specular(I/l)/I}}light_source{<I-l,I+I,(I-l)/l>l/l} // Steve
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Sebastian H
Subject: Re: How can I print a vector to the screen?
Date: 15 Apr 2002 15:16:06
Message: <3CBB276E.1080801@web.de>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>
> Thanks again, I may incorporate soemthing liek this. I just hope my
> 3.5 hasn't expired on me.
>
This is what happened to me this morning when I wanted to trace a little
animation while stying at university :-)))
Sebastian H.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Sebastian H
Subject: Re: How can I print a vector to the screen?
Date: 15 Apr 2002 15:30:57
Message: <3CBB2AE9.80205@web.de>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
> Sebastian H. <seb### [at] web de> wrote:
>
>>#macro v_string (V)
>> concat ("<", str (V.x, 0, 4),", ", str (V.y, 0, 4),", ", str (V.z, 0,
>>4),">")
>>#end
>
>
> Why not use vstr() instead?
>
You're right vstr() would be a better (!!?) solution but since this is a
new user group I thought it won't hurt to give an example of how to use
the concat () and str () which are very essencial in my thoughts (I use
them a lot).
(Beside I wrote this little macro just yesterday for myself and had
somwhere in mind that there exists a vstr () function which takes soooo
many args :-).)
Sebastian H.
(Oh dear, I have to improve my english...)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Sebastian H. <seb### [at] web de> wrote:
> (Beside I wrote this little macro just yesterday for myself and had
> somwhere in mind that there exists a vstr () function which takes soooo
> many args :-).)
You can use vstr() in your macro.
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3cbb4472@news.povray.org>, Warp <war### [at] tag povray org>
wrote:
> Sebastian H. <seb### [at] web de> wrote:
> > (Beside I wrote this little macro just yesterday for myself and had
> > somwhere in mind that there exists a vstr () function which takes soooo
> > many args :-).)
>
> You can use vstr() in your macro.
And the strings.inc include file has several shortcut macros, including
versions that take only one argument, the vector to be converted.
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Peter Hertel
Subject: Re: How can I print a vector to the screen?
Date: 24 Apr 2002 11:08:50
Message: <3cc6ca82@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> I'd be grateful if someone could post an example of how to center an
object.
Use the Center_Object() macro in "shapes.inc"
The syntax is: Center_Object(object_to_center, axis_to_center_on)
Axis can be combined, if you want to center the object at y and z axis, use
y+z .
#include "shapes.inc"
#declare Object = text{ttf "arial.ttf" "Look! I'm centered!!" 0.5,0 pigment
{rgb 1}}
Center_Object(Object,x+y+z)
This should do the trick..
--
_.-=^=-._.-=[ Peter ]=-._.-=^=-._
_.-=[ http://hertel.no/peter ]=-._
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |