 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi all,
I know, when #declaring a mesh, it is only loaded only once, so you can
use many instances of it, without running out of memory.
Why isn't this possible with all objects, like a union of 10000 cones for
example?
Maybe there is already a patch out there wich implements this and I just
don't know?
Lutz-Peter
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 18 May 2001 14:05:28
Message: <3b056468@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <MPG.156f6f504b27c9c29896b3@news.povray.org> , Lutz-Peter Hooge
<lpv### [at] gmx de> wrote:
> I know, when #declaring a mesh, it is only loaded only once, so you can
> use many instances of it, without running out of memory.
> Why isn't this possible with all objects, like a union of 10000 cones for
> example?
Because it is an implementation feature of the mesh code, not the object
storage code. There are some side effects how render speed of some other
objects is improved that would be incompatible with such a method, so it is
non-trivial to implement.
> Maybe there is already a patch out there wich implements this and I just
> don't know?
I am not aware of any patch that can do this.
Thorsten
____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povray org
I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3b056468@news.povray.org>, tho### [at] trf de says...
> Because it is an implementation feature of the mesh code, not the object
> storage code. There are some side effects how render speed of some other
> objects is improved that would be incompatible with such a method, so it is
> non-trivial to implement.
Too bad :-( It would be a very useful feature for making large amounts of
plants etc.
What does "non-trivial" mean? Thats it's not possible in, say, 3 hours,
or a day, or two, or so? Or that it is (nearly) impossible?
Lutz-Peter
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 18 May 2001 17:56:11
Message: <3b059a7b@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <MPG.156fade524e59e4a9896b5@news.povray.org> , Lutz-Peter Hooge
<lpv### [at] gmx de> wrote:
> What does "non-trivial" mean? Thats it's not possible in, say, 3 hours,
> or a day, or two, or so? Or that it is (nearly) impossible?
More than a week to get it into a working state, plus a few month of testing
because it would change something in almost every object, the parser, etc...
Thorsten
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Wlodzimierz ABX Skiba
Subject: Re: #declares and memory management
Date: 21 May 2001 06:13:49
Message: <3b08ea5d@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Lutz-Peter Hooge wrote in message ...
> I know, when #declaring a mesh, it is only loaded only once, so you can
> use many instances of it, without running out of memory.
> Why isn't this possible with all objects, like a union of 10000 cones for
> example?
Becouse you can treat set of triangles as property of object as well as radius
and center for sphere or normal and distance for plane.
Look at summary of sphere definition in megapov 0.7;
- pointers
(Methods,Sibling,Texture,Interior,Interior,Bound,Clip,UV_Trans,Label,Interior_Te
xture,glowList,Trans
- ints (Type,Ph_Flags,No_Shadow_Group, Light_Group,Flags,TimeStamp)
- sngl (BBOX,Ph_Density)
- dbl (Radius,Center)
you can save space for radius where you copy object{MySphere OBJECT_MODS} but
nearly all other properities you reserve for child becouse they can be
overwritten.
this way you get another level of abstract but instead of 4 dbl you must
remember pointer to parent - is it worth ?
--
#macro Sig(A,B,X)_(A,B)_(B,X)_(X,A)#end#macro _(A,B)cylinder{<A.x,A.y,3>,<B.u,
B.v,3>.1,9}#end global_settings{max_trace_level 9}light_source{0 1}camera{up y
*4right-3*x}blob{_(<3,1>,<1,-5>)_(<2,-2>,<4,-2>)Sig(x,<-1,1.5>,<1,3>)_(z-1,z-4
)pigment{rgb 1}}box{-3 3pigment{rgb 0}finish{reflection 1}hollow} // POV-Ray31
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Christoph Hormann
Subject: Re: #declares and memory management
Date: 21 May 2001 07:22:17
Message: <3B08FAAA.71D1F86D@gmx.de>
|
|
 |
|  |
|  |
|
 |
Wlodzimierz ABX Skiba wrote:
>
> [...]
>
> this way you get another level of abstract but instead of 4 dbl you must
> remember pointer to parent - is it worth ?
>
Probably not in this case, but for a complex CSG it could be useful, just
imagine a lot of macro generated trees...
I know this is probably quite difficult to implement, but NTL it would
offer interesting possibilities.
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Lutz-Peter Hooge <lpv### [at] gmx de> wrote:
: Why isn't this possible with all objects, like a union of 10000 cones for
: example?
Most objects are optimized when certain transformations are applied to
them (in order to eliminate those transformations).
For example, if you have this:
#declare MySphere = sphere { 0,1 }
object { MySphere scale 10 translate x*20 }
object { Mysphere translate -x*20 }
the result will be internally exactly the same as if you had written:
sphere { x*20, 10 }
sphere { -x*20, 1 }
The idea is to eliminate the transformations where possible and thus
speed up the rendering. When the ray doesn't have to be transformed, the
intersection test will be faster.
This same optimization is applied to objects inside CSG groups.
This is why declared CSG groups can't be used as they are, but they have
to be copied in order to perform the optimizations to the copy.
This is what I have understood. I might be wrong in some details.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Wlodzimierz ABX Skiba
Subject: Re: #declares and memory management
Date: 21 May 2001 08:00:10
Message: <3b09034a@news.povray.org>
|
|
 |
|  |
|  |
|
 |
> Wlodzimierz ABX Skiba wrote:
> >
> > [...]
> >
> > this way you get another level of abstract but instead of 4 dbl you must
> > remember pointer to parent - is it worth ?
>
> Probably not in this case, but for a complex CSG it could be useful, just
> imagine a lot of macro generated trees...
I know adventages of this and even curently play with such macros but I think
(it's only personal opinion) that this support in current state of povray is not
worth at level of every object but perhaps it is worth at level of CSG engine.
> I know this is probably quite difficult to implement, but NTL it would
> offer interesting possibilities.
I just had idea that there could be another kind of object named Clone which
remember only transform and base object. Well... I'll try and check this.
Perhaps whole forest could fit into cache of processor ;)
--
#macro Sig(A,B,X)_(A,B)_(B,X)_(X,A)#end#macro _(A,B)cylinder{<A.x,A.y,3>,<B.u,
B.v,3>.1,9}#end global_settings{max_trace_level 9}light_source{0 1}camera{up y
*4right-3*x}blob{_(<3,1>,<1,-5>)_(<2,-2>,<4,-2>)Sig(x,<-1,1.5>,<1,3>)_(z-1,z-4
)pigment{rgb 1}}box{-3 3pigment{rgb 0}finish{reflection 1}hollow} // POV-Ray31
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Christoph Hormann
Subject: Re: #declares and memory management
Date: 21 May 2001 08:18:16
Message: <3B0907CB.80D50255@gmx.de>
|
|
 |
|  |
|  |
|
 |
Wlodzimierz ABX Skiba wrote:
>
> [...]
>
> I just had idea that there could be another kind of object named Clone which
> remember only transform and base object. Well... I'll try and check this.
> Perhaps whole forest could fit into cache of processor ;)
>
Just about what i thought of, i only would use 'reference' rather than
'clone', because a clone is actually a real copy of the original.
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3b059a7b@news.povray.org>, tho### [at] trf de says...
> More than a week to get it into a working state, plus a few month of testing
> because it would change something in almost every object, the parser, etc...
Then it would probably not make much sense to start working on this
before 3.5 is available...
Lutz-Peter
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3B08FAAA.71D1F86D@gmx.de>, chr### [at] gmx de says...
> Probably not in this case, but for a complex CSG it could be useful, just
> imagine a lot of macro generated trees...
That is what I thought of.
You can generate a couple of braches, from this a couple of trees and
from these a wood... this is only possible when reusing existing objects,
otherwise memory requirements would be far too high.
(last winter I upgraded to 256 MB just to be able to render a single
christmas tree :-))
Lutz-Peter
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I just read about this in an article about how they did some plants for
Shrek. They copied a base object multiple times, and only transformed it in
various ways. Also, for the trees, the leaves are generated by random number
sequences and applied/tesselated only in the renderer, thus the trees use
very little memory. They're meshes of course, but I don't see why this can't
work for all objects. I can't wait till I learn to program...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tony[B] <ben### [at] catholic org> wrote:
: I can't wait till I learn to program...
You sound like you expect to learn to program C in a couple of weeks and
go right away and modify the POV-Ray source code.
Learning programming in such an extent that you are able to easily and
nicely modify a program like POV-Ray requires years of programming
experience (preferably from good sources of information).
Many novice programmers have the funny misconception that they just
learn how to write programs with a programming language and they can
just right away write a Quake clone from the scratch.
Programming is just a tool. Knowing the syntax of a programming language
doesn't give you automatically the knowledge to make big programs.
It's comparable to knowing how to write mathematical formulas and think
that you could right away deduce the Maxwell equations from basic mathematical
and physical axioms. Or that you could write a best-seller book because you
know how to write english.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 22 May 2001 08:54:16
Message: <3b0a6178@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <3b0a49fc@news.povray.org> , Warp <war### [at] tag povray org> wrote:
> Many novice programmers have the funny misconception that they just
> learn how to write programs with a programming language and they can
> just right away write a Quake clone from the scratch.
> Programming is just a tool. Knowing the syntax of a programming language
> doesn't give you automatically the knowledge to make big programs.
I agree with all you said, but you didn't provide much help :-)
And C/C++ is a very advanced tool. It is not the best way to learn
programming this way, especially if you just want to do it for fun or as a
hobby. As you say, there is far more to programming than just learning the
syntax. You need to learn how to put your ideas into a certain structure,
from an abstract idea into a practical implementation. This is the hardest
to learn, and even after years you will continue learn more. C/C++ will not
give you a fast start with this because it allows far more freedom than any
beginner can comprehend without experience. This is in particular true when
it comes to debugging.
I don't want to suggest Basic because the main thing out there is Visual
Basic and it has little to do with the original idea of Basic (to be easy to
learn and use by novice programmers). While a classical late 1980s
home-computer basic interpreter would probably be best, the hardware is a
bit outdated...
Pascal is still one of the most viable alternatives, and for PCs Borland's
Turbo Pascal (especially the DOS version) has easy and fast integration of
graphics. As a language it is much "cleaner" than C/C++, and it enforces
more structure and structured thinking about a program. On the other hand
it is fully compiled and as fast as C/C++, but easier to learn and debug,
especially without a human tutor. Regarding books and other information,
there should be plenty in your local library. Especially good books about
C/C++ are very expensive and hard to find in libraries...
Last but not least, as Warp said, the programming language is just a "tool",
and if you know how to use one tool it is very easy to learn how to use
another. For learning how to use a class of tools you should really not
pick the most advanced tool out there - it will be a lot of frustration and
very little "fun" if you do so!
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>You sound like you expect to
>learn to program C in a couple
>of weeks and go right away and
>modify the POV-Ray source code.
That's more-or-less the plan. :)
<snip>
Thank you for taking the time to tell me this, Warp. I'm quite aware of it.
I just feel this urgency to learn the syntax so I can at least start
understanding the POV source. I know it won't be instant, but I will
understand little by little, right. And the sooner I get it, the sooner I
can help. I really do want to help make POV a better program. It's already
great, but has much room for improvement.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Tue, 22 May 2001 08:13:01 -0600, Tony[B] wrote:
>I just feel this urgency to learn the syntax so I can at least start
>understanding the POV source.
The syntax is the easy part. You could probably understand the syntax now,
given that you understand POV-script and can cope with some of the other
ideas that have been bounced around in places like this group (access to
members, for loops, etc.) But knowing the syntax is only a very small part
of understanding the POV source code. Knowing the basic raytracing
algorithm is a big part, and knowing how stuff is laid out internally
(especially tokenize.c, parse.c, and parse.h) is a very big part.
>can help. I really do want to help make POV a better program. It's already
>great, but has much room for improvement.
Heretic! :)
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 22 May 2001 07:14:05 -0400, Warp <war### [at] tag povray org> wrote:
> It's comparable to knowing how to write mathematical formulas and think
>that you could right away deduce the Maxwell equations from basic mathematical
>and physical axioms.
Hehehe™ I remember had to do just that four years ago :) And Kirchov's
laws, too.
>Or that you could write a best-seller book because you
>know how to write english.
^^^^^^^
No bestsellers from you yet, eh, Warp? :)))
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tony[B] <ben### [at] catholic org> wrote:
: Thank you for taking the time to tell me this, Warp. I'm quite aware of it.
: I just feel this urgency to learn the syntax so I can at least start
: understanding the POV source. I know it won't be instant, but I will
: understand little by little, right. And the sooner I get it, the sooner I
: can help. I really do want to help make POV a better program. It's already
: great, but has much room for improvement.
As Ron said, it may not be as easy as that.
Until you have the years of programming experience needed for this,
perhaps the best way is to just suggest your ideas to someone who knows
POV-Ray source code well and ask if he could do it.
Knowing the inner workings of POV-Ray (even if you don't know how to
program it) can be of great help when suggesting ideas because this way
you already know the possibilities and limitations (and possible work-arounds
for them) when you suggest the idea.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Peter Popov <pet### [at] vip bg> wrote:
:>Or that you could write a best-seller book because you
:>know how to write english.
: ^^^^^^^
: No bestsellers from you yet, eh, Warp? :)))
You mean it should be "English"?
I always get confused because in Finnish language names are written with
lowercase letter (country names with capital letter, as in English). For
example Finland (as a country) is written in Finnish as "Suomi", but
Finnish (as language) is written "suomi" ("Finnish language" would be
"suomen kieli").
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 22 May 2001 11:38:39 -0400, Warp wrote:
> Until you have the years of programming experience needed for this,
>perhaps the best way is to just suggest your ideas to someone who knows
>POV-Ray source code well and ask if he could do it.
Nah, the best way is to find someone on IRC or AIM or ICQ or whatever who
does know the innards but might not have the time to actually do it, and
ask for advice whenever you get stuck. That's how some of what's in MegaPOV
and soon POV 3.5 got written.
It also helps to have that person, or another person, check over what you've
done an look for gotchas afterward. Getting someone to do it for you is
a good way to never learn anything.
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 22 May 2001 11:45:08 -0400, Ron Parker wrote:
>On 22 May 2001 11:38:39 -0400, Warp wrote:
>> Until you have the years of programming experience needed for this,
>>perhaps the best way is to just suggest your ideas to someone who knows
>>POV-Ray source code well and ask if he could do it.
>
>Nah, the best way is to find someone on IRC or AIM or ICQ or whatever who
Somewhat related to that, I can be found on AIM as parkrrrr just about any
time.
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ron Parker <ron### [at] povray org> wrote:
: Nah, the best way is to find someone on IRC or AIM or ICQ or whatever who
: does know the innards but might not have the time to actually do it, and
: ask for advice whenever you get stuck. That's how some of what's in MegaPOV
: and soon POV 3.5 got written.
On the other hand, teaching POV-Ray patching to someone who has never
programmed before can be a much more laborious job than making the patch
yourself, so it'll be necessary to find someone who is really willing to teach
all that much... :)
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 22 May 2001 11:51:58 -0400, Warp wrote:
>Ron Parker <ron### [at] povray org> wrote:
>: Nah, the best way is to find someone on IRC or AIM or ICQ or whatever who
>: does know the innards but might not have the time to actually do it, and
>: ask for advice whenever you get stuck. That's how some of what's in MegaPOV
>: and soon POV 3.5 got written.
>
> On the other hand, teaching POV-Ray patching to someone who has never
>programmed before can be a much more laborious job than making the patch
>yourself, so it'll be necessary to find someone who is really willing to teach
>all that much... :)
That's sorta why I posted my AIM nickname. It certainly wouldn't be the
first time I've done that sort of teaching.
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 22 May 2001 11:42:59 -0400, Warp <war### [at] tag povray org> wrote:
> You mean it should be "English"?
> I always get confused because in Finnish language names are written with
>lowercase letter (country names with capital letter, as in English). For
>example Finland (as a country) is written in Finnish as "Suomi", but
>Finnish (as language) is written "suomi" ("Finnish language" would be
>"suomen kieli").
Same in Bulgarian. However, I always capitalize the name of the nation
I belong to and the language of my ancestors, regardless of the
language I write in. It has cost me points in the past, but ****, I
kept doing it anyway :)
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> The syntax is the easy part. Knowing the syntax is only a very small part
> of understanding the POV source code. Knowing the basic raytracing
> algorithm is a big part, and knowing how stuff is laid out internally
> (especially tokenize.c, parse.c, and parse.h) is a very big part.
I'll learn. :) Just let me get started somewhere... It almost sounds to me
like Warp is saying I just can't do this... or like I need years and years
to do it... Can't I at least get in the swing in a few months? I won't do
any magic, but I'll do something. That's what I mean to do. I just want to
help.
> >can help. I really do want to help make POV a better program. It's
already
> >great, but has much room for improvement.
>
> Heretic! :)
May the POV gods strike me dead if I'm blaspheming! ;)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> Until you have the years of programming experience needed for this,
> perhaps the best way is to just suggest your ideas to someone who knows
> POV-Ray source code well and ask if he could do it.
But I don't want to just be a passive idea-box. I want to get in there and
do some of this myself. I don't want to be remembered as "the guy who
suggested blinn shading to Nathan Kopp and gave him the link to the places
where it was explained" or anything else like that. I want a
patch/improvement I can call my own. :) And I don't want to wait a few years
to get started. I'd rather get my hands dirty quick and learn like that.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> Somewhat related to that, I can be found
> on AIM as parkrrrr just about any time.
What if I'm on ICQ? How can I contact you then? Is there any way I could
have the best of both worlds? (Maybe this one should go to off-topic?)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Tony[B]" wrote:
>
> > The syntax is the easy part. Knowing the syntax is only a very small part
> > of understanding the POV source code. Knowing the basic raytracing
> > algorithm is a big part, and knowing how stuff is laid out internally
> > (especially tokenize.c, parse.c, and parse.h) is a very big part.
>
> I'll learn. :) Just let me get started somewhere... It almost sounds to me
> like Warp is saying I just can't do this... or like I need years and years
> to do it... Can't I at least get in the swing in a few months? I won't do
> any magic, but I'll do something. That's what I mean to do. I just want to
> help.
I seem to recall Chris H. started doing patches not so long ago and with
little to no C or C++ experience. If Chris can do it so can you.
I say give it a shot. The worse you can do is compile something that won't
work and even if you fail you will learn a lot in the process.
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Thu, 24 May 2001 22:27:13 -0600, Tony[B] wrote:
>> Until you have the years of programming experience needed for this,
>> perhaps the best way is to just suggest your ideas to someone who knows
>> POV-Ray source code well and ask if he could do it.
>
>But I don't want to just be a passive idea-box. I want to get in there and
>do some of this myself. I don't want to be remembered as "the guy who
>suggested blinn shading to Nathan Kopp and gave him the link to the places
>where it was explained" or anything else like that.
Are you saying there's something wrong with being "the guy who suggested
photon mapping to Nathan Kopp and gave him..." oh never mind.
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
ben### [at] catholic org (Tony[B]) wrote in <3b0dd0c5@news.povray.org>:
>May the POV gods strike me dead if I'm blaspheming! ;)
*bzap*
You have been struck by lightening.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tony[B] <ben### [at] catholic org> wrote:
: I'll learn. :) Just let me get started somewhere... It almost sounds to me
: like Warp is saying I just can't do this... or like I need years and years
: to do it...
I didn't say that you absolutely can't do it, period. I said that being
able to patch povray smoothly and nicely requires years of programming
experience. Making efficient and good-quality programs is not something you
learn in a couple of months.
Of course you can achieve something that works in a rather short time if
you just keep working and studying, but to be sincere, I doubt that the
result will be the most efficient and high-quality possible.
It can be a good way of learning, although I think that smaller projects
could be better at the beginning.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tony[B] <ben### [at] catholic org> wrote:
:> Until you have the years of programming experience needed for this,
: But I don't want to just be a passive idea-box.
Read my "until" phrase again... :)
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Christoph Hormann
Subject: Re: #declares and memory management
Date: 25 May 2001 07:55:25
Message: <3B0E4863.4D55F28E@gmx.de>
|
|
 |
|  |
|  |
|
 |
"Tony[B]" wrote:
>
> I'll learn. :) Just let me get started somewhere... It almost sounds to me
> like Warp is saying I just can't do this... or like I need years and years
> to do it... Can't I at least get in the swing in a few months? I won't do
> any magic, but I'll do something. That's what I mean to do. I just want to
> help.
>
Just my not so important opinion:
I think the best way to learn how the povray source code works is to deal
with it, you even don't have to actually write a patch, just analyzing
things and studying previously made patches can give great insights.
The first attempts to writing patches will probably always be quite clumsy
and for someone else who wants to extend them or incorporate them into his
own patch it will probably often be easier to just rewrite it from scratch
(that's about how i would judge my own attempts in that direction too).
NTL, you will learn a lot, have (more or less :) fun and possibly help to
introduce some nice new features into POV - what do you want more?
So just get the source code, a good Editor, some good C programming
reference/book and give it a try...
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Christoph Hormann <chr### [at] gmx de> wrote:
: So just get the source code, a good Editor, some good C programming
: reference/book and give it a try...
I personally still think that it would be better to first get
accustomed with programming (that is, you don't need to search in a book
what was the syntax of a function or a for-loop) and get some experience
before trying to handle a huge program. Better start with small programs
(like a program which prints all prime numbers between 1 and 1000 and such),
then write a bit bigger ones before even trying to patch a huge program.
It will save a lot of time in the long run and the patch will probably be
much better and efficient. If you start coding the patch from the scratch,
with no experience at all, you'll probably make things in 50 lines which
could be made in 5 lines much more efficiently and with a lot less trouble and
work.
Of course this is only my opinion.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Christoph Hormann
Subject: Re: #declares and memory management
Date: 25 May 2001 09:48:05
Message: <3B0E62CB.141CDEFA@gmx.de>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> I personally still think that it would be better to first get
> accustomed with programming (that is, you don't need to search in a book
> what was the syntax of a function or a for-loop) and get some experience
> before trying to handle a huge program. Better start with small programs
> (like a program which prints all prime numbers between 1 and 1000 and such),
> then write a bit bigger ones before even trying to patch a huge program.
> It will save a lot of time in the long run and the patch will probably be
> much better and efficient. If you start coding the patch from the scratch,
> with no experience at all, you'll probably make things in 50 lines which
> could be made in 5 lines much more efficiently and with a lot less trouble and
> work.
Therefore i suggested studying things before. I never learned programming
systematically (apart from some Basic at school) and i think i learned
most about programming by studying others' code. Some things of course
also require reading of books, but IMO that is usually an automatic
reaction when looking at the code and not understanding things (unless
there are some friendly Povers in range you can ask :-)
Learning programming systematically by reading books and doing programming
exercises is of course not bad either, but it can be quite frustrating and
it does not train you to understand code written by others.
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 25 May 2001 10:17:02
Message: <3b0e695e@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <3B0E4863.4D55F28E@gmx.de> , Christoph Hormann
<chr### [at] gmx de> wrote:
> The first attempts to writing patches will probably always be quite clumsy
> and for someone else who wants to extend them or incorporate them into his
> own patch it will probably often be easier to just rewrite it from scratch
And this is a problem! Half of the patches in MegaPOV fall into this
category. Either a specific patch was a quick hack, done with little
consideration, or, some of the bigger patches were reasonably well
implemented, but never finished, debugged, cleaned up or at least commented.
It is always harder to fix code written by someone else, and it is close to
impossible if the code is not commented and implements an unknown algorithm
(because neither code nor comments tell you anything about it). Not to
mention that it takes an awful lot of time. And so I continue to look into
the 'parametric' object code which refuses to work in 3.5...
Thorsten
____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povray org
I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 25 May 2001 10:34:00
Message: <3b0e6d58@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <3b0e529c@news.povray.org> , Warp <war### [at] tag povray org> wrote:
> I personally still think that it would be better to first get
> accustomed with programming (that is, you don't need to search in a book
> what was the syntax of a function or a for-loop) and get some experience
> before trying to handle a huge program. Better start with small programs
> (like a program which prints all prime numbers between 1 and 1000 and such),
> then write a bit bigger ones before even trying to patch a huge program.
> It will save a lot of time in the long run and the patch will probably be
> much better and efficient. If you start coding the patch from the scratch,
> with no experience at all, you'll probably make things in 50 lines which
> could be made in 5 lines much more efficiently and with a lot less trouble and
> work.
I completely agree with you!
I still have tons of such code in my mailbox from people (8-10 of about 30)
who took an intro to data structures class (I was the teaching assistant)
and came up with 82 lines and three while-loops (in C) to reverse a doubly
linked list. Then there are the "better" solutions that need one while-loop
and a function that returns the nth element (a second while-loop). And this
in university (first year of course) so they were at least told what is
wrong with their code...
I don't want to discourage anybody. You just should know that nobody can
learn programming in a day, week or even year. The syntax (0.1%), yes, but
there is a lot more behind it (99.9%). After five or ten years there will
still be things left to learn!
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3B0E62CB.141CDEFA@gmx.de> , Christoph Hormann
<chr### [at] gmx de> wrote:
> Therefore i suggested studying things before. I never learned programming
> systematically (apart from some Basic at school) and i think i learned
> most about programming by studying others' code. Some things of course
> also require reading of books, but IMO that is usually an automatic
> reaction when looking at the code and not understanding things (unless
> there are some friendly Povers in range you can ask :-)
This is very true. Reading other code speeds up learning, and in fact that
is how I started (and still learn i.e. how to use some API), too.
Nevertheless, it is much easier with Basic than with C. Further, studying
small examples help, but studying a big piece of code like POV-Ray, with all
the complex interactions and side effects you have to think about takes much
longer than learning from small examples. Also, the POV-Ray source code is
not the ideal code in many ways - it developed over years, and many of its
tricks and tweaks would never be used in a rewrite because they are simply
far, far away from being ideal.
> Learning programming systematically by reading books and doing programming
> exercises is of course not bad either, but it can be quite frustrating and
> it does not train you to understand code written by others.
I think this really depends on the book. There are a lot of bad books out
there (i.e. 1000+x books about Java, but only four or five are good) and
picking the right one can be very hard, even for someone who knows the stuff
already and "only" has to pick for a book others!
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thorsten Froehlich <tho### [at] trf de> wrote:
: I still have tons of such code in my mailbox from people (8-10 of about 30)
: who took an intro to data structures class (I was the teaching assistant)
: and came up with 82 lines and three while-loops (in C) to reverse a doubly
: linked list. Then there are the "better" solutions that need one while-loop
: and a function that returns the nth element (a second while-loop). And this
: in university (first year of course) so they were at least told what is
: wrong with their code...
This is exactly what I meant.
I don't think it's a very good idea to hurry too much. I know that the
idea of making a POV-Ray patch is exciting, but in the long run too much
hurry causes more problems than it's worth.
If the goal is to learn programming, there are much better ways of doing
it than go straight to POV-Ray source code and try to understand it. POV-Ray
is huge and made by many people and it uses very complicated algorithms
which are not easy to understand. Trying to deal with all this in a state
where you are still trying to remember how to write a function can be just
too much.
Of course you can try if you want. Who am I to stop you anyways? I'm just
trying to give advice based on my own experience.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thorsten Froehlich wrote:
> I don't want to discourage anybody. You just should know that nobody can
> learn programming in a day, week or even year. The syntax (0.1%), yes, but
> there is a lot more behind it (99.9%). After five or ten years there will
> still be things left to learn!
Sounds a lot like POV-Ray to me :)
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
> I seem to recall Chris H. started doing patches not so long ago and with
> little to no C or C++ experience. If Chris can do it so can you.
This is true, when I started patching, my only C experience was from a
C++ course, not even a very good one: "Learn C++ in 21 Days".
Someone, I think it was Michael Paul (who wrote the angle-dependant
reflection patch and maintained WyzPOV) or Ron Parker helped me get
started by explaining how to write a simple pattern patch, from there,
I just worked by looking at existing source code and copying from it.
I wrote a simple tutorial, a draft version of which is in the
povray.binaries.tutorials group, which may be useful, though it is
only for patching the official version...the changes needed to modify
MegaPOV shouldn't be difficult to figure out, though.
--
Christopher James Huff - chr### [at] mac com
Home Page: http://homepage.mac.com/chrishuff/
POV-Ray TAG e-mail: chr### [at] povray org
POV-Ray TAG web site: http://tag.povray.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thank you for your support Ken! :)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
See, I get in, make a messy patch, and then hand it over to other POV
programmers who can clean it up. The idea is to get the ball rolling. :)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> If you start coding the patch from the scratch,
> with no experience at all, you'll probably make things in 50 lines which
> could be made in 5 lines much more efficiently and with a lot less trouble
and
> work.
I plan to finish reading the book for my class before even looking at the
POV-Ray sources. I can compile a one *.C file with a few *.H files in the
mix, but I haven't the foggiest about multiple *.C file programs. I'll get
to it when I feel up to the task. I know I won't make the greatest or most
efficient program, but I'll give it a try at least. My book includes some
excellent examples, including a big (1000+) line program that you work
through chapter by chapter at the end of each. It's for controlling an
elevator. Very interesting problem. Much more complex than it seems at the
beginning. My book also has tons of little tips strewn throughout from a
performance perspective (speed) and a software-engineering perspective
(reusability/portability). I like this book. I trust I'll learn a lot from
it. I respect your opinion, but I think I'll do it my way. OK? :)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thank you for your support as well! :)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tony[B] <ben### [at] catholic org> wrote:
: See, I get in, make a messy patch, and then hand it over to other POV
: programmers who can clean it up. The idea is to get the ball rolling. :)
And cause a lot more work than necessary?
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 27 May 2001 14:18:18
Message: <3b1144ea@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <3b111b5e@news.povray.org> , Warp <war### [at] tag povray org> wrote:
> : See, I get in, make a messy patch, and then hand it over to other POV
> : programmers who can clean it up. The idea is to get the ball rolling. :)
>
> And cause a lot more work than necessary?
It only causes more work if the person supposed to clean it up does not know
about implementation problems or they are not obvious. If just the same
idea is implemented by writing new code no additional work needs to be done
:-)
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tony[B] wrote in message <3b11138f@news.povray.org>...
>See, I get in, make a messy patch, and then hand it over to other POV
>programmers who can clean it up. The idea is to get the ball rolling. :)
You mean, like the spline{} patch in MegaPOV? The code for that is a mess.
Splines are limited to 256 entries, the "cubic splines" are actually an
average of two quadratic splines, none of the code is commented, and in
general, the whole thing needs to be re-written from scratch.
--
Mark
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 28 May 2001 03:22:27
Message: <3b11fcb3@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <3b11d751$1@news.povray.org> , "Mark Wagner"
<mar### [at] gte net> wrote:
> You mean, like the spline{} patch in MegaPOV? The code for that is a mess.
> Splines are limited to 256 entries, the "cubic splines" are actually an
> average of two quadratic splines, none of the code is commented, and in
> general, the whole thing needs to be re-written from scratch.
A limit of 256 entries? Good to know, another bug to add to the list - I
guess the original author was not sure how to dynamically grow a block of
memory in C <sigh>
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3b11fcb3@news.povray.org>, "Thorsten Froehlich"
<tho### [at] trf de> wrote:
> A limit of 256 entries? Good to know, another bug to add to the list - I
> guess the original author was not sure how to dynamically grow a block of
> memory in C <sigh>
It actually looks like it was just not completely implemented...the
necessary changes were added later by others. I don't recall where the
changed versions were uploaded, but I thought they were included in the
last version of MegaPOV.
--
Christopher James Huff - chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |