POV-Ray : Newsgroups : povray.general : step by step Server Time
1 Mar 2024 19:11:28 EST (-0500)
  step by step (Message 1 to 9 of 9)  
From: David Kraics
Subject: step by step
Date: 20 Dec 2023 09:30:00
Message: <web.6582f9b0cbd9d54c87b92d44a57e0@news.povray.org>
Ok. bear with me. I know I should know this, and it is really basic, but between
my meds and my state of mind, I can't think of it.

I created this object
#declare floorframe = box{<0.283031,-0.001781,-0.001781>,
<0.283031,0.001781,0.501781>}

and starting at
object{floorframe translate<0,1.570883,0>}

I am placing them downwards in increments of 0.032059
until it stops at 0 or thereabouts (not below).

I actually crunched out 20 numbers until I remembered there is a way to do it
using steps, but God help me I can't remember how. Can you help me out?


Post a reply to this message

From: jr
Subject: Re: step by step
Date: 20 Dec 2023 10:25:00
Message: <web.658306faa8689bc37f6d9cf76cde94f1@news.povray.org>
hi,

"David Kraics" <bar### [at] aolcom> wrote:
> Ok. bear with me. I know I should know this, and it is really basic, but between
> my meds and my state of mind, I can't think of it.
>
> I created this object
> #declare floorframe = box{<0.283031,-0.001781,-0.001781>,
> <0.283031,0.001781,0.501781>}
>
> and starting at
> object{floorframe translate<0,1.570883,0>}
>
> I am placing them downwards in increments of 0.032059
> until it stops at 0 or thereabouts (not below).
>
> I actually crunched out 20 numbers until I remembered there is a way to do it
> using steps, but God help me I can't remember how. Can you help me out?

guessing you're thinking of  '#for' loop.

<https://wiki.povray.org/content/Reference:Conditional_Directives#The_for_Directive>


regards, jr.


Post a reply to this message

From: David Kraics
Subject: Re: step by step
Date: 20 Dec 2023 10:40:00
Message: <web.65830a85a8689bc387b92d44a57e0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "David Kraics" <bar### [at] aolcom> wrote:
> > Ok. bear with me. I know I should know this, and it is really basic, but between
> > my meds and my state of mind, I can't think of it.
> >
> > I created this object
> > #declare floorframe = box{<0.283031,-0.001781,-0.001781>,
> > <0.283031,0.001781,0.501781>}
> >
> > and starting at
> > object{floorframe translate<0,1.570883,0>}
> >
> > I am placing them downwards in increments of 0.032059
> > until it stops at 0 or thereabouts (not below).
> >
> > I actually crunched out 20 numbers until I remembered there is a way to do it
> > using steps, but God help me I can't remember how. Can you help me out?
>
> guessing you're thinking of  '#for' loop.
>
> <https://wiki.povray.org/content/Reference:Conditional_Directives#The_for_Directive>
>
>
> regards, jr.

Ok I tried with

#for (ff,1.570883,0,-0.032059)
object{floorframe translate<0,ff,0>}
#end

and there is no object. I thought that maybe it just moved one object downward
but it doesn't show at all.


Post a reply to this message

From: jr
Subject: Re: step by step
Date: 20 Dec 2023 10:55:00
Message: <web.65830d92a8689bc37f6d9cf76cde94f1@news.povray.org>
hi,

"David Kraics" <bar### [at] aolcom> wrote:
> ...
> Ok I tried with
>
> #for (ff,1.570883,0,-0.032059)
> object{floorframe translate<0,ff,0>}
> #end
>
> and there is no object. I thought that maybe it just moved one object downward
> but it doesn't show at all.

ah.  please post a "minimal" scene showing /reproducing the problem.  thanks.


regards, jr.


Post a reply to this message

From: David Kraics
Subject: Re: step by step
Date: 20 Dec 2023 11:25:00
Message: <web.6583144fa8689bc387b92d44a57e0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "David Kraics" <bar### [at] aolcom> wrote:
> > ...
> > Ok I tried with
> >
> > #for (ff,1.570883,0,-0.032059)
> > object{floorframe translate<0,ff,0>}
> > #end
> >
> > and there is no object. I thought that maybe it just moved one object downward
> > but it doesn't show at all.
>
> ah.  please post a "minimal" scene showing /reproducing the problem.  thanks.
>
>
> regards, jr.

ummm

#version 3.5;
#include "colors.inc" // Standard Color definitions
#include "textures.inc" // Standard Texture definitions
#include "shapes.inc"

#declare position= <.375,.7 ,-2.5>; // used for camera and its associated camera
light.                            //2.337965

 background { color<0.0078125,0.51171875,0.8359375>}

camera
{
  location  position
 // look_at   <0.0 , 0.0 , 0.0>
}


#declare floorframe =
box{<0.283031,-0.001781,-0.001781>,<0.283031,0.001781,0.501781>}



box{<-.28125,0,0>,<.28125,1.635,.5> pigment{Grey}}


#for (ff,1.570883,0,-0.032059)
object{floorframe translate<0,ff,0>}
#end





 // upper right light
light_source{<1000, 1000, -5000>color White}

// upper left light
light_source{<-1000, 1000, -5000>color White}

it should show a series of black lines across the grey box like a ladder or
something. Basically, I intend to create a grid. I am making the horizontal
lines before the vertical ones. This loop doesn't give anything, however.


Post a reply to this message

From: jr
Subject: Re: step by step
Date: 20 Dec 2023 11:35:00
Message: <web.658316c7a8689bc37f6d9cf76cde94f1@news.povray.org>
hi,

"David Kraics" <bar### [at] aolcom> wrote:
> ...
> > ah.  please post a "minimal" scene showing /reproducing the problem.  thanks.
> ummm

:-)


> #version 3.5;

unsure but think '#for()' wasn't around then.  try a 3.7 / 3.8 executable ?

thanks for posting.  will have a look tonight.


regards, jr.


Post a reply to this message

From: David Kraics
Subject: Re: step by step
Date: 20 Dec 2023 12:05:00
Message: <web.65831d8fa8689bc387b92d44a57e0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "David Kraics" <bar### [at] aolcom> wrote:
> > ...
> > > ah.  please post a "minimal" scene showing /reproducing the problem.  thanks.
> > ummm
>
> :-)
>
>
> > #version 3.5;
>
> unsure but think '#for()' wasn't around then.  try a 3.7 / 3.8 executable ?
>
> thanks for posting.  will have a look tonight.
>
>
> regards, jr.

changed to 3.7. no difference.


Post a reply to this message

From: jr
Subject: Re: step by step
Date: 20 Dec 2023 12:30:00
Message: <web.6583237da8689bc37f6d9cf76cde94f1@news.povray.org>
hi,

> changed to 3.7. no difference.

I used a 3.8.0-alpha, but with the '3.7' version directive.

I changed 'floorframe' to a 'box {0,1}' and in the loop gave the object a
different pigment on each iteration (just cycling through r/g/b).  the box does
move :-)  your "grey" box is "in the way", there are coinciding surfaces (I'm
guessing looking at output).  suggest/recommend you write the scene with simple
unit dimensions, and do the exact stepping / locating / sizing when you're happy
with the basic thing.  (if needed can clean up code and post later/tomorrow).


regards, jr.


Post a reply to this message

From: David Kraics
Subject: Re: step by step
Date: 20 Dec 2023 12:45:00
Message: <web.65832709a8689bc387b92d44a57e0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> > changed to 3.7. no difference.
>
> I used a 3.8.0-alpha, but with the '3.7' version directive.
>
> I changed 'floorframe' to a 'box {0,1}' and in the loop gave the object a
> different pigment on each iteration (just cycling through r/g/b).  the box does
> move :-)  your "grey" box is "in the way", there are coinciding surfaces (I'm
> guessing looking at output).  suggest/recommend you write the scene with simple
> unit dimensions, and do the exact stepping / locating / sizing when you're happy
> with the basic thing.  (if needed can clean up code and post later/tomorrow).
>
>
> regards, jr.

Removed the grey box, ran it again and... OMG I'm so stupid. In the definition
of the floorframe box, the first X value is supposed to be negative. Fixed that
and now the code works.


Post a reply to this message

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