![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi there,
Was wondering if there is a macro tutorial out there somewhere,
something else than the scene-language description of the povray
documentation.
Thanks!
--
------------------------------------------------------------------------
+47 90 62 71 78 DoD#2101, NIC#015, Ducati M600, PJ#006, OGM#007
azo### [at] dod no, "Do one thing every day that scares you." --Mary Schmich
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
: Was wondering if there is a macro tutorial out there somewhere,
: something else than the scene-language description of the povray
: documentation.
What do you mean by macro tutorial?
When you say "macro", do you mean how to use the #macro feature of POV-Ray,
or do you mean how to make throughoutly useful include files? (I think that
the term "macro" is widely used to refer to any pov-script utility although
it may not use any #macro declaration.)
--
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Nieminen Juha wrote:
>
> : Was wondering if there is a macro tutorial out there somewhere,
> : something else than the scene-language description of the povray
> : documentation.
>
> What do you mean by macro tutorial?
I personally do not know of any online tutorials on how to make a
POV-Ray macro and doubt anyone could really explain all of their
possibilities in depth.
When macros were first introduced Chris Colefax took a little
time to explain them to me and failed miserably - my fault not his.
In my opinion the best way to learn how macros work is by example.
On my web page you can download a .zip file that has many macros
with examples of how they are used. I would suggest you download
the file, take a look at how the macros are structured, how they
are used, and then try to write a very basic macro based on what
you learned. As you become more proficient with them you can get
more and more complicated with them.
Since most macros rely heavily on math operations your ability
to use them will vary with your math skills and your knowledge
of POV-Ray's built in functions. A basic knowledge of programming
wouldn't hurt either but it not entirely necessary - I am a
living example of that and have made a couple of useful macros
since they were introduced. Just learning how to use someone
else's macros will help you understand how they work.
The most important thing to learn about macros is that all they
really do is to pass parameters to functions used by POV-Ray and
make it easy for the person using the macro to quickly change
variables when needed. You can eliminate a lot of declared variables
commonly found in a .inc file by using a macro instead.
--
Ken Tyler - 1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <38949A61.505CEAC4@pacbell.net>, lin### [at] povray org
wrote:
>I personally do not know of any online tutorials on how to make a
>POV-Ray macro and doubt anyone could really explain all of their
>possibilities in depth.
As all of my tutorials, this one is very basic, but it does cover an
example macro. http://www.hoboes.com/html/NetLife/POV/Scripting/
Jerry
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Jerry wrote:
>
> In article <38949A61.505CEAC4@pacbell.net>, lin### [at] povray org
> wrote:
> >I personally do not know of any online tutorials on how to make a
> >POV-Ray macro and doubt anyone could really explain all of their
> >possibilities in depth.
>
> As all of my tutorials, this one is very basic, but it does cover an
> example macro. http://www.hoboes.com/html/NetLife/POV/Scripting/
>
> Jerry
It is descriptive enough that I will add it to the tutorials section
at http://www.povray.org/links
Thanks for making me aware of it.
--
Ken Tyler - 1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Jerry wrote:
>
> In article <38949A61.505CEAC4@pacbell.net>, lin### [at] povray org
> wrote:
> >I personally do not know of any online tutorials on how to make a
> >POV-Ray macro and doubt anyone could really explain all of their
> >possibilities in depth.
>
> As all of my tutorials, this one is very basic, but it does cover an
> example macro. http://www.hoboes.com/html/NetLife/POV/Scripting/
Nice one, thanks a lot. Just what I was looking for! ;-)
--
------------------------------------------------------------------------
+47 90 62 71 78 DoD#2101, NIC#015, Ducati M600, PJ#006, OGM#007
azo### [at] dod no, "Do one thing every day that scares you." --Mary Schmich
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Nieminen Juha wrote:
>
> : Was wondering if there is a macro tutorial out there somewhere,
> : something else than the scene-language description of the povray
> : documentation.
>
> What do you mean by macro tutorial?
Sorry for not being specific enough. I want to learn how to use and make
functions for automating tedious tasks in povray.
I've read the thread and will look up Jerry's page with the basic
tutorial.
> When you say "macro", do you mean how to use the #macro feature of POV-Ray,
> or do you mean how to make throughoutly useful include files?
Both, actually ;-)
> (I think that
> the term "macro" is widely used to refer to any pov-script utility although
> it may not use any #macro declaration.)
Well, true ... my question was ambigous, sorry again.
--
------------------------------------------------------------------------
+47 90 62 71 78 DoD#2101, NIC#015, Ducati M600, PJ#006, OGM#007
azo### [at] dod no, "Do one thing every day that scares you." --Mary Schmich
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Jerry's tutorial is good. If you want a short answer, I'll try to write
something:
If you have ever coded in C or C++, macros are like #defines which take
arguments. The general syntax is:
#macro MyMacro(argument1, argument2, argument3)
(some pov-script here)
#end
There can be any number of arguments. These can be used to generate the
pov-script. For example:
#macro WhiteSphere(Location, Radius)
sphere { Location, Radius pigment { rgb 1 } }
#end
Now if you write:
WhiteSphere(<1,2,3>, 4)
the povray parser will internally substitute with the following:
sphere { <1,2,3>, 4 pigment { rgb 1 } }
You could also use macros as functions. For example:
#macro Double(Var)
(Var)*2
#end
Now if you type something like:
#declare Radius = Double(3);
it will be the same as:
#declare Radius = (3)*2;
(Note the parentheses; guess why they are important?)
Sometimes one wants a kind of return value from a complex calculation.
It can be achieved like this:
#macro ComplexCalculation(A, B, C)
#local result = 0;
#while(A>0)
#local result = result + B*C;
#local A = A-1;
#end
result
#end
Note the last line which only has the identifier 'result' in it. It means
that the value of the whole macro will be the value of 'result' at the end
of the macro. Now you can use ComplexCalculation() as any other function.
(Ok, this is not a very short answer after all...)
--
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Nieminen Juha wrote:
>
> Jerry's tutorial is good. If you want a short answer, I'll try to write
> something:
[snip]
Great! Thanks, it made things a lot clearer! Now I just need to find
something nifty to use it for. ;-)
Cheers,
--
------------------------------------------------------------------------
+47 90 62 71 78 DoD#2101, NIC#015, Ducati M600, PJ#006, OGM#007
azo### [at] dod no, "Do one thing every day that scares you." --Mary Schmich
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |