POV-Ray : Newsgroups : povray.general : Transparent PNGs : Re: Transparent PNGs Server Time
18 May 2024 05:31:55 EDT (-0400)
  Re: Transparent PNGs  
From: Sven Littkowski
Date: 11 Oct 2017 13:47:29
Message: <59de5931$1@news.povray.org>
On 11.10.2017 10:17, clipka wrote:
> Am 11.10.2017 um 14:41 schrieb Sven Littkowski:
> 
>> The value "AmountLines" allows me to set the amount of oar lines above
>> each other, but strangely, I always get just one line. I am very sure,
>> the fault is with me: "I am not seeing the forest because of all the
>> trees in my eyesight". Means, I am looking at the scene code, and just
>> can't discover the error in thinking/writing. Can you help?
> 
> [...]
>> #declare MyNumber = 0;
>>
>>
>> #macro MyOarLine(AmountOarsInLine,MyHeightMoreThis)
>>  union
>>  {
>>   #while(MyNumber<AmountOarsInLine)
>>
>>    #declare MyAngleWater     = (rand(R1)*MyVariance)+GeneralAngle;
>>    #declare MyAngleHands     = (rand(R2)*MyVariance)+BladeAngle;
>>    #declare MyAngleDirection = (rand(R3)*MyVariance)+ForwardAngle;
>>    object
>>    {
>>     MyOar(MyHeightMoreThis)
>>     rotate < 0.0, MyAngleHands, 0.0 >
>>     rotate < MyAngleWater, 0.0, 0.0 >
>>     rotate < 0.0, 0.0, MyAngleDirection >
>>     translate < (MyNumber*0.925), 0.0, 0.0 >
>>    }
>>    #declare MyNumber = MyNumber+1;
>>   #end
>>  }
>> #end
> 
> You need to set `MyNumber = 0` each time you're running the macro (i.e.
> the `#declare` should be inside the macro. Also, I'd suggest using
> `#local` instead; it's good practice for macros, unless you want to pass
> values out of the macro via global variables.)
> 
Hi, thanks.

I pressed ENTER too fast and therefore wasn't able to add the
explanations to that posting as I actually had wanted.

Doing it now.

The ships had between one line of oars, two, or a maximum of three lines
of oars, each line above each other by half a meter (that is the "0.5"
value), and also half a meter shifted to the left (to prevent the oar
holes would be directly above each other).

My code features the same thing: I can set the amount of oar lines, and
the WHILE loop with the,lines is executed only one single time, in which
between one to three lines (or more if I had entered more) would be
created. The value "#declare ThisLine = 0;" right in front of this code
would be read only one time therefore (should be, to the best of my
knowledge).

Each line consists of a flexible amount of oars. But I don't think, that
any fault is within those code segments.

Concentrating back on the code segment for the creation of multiple oar
lines, I think here somewhere must be the problem.

If I specify three oar lines, it creates only the upper oar line (higher
starting position). If I specify two oar lines, it only creates one oar
line in the middle. And if i specify that the ship has only one oar
line, it creates the lowest oar line (correctly in this case). But in
the first two cases (3 and 2 lines), oar lines are missing.

Example:
specifying 3 oar lines, I should see three lines of oars, one on top,
one in the middle, one at the bottom, each slightly shifted to the side.
But I see only the upper oars line.

The WHILE loop calls a macro, but the WHILE loop itself is not part of
any macro. If I would put the "#declare ThisLine = 0;" value inside a
macro, I believe it wouldn't work as that value is needed outside that
macro in order to specify how many times that macro is being called.

Can anyone get this code to function? The configuration values close to
the top of this scene are set for creating 3 oars lines. Who can get it
to create 3 lines, or can find my error(s)?



---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

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