POV-Ray : Newsgroups : povray.general : Variable demotion Server Time
20 Nov 2024 06:25:42 EST (-0500)
  Variable demotion (Message 1 to 4 of 4)  
From: Greg M  Johnson
Subject: Variable demotion
Date: 9 Nov 2001 08:52:58
Message: <3BEBDF58.4FC45639@aol.com>
I had a scene where I had lots of complex math (okay, sloppy algebra)
going on across several include files. After making a change, I found
that a vector variable I was using in a scale command was giving an
error about "vector expression expected but color found."  I assume this
means I somehow accidentally turned my 3-dimensional vector into a 4 or
5 dimensional one.  (#debugging seemed to confirm this).   Minutes of
scouring my scene files turned up no specific error.  I ended up
starting over with a backed-up version of the file.

Q: How could I have turned it back?  I want the same variable name, just
altered so that pov will think it's a 3 dimensional vector.


Post a reply to this message

From: Warp
Subject: Re: Variable demotion
Date: 9 Nov 2001 08:58:09
Message: <3bebe0f1@news.povray.org>
You should really see where the problem is and fix that. But anyway, if
you want to convert a color vector to a 3D vector, you can do it this way:

#declare Vec = <Vec.x, Vec.y, Vec.z>;

-- 
#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:
Subject: Re: Variable demotion
Date: 9 Nov 2001 09:08:09
Message: <poonutk680etmkr12v230losshep378m0r@4ax.com>
On Fri, 09 Nov 2001 08:51:20 -0500, "Greg M. Johnson"
<"gregj56590[:-0]"@aol.com> wrote:
>Q: How could I have turned it back?  I want the same variable name, just
>altered so that pov will think it's a 3 dimensional vector.

You want something like this ?

#declare V=<1,2,3,4,5>;
#debug str(vlength(V),0,-1) // create parse error
#declare Temp=V;
#declare V=<V.x,V.y,V.z>;
#debug str(vlength(V),0,-1)

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: John VanSickle
Subject: Re: Variable demotion
Date: 9 Nov 2001 16:26:01
Message: <3BEC4A59.5E02E7E1@hotmail.com>
Greg M. Johnson wrote:
> 
> Q: How could I have turned it back?  I want the same variable name,
> just altered so that pov will think it's a 3 dimensional vector.

Find where you accidentally put an extra comma into the vector and
take it out.  That's what usually causes my problems of this nature.

-- 
ICQ: 46085459


Post a reply to this message

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