POV-Ray : Newsgroups : povray.general : I was disappointed with six lines Server Time
8 Aug 2024 04:11:00 EDT (-0400)
  I was disappointed with six lines (Message 11 to 19 of 19)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Nekar Xenos
Subject: Re: I was disappointed with six lines
Date: 8 May 2001 07:18:32
Message: <3af7d608@news.povray.org>
>This one should be fine (I hope).
>
> Thanks
>
> Nekar Xenos
>
> --
> #local Q=seed(7);#local B=<-2,2,5>;#local E=<2,-2,5>;#local
> C=<2,4,6>*4;blob{
> threshold 1#while(vlength(B-E)>.1)#local S=B;#local
> B=B+<rand(Q),rand(Q),rand(
> Q)>/20;#local B=B-2*(B-S)*(vlength(B-E)>vlength(S-E));sphere{0,1,1
> scale.1//NX
> translate<B.y,-B.x,B.z>}sphere{0,1,1 scale.1translate B}#end pigment{rgb
C}}
>
>
It's still not right. Anyone know how to fix this?
--
#local Q=seed(7);#local B=<-2,2,5>;#local E=<2,-2,5>;#local
C=<2,4,6>*4;blob{
threshold 1#while(vlength(B-E)>.1)#local S=B;#local
B=B+<rand(Q),rand(Q),rand(
Q)>/20;#local B=B-2*(B-S)*(vlength(B-E)>vlength(S-E));sphere{0,1,1
scale.1//NX
translate<B.y,-B.x,B.z>}sphere{0,1,1 scale.1translate B}#end pigment{rgb C}}


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: I was disappointed with six lines
Date: 8 May 2001 08:21:40
Message: <3af7e4d4@news.povray.org>
Nekar Xenos wrote in message <3af7d222@news.povray.org>...
> --
> #local Q=seed(7);#local B=<-2,2,5>;#local E=<2,-2,5>;#local C=<2,4,6>*4;blob{
> threshold 1#while(vlength(B-E)>.1)#local S=B;#local
>B=B+<rand(Q),rand(Q),rand(
> Q)>/20;#local B=B-2*(B-S)*(vlength(B-E)>vlength(S-E));sphere{0,1,1 scale.1//NX
> translate<B.y,-B.x,B.z>}sphere{0,1,1 scale.1translate B}#end pigment{rgb C}}


#local Q=seed(7);#local B=<-2,2,5>;#local E=<2,-2,5>;blob{threshold 1#while((E
-B).x>.1)#local S=B;#local B=B+<rand(Q),rand(Q),rand(Q)>/20;#local B=(vlength(
B-E)<vlength(S-E)?B:2*S-B);sphere{<B.y,-B.x,B.z>,.1,1}sphere{B,.1,1}#end
pigment{rgb<8,16,24>}}

rgb 9 is also shorter and readable

perhaps your problem with splitted lines depends on default line length in your
Outlook - but it is rather off topic

ABX


Post a reply to this message

From: Nekar Xenos
Subject: Re: I was disappointed with six lines
Date: 8 May 2001 09:22:39
Message: <3af7f31f@news.povray.org>
>vlength(S-E)?B:2*S-B);
>sphere{<B.y,-B.x,B.z>,.1,1}

I don't understand the use of '?' and 'B.y'

Could you maybe explain it to me?

> perhaps your problem with splitted lines depends on default line length in
your
> Outlook - but it is rather off topic

That's OK, I've sorted it out.

Thanks for all your help :)

Nekar


--
#local Q=seed(7);#local B=<-2,2,5>;#local E=<2,-2,5>;blob{threshold 1#while((E
-B).x>.1)#local S=B;#local B=B+<rand(Q),rand(Q),rand(Q)>/20;#local B=(vlength(
B-E)<vlength(S-E)?B:2*S-B);sphere{<B.y,-B.x,B.z>,.1,1}sphere{B,.1,1}#end
pigment{rgb<8,16,24>}}// nekar Xenos


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: I was disappointed with six lines
Date: 8 May 2001 10:51:00
Message: <3af807d4@news.povray.org>
Nekar Xenos wrote in message <3af7f31f@news.povray.org>...
> >vlength(S-E)?B:2*S-B);
> >sphere{<B.y,-B.x,B.z>,.1,1}
>
> I don't understand the use of '?' and 'B.y'

in your original sig there was assigment
#local B=B-(2*(B-S))*((vlength(B-E)>vlength(S-E)));
expression vlength(B-E)>vlength(S-E) is logical
and can return 1 (true) or 0 (false)
therefore you can change it to:
  #if(vlength(B-E)>vlength(S-E))
    #local B=B-2*(B-S)*1;
  #else
    #local B=B-2*(B-S)*0;
  #end
and it is eqivalent of:
  #if(vlength(B-E)>vlength(S-E))
    #local B=B-2*(B-S);
  #else
    #local B=B;
  #end
now, you must know that construction
A?B:C is eqivalent to #if(A) B #else C #end
such equivalent is very popular in programing
(not only POV script language)
(it is described in POV manual under "Float Expressions")
therefore you can write just
#local B=(vlength(B-E)<vlength(S-E)?B:2*S-B);

I have also changed condition for while
from #while(vlength(B-E)>.1) to #while((E-B).x>.1)

Considering that you are going from B to E
you can take length between B and E
but you can also take segment BE
and take one of coordinates

> Could you maybe explain it to me?

Do you need something more ?

> Thanks for all your help :)


Thanks for fun :)

ABX


Post a reply to this message

From: Ron Parker
Subject: Re: I was disappointed with six lines
Date: 8 May 2001 10:54:48
Message: <slrn9fg25s.ik2.ron.parker@fwi.com>
On Tue, 8 May 2001 16:50:05 +0200, Wlodzimierz ABX Skiba wrote:
>I have also changed condition for while
>from #while(vlength(B-E)>.1) to #while((E-B).x>.1)
>
>Considering that you are going from B to E
>you can take length between B and E
>but you can also take segment BE
>and take one of coordinates

Those two things aren't entirely equivalent, unless you can guarantee that
E and B have the same y and z coordinates.  The substitution might be good
enough for this purpose, but it won't work in general.

-- 
#local R=<7084844682857967,32787982,826975826580>#macro L(P)concat(#while(P)chr(
mod(P,100)),#local P=P/100;#end"")#end background{rgb 1}text{ttf L(R.x)L(R.y)0,0
translate<-.8,0,-1>}text{ttf L(R.x)L(R.z)0,0translate<-1.6,-.75,-1>}sphere{z/9e3
4/26/2001finish{reflection 1}}//ron.parker@povray.org My opinions, nobody else's


Post a reply to this message

From: Nekar Xenos
Subject: Re: I was disappointed with six lines
Date: 8 May 2001 11:02:15
Message: <3af80a77@news.povray.org>
Thanks

> Do you need something more ?

I'd like to add  a cyan 'N' before the 'X' and keep it at four lines, but I
think that's pushing it a little...  ;)

Nekar X

--
#local Q=seed(7);#local B=<-2,2,5>;#local E=<2,-2,5>;blob{threshold 1#while((E
-B).x>.1)#local S=B;#local B=B+<rand(Q),rand(Q),rand(Q)>/20;#local B=(vlength(
B-E)<vlength(S-E)?B:2*S-B);sphere{<B.y,-B.x,B.z>,.1,1}sphere{B,.1,1}#end
pigment{rgb<8,16,24>}}// nekar Xenos


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: I was disappointed with six lines
Date: 8 May 2001 11:11:00
Message: <3af80c84@news.povray.org>
Ron Parker wrote in message ...
> Those two things aren't entirely equivalent, unless you can guarantee that
> E and B have the same y and z coordinates.  The substitution might be good
> enough for this purpose, but it won't work in general.

of course, this shortcuts was connected with sense algorithm

ABX


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: I was disappointed with six lines
Date: 8 May 2001 11:16:15
Message: <3af80dbf@news.povray.org>
Nekar Xenos wrote in message <3af80a77@news.povray.org>...
> Thanks
>
> > Do you need something more ?
>
> I'd like to add  a cyan 'N' before the 'X' and keep it at four lines, but I
> think that's pushing it a little...  ;)


perhaps you can achive N with part of X, something like:

 /\/ /
/ /\/

ABX


Post a reply to this message

From: Nekar Xenos
Subject: Re: I was disappointed with six lines
Date: 9 May 2001 04:06:28
Message: <3af8fa84@news.povray.org>
Cool! Why didn't I think of that...  :)

Nekar

--
#local N=<-4,8,20>;#local K=<4,-8,20>;#local R=seed(0);union{#while((K-N).x>0)
#local X=N;#local N=N+<rand(R),rand(R),1>/30;#local N=(vlength(N-K)<vlength(X-K
)?N:2*X-N);sphere{<N.y,-N.x,N.z>,.2}sphere{N,.2}sphere{<-N.x-8,N.y,N.z>,.1//-NX
pigment{rgb N}}sphere{<N.x+8,-N.y,N.z>,.1 pigment{rgb N}}#end pigment{rgb 9}}


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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