POV-Ray : Newsgroups : povray.general : The Language of POV-Ray Server Time
12 Aug 2024 13:18:56 EDT (-0400)
  The Language of POV-Ray (Message 28 to 37 of 297)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Tor Olav Kristensen
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:04:55
Message: <38C81EE7.5E35B960@hotmail.com>
Ron Parker wrote:

> On Thu, 09 Mar 2000 11:10:38 -0800, Ken wrote:
>
> >So the way I see it by adding this you would save yourself the effort
> >of typing one character.
>
> #declare MyArray[25*X+5*Y+Z][Colour.r] = MyArray[25*X+5*Y+Z][Colour.r] + 1;

How about making the editor do the re-typing for the lazy ones?

When you type

#declare something +=

and a function key, then the editor just auto-replaces the

+=

with

= something +

so the sentence becomes

#declare something = something +


Regards

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Ron Parker
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:07:32
Message: <38c820a4$1@news.povray.org>
On Thu, 09 Mar 2000 23:00:07 +0100, Tor Olav Kristensen wrote:
>
>Ron Parker wrote:

>> #declare MyArray[25*X+5*Y+Z][Colour.r] = MyArray[25*X+5*Y+Z][Colour.r] + 1;
>
>How about making the editor do the re-typing for the lazy ones?

Because that's just ugly (we don't ALL use the editor built-in to POV for 
Windows, you know) and in any case it just puts off the problems inherent 
in the line above until you come back to maintain it later.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:19:46
Message: <38C82261.6B18E224@hotmail.com>
If you use an editor with copy and paste features,
I would guess that the maximum number of extra
keystrokes you would have to do is about 7 or 8.
(Or even fewer if you use a mouse.)

So the problem isn't that big.

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Ron Parker wrote:

> On Thu, 09 Mar 2000 23:00:07 +0100, Tor Olav Kristensen wrote:
> >
> >Ron Parker wrote:
>
> >> #declare MyArray[25*X+5*Y+Z][Colour.r] = MyArray[25*X+5*Y+Z][Colour.r] + 1;
> >
> >How about making the editor do the re-typing for the lazy ones?
>
> Because that's just ugly (we don't ALL use the editor built-in to POV for
> Windows, you know) and in any case it just puts off the problems inherent
> in the line above until you come back to maintain it later.
>
> --
> These are my opinions.  I do NOT speak for the POV-Team.
> The superpatch: http://www2.fwi.com/~parkerr/superpatch/
> My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Sebastian Strand
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:19:53
Message: <38c82389@news.povray.org>
> new POV-script I am thinking of is fully backwards compatible i.e. you
should
> still be able to just describe a scene in no particular order, just as you
> always have. Some OO-features will hopefully be possible, but you will not
> have to write #declare MySphere1 = new sphere(<0,0,0>, new size(0.5), new
> texture(new pigment(color new vector(<1,1,1>)))));  [...] you should be
able to
> access the attributes of the objects in the scene, for example: #declare
> camera.location = MySphere1.location - <0,0,5>;

These are exactly the kind of modifications/additions I would like to see
too. Not being able to access the location / other properties of an object
without saving it to a variable is a major inconvenience. Each object could
have a name property, so when declaring you would do something like
sphere {
    <0, 0, 0>, 1
     name "Sphere 1"
}

and the sphere could then be accessed like
Sphere1.texture = texture { texWood }
Sphere1.translate(<0, 0, 10>)

A thing that would be very useful would be to be able to add your own
methods and properties to an object, like:
Sphere1.AddMethod("Spin", "vecRot")
Sphere1.Spin = function {
    #local vecPos = Me.position
    Me.translate(-vecPos)
    Me.rotate(vecRot)
    Me.translate(vecPos)
}

Sphere1.Spin(<0, 90, 0>)

This would not interfere with 'normal' pov scripting, but would really make
pov very versatile for advanced users. I do program as a hobby though, so I
don't know what non-programmers might think.

Just my two Finnish "penni"...








Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:43:22
Message: <chrishuff_99-6AAACE.17450909032000@news.povray.org>
In article <38C82261.6B18E224@hotmail.com>, Tor Olav Kristensen 
<tor### [at] hotmailcom> wrote:

> If you use an editor with copy and paste features,
> I would guess that the maximum number of extra
> keystrokes you would have to do is about 7 or 8.
> (Or even fewer if you use a mouse.)
> 
> So the problem isn't that big.

Umm, maybe you haven't noticed, but POV is available for many different 
platforms. Many people don't use the built in editor, and some versions 
don't have one. Relying on copy and paste or other editor features is a 
poor solution, and only fixes half of the problem(the time it takes to 
type things in).

Which looks more readable? This:
#declare MyArray[25*X+5*Y+Z][Colour.red] = 
MyArray[25*X+5*Y+Z][Colour.red] + 1;
or this:
#declare MyArray[25*X+5*Y+Z][Colour.red] += 1;
? If you are going back to code that was written by someone else or 
which you haven't used in a while, or even which you wrote yesterday, 
this type of thing can save a lot of time debugging.

BTW, another potentially useful operator is ^ for "to the power of". I 
have written a patch which allows this, it seems to work 
perfectly(although it hasn't been heavily tested). Maybe it will be 
included in MegaPOV sometime...

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: David Curtis
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:50:50
Message: <38c82aca@news.povray.org>
For me the greatest addition would be a switch/case statement, like this:

#switch (some_variable)
    #case int, float, vector, ...
    #end
#end
--
Dave.
mic### [at] sympaticoca
Nieminen Juha <war### [at] sarakerttunencstutfi> wrote in message
news:38c7c815@news.povray.org...
> PoD <pod### [at] globalfreewaycomau> wrote:
> :   for( I=1; I <= 5; I=I+1){...}
>
>   I think that a more povray-type syntax would be:
>
> #for(I=1; I<=5; I++)
>   ...
> #end
>
>   Of course this can be done with a #while-loop, but this kind of shortcut
> just makes life easier.
>   I would also like to see this:
>
> #do
>   ...
> #until(whatever)
>
>   I have at least once needed this kind of feature. With the regular
#while
> loop I had to write the body of the loop twice.
>
>   And this I have suggested before:
>
> #declare A += B;
> #declare A -= B;
> #declare A *= B;
> #declare A /= B;
> etc...
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Rune
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:52:28
Message: <38c82b2c@news.povray.org>
"Josh English" wrote:
> This is what I'm looking for. I'm no programmer either, but if you ever
publish
> anyhting on it please post it here or let me know (yeah, that's asking a
lot, I
> realize) but this is exactly the kind of thing I would want POV-Ray to be
able to
> do.

Me too! :-)

Greetings,

Rune

---
Updated January 24: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 18:19:04
Message: <chrishuff_99-90BDDE.18205009032000@news.povray.org>
In article <38c82aca@news.povray.org>, "David Curtis" 
<spa### [at] junkmailcom> wrote:

> For me the greatest addition would be a switch/case statement, like this:
> 
> #switch (some_variable)
>     #case int, float, vector, ...
>     #end
> #end

You mean like this? :-)
Straight from the manual:

"4.2.6.3  The #switch, #case, #range and #break Directives

A more powerful conditional is the #switch  directive. The syntax is as 
follows...

SWITCH_DIRECTIVE:
#switch (   Switch_Value  )   SWITCH_CLAUSE...  [#else   TOKENS...] #end

SWITCH_CLAUSE:
#case(   Case_Value  )  TOKENS...  [#break ] |
#range(   Low_Value  ,  High_Value  )  TOKENS...  [#break ]"

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: David Curtis
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 18:44:42
Message: <38c8376a@news.povray.org>
Chris Huff <chr### [at] yahoocom> wrote in message
news:chrishuff_99-90BDDE.18205009032000@news.povray.org...
>
> You mean like this? :-)
> Straight from the manual:
>
> "4.2.6.3  The #switch, #case, #range and #break Directives
>
> A more powerful conditional is the #switch  directive. The syntax is as
> follows...
>

Doh! You know, I've sat down numerous times with the intention of reading
througth the manual. But as is always the case I find something I "just
gotta try".

Thanks.

--
Dave.
mic### [at] sympaticoca


Post a reply to this message

From: Bob Hughes
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 18:51:31
Message: <38c83903@news.povray.org>
Yep, I almost mentioned that but I'm clinging to the anti-programming side so
wanted to try not making it seem as plausible.  I'm bad, I know... sorry  ;-)

Bob

"Sebastian Strand" <the### [at] bigfootcom> wrote in message
news:38c7dcbf$1@news.povray.org...
|
| > |   for I = 1 to 5 {...}
| >
| > This one isn't feasible since the increment isn't changeable, as written
| anyhow.
|
| In Visual Basic this is done like so:
|
| For i = 1 To 5 Step 3
| ...
| Next i
|





|
|
|
|
|


Post a reply to this message

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

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