POV-Ray : Newsgroups : povray.general : Transparent PNGs Server Time
21 May 2024 16:54:42 EDT (-0400)
  Transparent PNGs (Message 31 to 40 of 44)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>
From: Sven Littkowski
Subject: Re: Transparent PNGs
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

From: Bald Eagle
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 15:10:01
Message: <web.59de6c03c5de9ff4c437ac910@news.povray.org>
Sven Littkowski <I### [at] SvenLittkowskiname> wrote:

I'm gonna go with Christoph's sharp eye and programming kung-fu.

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

This line only ever gets parsed once.

> >> #macro MyOarLine(AmountOarsInLine,MyHeightMoreThis)
> >>  union
> >>  {
> >>   #while(MyNumber<AmountOarsInLine)
 {stuff}
> >>    #declare MyNumber = MyNumber+1;
> >>   #end
Now MyNumber = AmountOarsInLine.
Since you don't ever do #declare MyNumber = 0; to reset that, it STAYS this way.
The next time you run the macro, the #while directive just goes, "I'm already
maxxed out", and exits.
> >>  }
> >> #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.)


So the question is:  Did you move #declare MyNumber = 0; to inside the macro and
run it?

Right after
#while(MyNumber<AmountOarsInLine)
put
#debug "creating row of oars \n"
or something, and see what happens.

The more you try to head off bugs, you'll find the less you have to debug...


Post a reply to this message

From: Sven Littkowski
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 15:21:46
Message: <59de6f4a$1@news.povray.org>
On 11.10.2017 15:07, Bald Eagle wrote:
>  only ever


Bald Eagle: FULL HIT!

You managed to open my eyes. Yes, it was "MyNumber", and when i placed
it inside the macro, it worked! I think, that is what Clipka had in
mind, too, but I did not understand him (my fault again)

Problem solved!

Thank a lot, everyone!

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


Post a reply to this message

From: Sven Littkowski
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 15:41:21
Message: <59de73e1@news.povray.org>
Okay, I am getting there. Almost where I want to reach. Now another
problem where I need the advise of you experienced users: perspective!

Currently, the lower ends of the oars spread more towards the left and
right side (because they are closer to the camera). I don't want to
switch of that entirely, but i want to reduce the perspective drag
towards the sides a bit. I know, this must be accomplished inside the
CAMERA settings. but how exactly?

I started to experiment already, but have not yet found the path to
paradise.


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


Post a reply to this message


Attachments:
Download 'sl - rome - oars.png' (90 KB)

Preview of image 'sl - rome - oars.png'
sl - rome - oars.png


 

From: Bald Eagle
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 16:55:01
Message: <web.59de84e0c5de9ff4c437ac910@news.povray.org>
Decrease the camera angle, and then maybe move it back.


Post a reply to this message

From: clipka
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 18:19:56
Message: <59de990c$1@news.povray.org>
Am 11.10.2017 um 21:21 schrieb Sven Littkowski:
> On 11.10.2017 15:07, Bald Eagle wrote:
>>  only ever
> 
> 
> Bald Eagle: FULL HIT!
> 
> You managed to open my eyes. Yes, it was "MyNumber", and when i placed
> it inside the macro, it worked! I think, that is what Clipka had in
> mind, too, but I did not understand him (my fault again)

My eye and programming kung-fu may be sharp, but apparently my tutoring
kung-fu didn't quite cut it this time ;)


Post a reply to this message

From: Alain
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 19:13:34
Message: <59dea59e@news.povray.org>
Le 17-10-11 à 15:41, Sven Littkowski a écrit :
> Okay, I am getting there. Almost where I want to reach. Now another
> problem where I need the advise of you experienced users: perspective!
> 
> Currently, the lower ends of the oars spread more towards the left and
> right side (because they are closer to the camera). I don't want to
> switch of that entirely, but i want to reduce the perspective drag
> towards the sides a bit. I know, this must be accomplished inside the
> CAMERA settings. but how exactly?
> 
> I started to experiment already, but have not yet found the path to
> paradise.
> 
> 
> ---
> Diese E-Mail wurde von AVG auf Viren geprüft.
> http://www.avg.com
> 

Double the distance between the camera and the oars, and reduce the 
angle by half OR double the direction vector length.


Post a reply to this message

From: Sven Littkowski
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 20:49:40
Message: <59debc24@news.povray.org>
On 11.10.2017 18:19, clipka wrote:

> My eye and programming kung-fu may be sharp, but apparently my tutoring
> kung-fu didn't quite cut it this time ;)
> 
Maybe it were my eyes or my mind that were not in best condition. :-)

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


Post a reply to this message

From: Sven Littkowski
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 22:47:41
Message: <59ded7cd$1@news.povray.org>
Everything is perfect now ... just one more question.   :-D

Is there any trick in POV-Ray, that allows me to make an item invisible
but still to get its shadow onto a wall behind it?

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


Post a reply to this message

From: omniverse
Subject: Re: Transparent PNGs
Date: 11 Oct 2017 23:20:00
Message: <web.59dedeacc5de9ff49c5d6c810@news.povray.org>
Sven Littkowski <I### [at] SvenLittkowskiname> wrote:
> Everything is perfect now ... just one more question.   :-D
>
> Is there any trick in POV-Ray, that allows me to make an item invisible
> but still to get its shadow onto a wall behind it?

no_image in the primitive, CSG or object statement, will do that and texture not
needed.


Post a reply to this message

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

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