POV-Ray : Newsgroups : povray.general : Disc which is not flat Server Time
7 Aug 2024 15:20:16 EDT (-0400)
  Disc which is not flat (Message 51 to 60 of 61)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>
From:
Subject: Re: scale by 0 (was Re: Disc which is not flat)
Date: 3 Dec 2001 11:32:14
Message: <72an0ukjp91j2d1eh2fd33q4gchj1n6sk5@4ax.com>
On Mon, 3 Dec 2001 11:02:42 -0500, "Trevor Quayle" <Tin### [at] hotmailcom>
wrote:
> Also what would be the difference between
> #local s=s*<1,1,1>
> and
> #local s=s+<0,0,0>
> ?

You want put floats and vectors into this just like scale accept, right ?
But I'm not sure multiplication Vector*<1,1,1> is defined. I can't check it
becouse limitation of current 3.5 beta.

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

From: Tom Melly
Subject: Re: Disc which is not flat
Date: 3 Dec 2001 12:04:02
Message: <3c0bb082$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:3c0aa96d@news.povray.org...

<snip>

A good point - the obvious solution, from a user's point of view, would be that
scale <0,0,2> would generate an error (not a warning), but scale z*2 wouldn't,
it would just silently expand to <1,1,2> - however, from a programmer's p.o.v.
(sic) I can see that this might be impossible if the expansion to a full vector
is done before the vector operation itself...


Post a reply to this message

From: Trevor Quayle
Subject: Re: scale by 0 (was Re: Disc which is not flat)
Date: 3 Dec 2001 12:06:13
Message: <3c0bb105$1@news.povray.org>
> > Also what would be the difference between
> > #local s=s*<1,1,1>
> > and
> > #local s=s+<0,0,0>
> > ?
>
> You want put floats and vectors into this just like scale accept, right ?
> But I'm not sure multiplication Vector*<1,1,1> is defined. I can't check
it
> becouse limitation of current 3.5 beta.

It seems to work.
From 6.1.4.3: Operations are performed on a component-by-component basis.
For example <1,2,3> + <4,5,6> evaluates the same as <1+4,2+5,3+6> or
<5,7,9>. .. etc.

It doesn't say multiplication explicitly, but it seems to imply that
<a,b,c>*<d,e,f> = <a*d,b*e,c*f> and it does work, passing a float or a
vector into the macro doesn't produce an error.

I guess either way may be equally valid, unless someone else can see a
shortcoming.

-tgq


Post a reply to this message

From: JRG
Subject: Re: Disc which is not flat
Date: 3 Dec 2001 13:25:43
Message: <3c0bc3a7@news.povray.org>
Huh? I did mistakes? It's likely to be the case, since I've never read an
English grammar book, or talked with an English person. My English now is
what I picked up from your posts during the past year. :)

--
Jonathan.

"Ben Chambers" <bdc### [at] hotmailcom> ha scritto nel messaggio
news:3c0b3228@news.povray.org...
>
> "JRG" <jrg### [at] hotmailcom> wrote in message
> news:3c0aaac1@news.povray.org...
> > If we start to put here and there exceptions to the
> > rules, things won't be easier, but harder.
>
> Kind of like the English language :)
>
> ...Chambers
>
>


Post a reply to this message

From: Warp
Subject: Re: Disc which is not flat
Date: 3 Dec 2001 15:07:16
Message: <3c0bdb74@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
: A good point - the obvious solution, from a user's point of view, would be that
: scale <0,0,2> would generate an error (not a warning), but scale z*2 wouldn't,
: it would just silently expand to <1,1,2> - however, from a programmer's p.o.v.
: (sic) I can see that this might be impossible if the expansion to a full vector
: is done before the vector operation itself...

  I have the feeling that the promotion is done as an independent and
completely separated step, before the 'rotate' code even sees it. Thus it
would be very difficult to distinguish between the two.
  And besides, should this generate the warning/error or not:

#declare Scale = y*2;
scale Scale

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Warp
Subject: Re: scale by 0 (was Re: Disc which is not flat)
Date: 3 Dec 2001 15:11:43
Message: <3c0bdc7f@news.povray.org>
Or perhaps these:

#macro scalex(Amnt) scale <Amnt,1,1> #end
#macro scaley(Amnt) scale <1,Amnt,1> #end
#macro scalez(Amnt) scale <1,1,Amnt> #end

  It's even shorter to use: Eg. scalex(2)

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Trevor Quayle
Subject: Re: scale by 0 (was Re: Disc which is not flat)
Date: 3 Dec 2001 15:40:27
Message: <3c0be33b$1@news.povray.org>
> #macro scalex(Amnt) scale <Amnt,1,1> #end
> #macro scaley(Amnt) scale <1,Amnt,1> #end
> #macro scalez(Amnt) scale <1,1,Amnt> #end
>
>   It's even shorter to use: Eg. scalex(2)
>
Yes, but I was aiming for a single macro to use in place of scale.

-tgq


Post a reply to this message

From: Warp
Subject: Re: scale by 0 (was Re: Disc which is not flat)
Date: 3 Dec 2001 16:07:58
Message: <3c0be9ae@news.povray.org>
Trevor Quayle <Tin### [at] hotmailcom> wrote:
: Yes, but I was aiming for a single macro to use in place of scale.

  Why?

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: scale by 0 (was Re: Disc which is not flat)
Date: 3 Dec 2001 17:05:34
Message: <3C0BF747.7040503@ignorancia.org>
> Yes, but I was aiming for a single macro to use in place of scale.

Hmmm... perhaps...

#macro Scale(Amnt)
    scale Amnt+<(Amnt.x=0?1:0),(Amnt.y=0?1:0),(Amnt.z=0?1:0)>
#end

then for example use "Scale(3*y)" instead "scale 3*y".

--
Jaime Vives Piqueres

La Persistencia de la Ignorancia
http://www.ignorancia.org/


Post a reply to this message

From: TinCanMan
Subject: Re: scale by 0 (was Re: Disc which is not flat)
Date: 3 Dec 2001 17:16:19
Message: <3c0bf9b3$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3c0be9ae@news.povray.org...
> Trevor Quayle <Tin### [at] hotmailcom> wrote:
> : Yes, but I was aiming for a single macro to use in place of scale.
>
>   Why?
>
I think that was my original point, no purpose other than to placate those
who dislike the way scale works.  I personally have no need for a macro like
this as I can handle the way POV scales.

-tgq


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>

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