POV-Ray : Newsgroups : povray.beta-test : [std include] floats as vectors Server Time
2 Nov 2024 07:27:53 EDT (-0400)
  [std include] floats as vectors (Message 1 to 9 of 9)  
From:
Subject: [std include] floats as vectors
Date: 17 Jan 2002 08:17:40
Message: <vkhd4uoppr1vl1f6k0fvgnbhqbece3k7cb@4ax.com>
POV 3.5 b 10

It is possible to write floats as vectors in POV but somehow for standard
include files it can't be done. For example I can't write
  Round_Box(-1,1,.1,no)
I have to write
  Round_Box(<-1,-1,-1>,<1,1,1>,.1,no)
But it could be done with some simple additions. For example for Round_Box it
can be done with additional two lines at beginnig of macro:

   #local A=A+0*x;
   #local B=B+0*x;

This behaviour is connected with all macros with vector parameters. If there are
some problems with time or something I can check all standard macros for such
cases and post changed versions somewhere.

ABX


Post a reply to this message

From: fabien
Subject: Re: [std include] floats as vectors
Date: 17 Jan 2002 10:03:47
Message: <3c46e7d3@news.povray.org>


> But it could be done with some simple additions. For example for Round_Box
it
> can be done with additional two lines at beginnig of macro:
>
>    #local A=A+0*x;
>    #local B=B+0*x;

Good idea.

Fabien.


Post a reply to this message

From: Slime
Subject: Re: [std include] floats as vectors
Date: 17 Jan 2002 10:11:47
Message: <3c46e9b3$1@news.povray.org>
> it can be done with additional two lines at beginnig of macro:
>
>    #local A=A+0*x;
>    #local B=B+0*x;

Or by
#local A = A*<1,1,1>;
for that matter.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]


Post a reply to this message

From:
Subject: Re: [std include] floats as vectors
Date: 17 Jan 2002 10:23:33
Message: <a0rd4u4m9q4h7a0ida1fs6918ml9k5uf6r@4ax.com>
On Thu, 17 Jan 2002 10:09:34 -0500, "Slime" <noo### [at] hotmailcom> wrote:
> >    #local A=A+0*x;
> >    #local B=B+0*x;
>
> Or by
> #local A = A*<1,1,1>;
> for that matter.

my version is shorter ;)

ABX


Post a reply to this message

From: ingo
Subject: Re: [std include] floats as vectors
Date: 17 Jan 2002 10:37:31
Message: <Xns9199A95C9A5C1seed7@povray.org>

wrote:

> my version is shorter ;)
> 
> 

It's not a sig.

What version is faster?

Ingo


Post a reply to this message

From:
Subject: Re: [std include] floats as vectors
Date: 17 Jan 2002 10:43:39
Message: <m2sd4u8jnq3cjdtd3nv3umib7av0bjr7gc@4ax.com>
On 17 Jan 2002 10:37:31 -0500, ingo <ing### [at] homenl> wrote:
> in news:a0rd4u4m9q4h7a0ida1fs6918ml9k5uf6r@4ax.com W?odzimierz ABX Skiba 
> wrote:
> > my version is shorter ;)
>
> It's not a sig.

but since macro calling is connected with seeking on file then it can be
important sometimes

> What version is faster?

imo it doesn't metter. it is not in loop and both return vector - it is most
important

ABX


Post a reply to this message

From: Warp
Subject: Re: [std include] floats as vectors
Date: 17 Jan 2002 11:40:18
Message: <3c46fe71@news.povray.org>

: but since macro calling is connected with seeking on file then it can be
: important sometimes

  AFAIK the speed of seeking a file is independent of its size (as it just
modifies a file handler; it doesn't read the file).

-- 
#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

From:
Subject: Re: [std include] floats as vectors
Date: 17 Jan 2002 13:05:52
Message: <j24e4ukk3r4gmrqugkpo51brq2tlg8kn0k@4ax.com>
On 17 Jan 2002 10:37:31 -0500, ingo <ing### [at] homenl> wrote:
> What version is faster?

If there is still somebody interested then I've compared:

script 1:
      0: #local X=1;
      1: #local Y=X+0*x;
      2: #local Y=X+0*x;
      .....
 114688: #local Y=X+0*x;

script 2:
      0: #local X=1;
      1: #local Y=X*<1,1,1>;
      2: #local Y=X*<1,1,1>;
      .....
 114688: #local Y=X*<1,1,1>;

Each one was started five times with +w1 +h1.
Average total CPU time used reported by NT version for first script was
5.178 s.
Average total CPU time used reported by NT version for second script was
8.790 s.

Done on PII 233 with 128 MB on NT 4 Sp 6

So first one is much faster. IMO becouse of smaller number of parsed tokens.

Good night (and morning for others).

ABX


Post a reply to this message

From: Christopher James Huff
Subject: Re: [std include] floats as vectors
Date: 17 Jan 2002 18:17:16
Message: <chrishuff-F03E98.18180817012002@netplex.aussie.org>
In article <vkhd4uoppr1vl1f6k0fvgnbhqbece3k7cb@4ax.com>,
 W?odzimierz ABX Skiba <abx### [at] babilonorg> wrote:

>    #local A=A+0*x;
>    #local B=B+0*x;

I had intended to work around this problem by using

#local A = A + o;

in all those macros, but never got around to it...

No reason to use things like "*< 1, 1, 1>" or "+ 0*x" when "o" (for 
"origin") is defined in consts.inc as < 0, 0, 0>. ;-)

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

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