POV-Ray : Newsgroups : povray.general : Q: Your scripting style Server Time
8 Aug 2024 10:23:59 EDT (-0400)
  Q: Your scripting style (Message 5 to 14 of 14)  
<<< Previous 4 Messages Goto Initial 10 Messages
From: Mark Wagner
Subject: Re: Your scripting style
Date: 13 Feb 2001 02:40:07
Message: <3a88e4d7$1@news.povray.org>
Marc-Hendrik Bremer wrote in message <3a87dce9@news.povray.org>...
>Hi,
>
>I would like to know, how you manage to keep track of the things in your
>more complex scenes, 'cause I've problems with this.


Include files.  Lots of include files.
Textures usually go in one include file.  Each object or group of related
objects goes in another.  I have my include files set up so I can either
render them separately or as part of the main scene.

--
Mark


Post a reply to this message

From: John VanSickle
Subject: Re: Q: Your scripting style
Date: 13 Feb 2001 03:31:15
Message: <3A88F0F8.38F4C05@hotmail.com>
Marc-Hendrik Bremer wrote:
> 
> Hi,
> 
> I would like to know, how you manage to keep track of the things in your
> more complex scenes, 'cause I've problems with this.
> 
> So, how are you doing these things?

My scripts use the following conventions:

CSG brackets are marked with the object being put together, such as:

union { // the camera
  union { // the camera case
    box { ... }
    sphere { ... }
    cylinder { ... }
    // etc...
    texture { CameraTexture }
  } // end of the camera case
  difference { // the lens
    sphere { ... }
    sphere { ... }
    material { LensMaterial }
  } // end of the lens
} // end of the camera

I always indent (or at least try to indent) each level of nesting.
An indent of two spaces is enough for me; your mileage may vary.

A lot of my .inc files make use of variables passed on by the calling
script.  The first thing in the .inc is code defining those values
that I may have neglected:

#ifndef(RobotArmed)
#local RobotArmed=false;
#end

In my current IRTC project (which will feature Rusty, Domo, and Rosie),
I have one script file which positions the robots, another that places
the camera, others that place the static objects, build the robots, etc.

Hope this helps,
John


Post a reply to this message

From: Warp
Subject: Re: Q: Your scripting style
Date: 14 Feb 2001 05:32:41
Message: <3a8a5ec9@news.povray.org>
Marc-Hendrik Bremer <Mar### [at] t-onlinede> wrote:
: That works, but I find myself often scrolling about large parts of the
: scene

  That's exactly why there's an #include statement...
  It's perfectly possible to make your scene in several source files.

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Mr  Art
Subject: Re: Q: Your scripting style
Date: 14 Feb 2001 20:43:20
Message: <3A8B67AC.1BB2ADD3@chesapeake.net>
This is my approach also. A holdover from my programing days.

Ron Parker wrote:
>
<snip> 
> I try to put everything that
> has to do with a single physical object into one file, and everything that
> has to do with the stage in another file, and finally include them all
> into one big scene that's nothing more than #includes and object placement
> and lighting and a camera.  I also try to have a test scene #ifdef'd at the
> bottom of each include file, so I can preview the objects or the stage as
> I model them.
>


Post a reply to this message

From: David Fontaine
Subject: Re: Q: Your scripting style
Date: 14 Feb 2001 22:39:49
Message: <3A8B4F3C.84255D7F@faricy.net>
If the file gets really big, strip common items out to include files, such as
textures. Then use highly visible comments to seperate portions of the large
file

// ********************
// * Things and stuff *
// ********************

(I try to avoid the /*...*/ style comments when possible so that if I later want
to exclude a large chunk of code I can use them to comment it out and nothing
will interfere.)

I notice a lot of instructional references use a sort of comment margin; if you
want to comment on a specific line tab over a certain distance and comment there
so that all your comments line up, and it's like you have a column of psuedocode
running down the right-hand side of the text.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Chris Huff
Subject: Re: Q: Your scripting style
Date: 15 Feb 2001 06:36:12
Message: <chrishuff-BBA113.06361715022001@news.povray.org>
In article <3A8B4F3C.84255D7F@faricy.net>, David Fontaine 
<dav### [at] faricynet> wrote:

> (I try to avoid the /*...*/ style comments when possible so that if I 
> later want to exclude a large chunk of code I can use them to comment 
> it out and nothing will interfere.)

You do know that POV-style /*...*/ comments can be nested, right? The 
C-style /*...*/ comments often interfere with my work, because they 
don't nest, but I've never had a problem with the POV-style ones.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Bob H 
Subject: Re: Q: Your scripting style
Date: 15 Feb 2001 19:15:33
Message: <3a8c7125@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-BBA113.06361715022001@news.povray.org...
> In article <3A8B4F3C.84255D7F@faricy.net>, David Fontaine
> <dav### [at] faricynet> wrote:
>
> > (I try to avoid the /*...*/ style comments when possible so that if I
> > later want to exclude a large chunk of code I can use them to comment
> > it out and nothing will interfere.)
>
> You do know that POV-style /*...*/ comments can be nested, right? The
> C-style /*...*/ comments often interfere with my work, because they
> don't nest, but I've never had a problem with the POV-style ones.

But you use a Mac (drat it all) and for some reason this commenting method
can't be nested under Windows.  Well, mine here anyhow.

Bob H.


Post a reply to this message

From: David Fontaine
Subject: Re: Q: Your scripting style
Date: 15 Feb 2001 21:22:00
Message: <3A8C8E61.3F8F16DB@faricy.net>
"Bob H." wrote:

> > You do know that POV-style /*...*/ comments can be nested, right? The
> > C-style /*...*/ comments often interfere with my work, because they
> > don't nest, but I've never had a problem with the POV-style ones.
>
> But you use a Mac (drat it all) and for some reason this commenting method
> can't be nested under Windows.  Well, mine here anyhow.

ditto

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Mark Wagner
Subject: Re: Q: Your scripting style
Date: 16 Feb 2001 00:07:58
Message: <3a8cb5ae$1@news.povray.org>
Bob H. wrote in message <3a8c7125@news.povray.org>...
>But you use a Mac (drat it all) and for some reason this commenting method
>can't be nested under Windows.  Well, mine here anyhow.


Yes you can.  The syntax highlighting won't show it, but the comments do
nest.

--
Mark


Post a reply to this message

From: Bob H 
Subject: Re: Q: Your scripting style
Date: 16 Feb 2001 01:52:18
Message: <3a8cce22$1@news.povray.org>
"Mark Wagner" <mar### [at] gtenet> wrote in message
news:3a8cb5ae$1@news.povray.org...
> Bob H. wrote in message <3a8c7125@news.povray.org>...
> >But you use a Mac (drat it all) and for some reason this commenting method
> >can't be nested under Windows.  Well, mine here anyhow.
>
>
> Yes you can.  The syntax highlighting won't show it, but the comments do
> nest.

Oh, sorry, right.  Thanks for clearing that up Mark.  I think I never try to
use the slash-asterisk comment asterisk-slash embedding simply because of the
syntax color scheme of the CodeMax Editor and so I just always consider it to
not be done.
To think I've been limited as the result of a colored font for so long now  :-/

Bob H.


Post a reply to this message

<<< Previous 4 Messages Goto Initial 10 Messages

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