Revision [594]

Last edited on 2009-09-05 15:30:15 by Scott Chitwood [remove files list]
Deletions:
{{files}}


Revision [593]

Edited on 2009-09-05 15:28:44 by Scott Chitwood [fix image links after 1.2 upgrade]
Additions:
An 18-page {{files download="Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="scripting_tutorial.zip" text="scripting_tutorial.zip"}}.
Deletions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.


Revision [588]

Edited on 2009-09-05 15:15:54 by Scott Chitwood [fix image links after 1.2 upgrade]
Additions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.
Deletions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.


Revision [587]

Edited on 2009-09-05 15:15:31 by Scott Chitwood [fix image links after 1.2 upgrade]
Additions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.
Deletions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.


Revision [586]

Edited on 2009-09-05 15:11:18 by Scott Chitwood [fix image links after 1.2 upgrade]
Additions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.
Deletions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.


Revision [585]

Edited on 2009-09-05 15:08:48 by Scott Chitwood [Reverting last edit by Scott Chitwood [584] to previous version [583]]
Additions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.
Deletions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip"}}.


Revision [584]

Edited on 2009-09-05 15:08:16 by Scott Chitwood [fix image links after 1.2 upgrade]
Additions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip"}}.
Deletions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.


Revision [583]

Edited on 2009-09-05 15:06:36 by Scott Chitwood [Reverting last edit by Scott Chitwood [582] to previous version [581]]
Additions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.
Deletions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files url="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip"}}.


Revision [582]

Edited on 2009-09-05 15:06:01 by Scott Chitwood [fix image links after 1.2 upgrade]
Additions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files url="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=scripting_tutorial.zip"}}.
Deletions:
An 18-page {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=Tutorial.pdf" text="scripting tutorial (PDF)"}} for Oxidizer written in late 2008 serves as the starting point for the current wiki page. This tutorial contained in addition to the documentation example genomes and example scripts, and the whole package can be downloaded here: {{files download="http://www.rampant-mac.com/wiki/wikka.php?wakka=GenomePage/files.xml&action=download&file=scripting_tutorial.zip" text="scripting_tutorial.zip"}}.


Revision [581]

Edited on 2009-09-05 15:01:49 by Scott Chitwood [fix image links after 1.2 upgrade]
Additions:
@@{{image url="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=OxiLuaChart_small2.jpg" link="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=OxiLuaChart.png" alt="OxiLuaChart_small.jpg" title="Oxidizer Lua implementation chart"}}@@@@Figure 2. Oxidizer Lua implementation (click on image for full-size version).@@----
Deletions:
@@{{image url="uploads/Scripting/OxiLuaChart_small2.jpg" link="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=OxiLuaChart.png" alt="OxiLuaChart_small.jpg" title="Oxidizer Lua implementation chart"}}@@@@Figure 2. Oxidizer Lua implementation (click on image for full-size version).@@----


Revision [580]

Edited on 2009-09-05 14:53:10 by Scott Chitwood [add files list to repair broken image links]
Additions:
{{files}}
Deletions:
{{file}}


Revision [579]

Edited on 2009-09-05 14:52:34 by Scott Chitwood [add files list to repair broken image links]
Additions:
{{file}}


Revision [532]

Edited on 2009-05-08 20:44:02 by RalfFlicker [added bylines to my pages]
Additions:
By Ralf Flicker.


Revision [456]

Edited on 2009-04-03 02:59:53 by RalfFlicker
Additions:
You can run a Lua script in Oxidizer either via the "Scripts" pull-down menu, clicking the "Lua Script" toolbar icon, or using the integrated script launcher/library (my favorite choice) shown in Fig. 1. A useful keyboard shortcut is ⇧⌘L for re-running the last Lua script, for the times when you are running the same randomizing or sequencing script (or whatever you're doing) over and over again. In this basic tutorial we will learn that information is passed between Oxidizer and the Lua environment in the form of two Lua tables named
Deletions:
You can run a Lua script in Oxidizer either via the pull-down menu, clicking the ''Lua Script'' toolbar icon, or using the integrated script launcher/library (my favorite choice) shown in Fig. 1. A useful keyboard shortcut is ⇧⌘L for re-running the last Lua script, for the times when you are running the same randomizing or sequencing script over and over again. In this basic tutorial we will learn that information is passed between Oxidizer and the Lua environment in the form of two Lua tables named


Revision [455]

Edited on 2009-04-03 02:56:35 by RalfFlicker
Additions:
You can run a Lua script in Oxidizer either via the pull-down menu, clicking the ''Lua Script'' toolbar icon, or using the integrated script launcher/library (my favorite choice) shown in Fig. 1. A useful keyboard shortcut is ⇧⌘L for re-running the last Lua script, for the times when you are running the same randomizing or sequencing script over and over again. In this basic tutorial we will learn that information is passed between Oxidizer and the Lua environment in the form of two Lua tables named
~##oxidizer_genomes## : contains all the information about the genomes present in the Oxidizer main list (but not the Breeder or the Gene Pool)
~##oxidizer_status## : contains action instructions and status messages.
The implementation chart of ##oxidizer_genomes## is given in figure 2 below, with required numerical indices indicated by the pound sign (#). An overview with some more explanations of these parameters (though sometimes differently named) is available at the [[http://electricsheep.wikispaces.com/XML+parameter+files Electric Sheep wiki]].
@@{{image url="uploads/Scripting/OxiLuaChart_small2.jpg" link="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=OxiLuaChart.png" alt="OxiLuaChart_small.jpg" title="Oxidizer Lua implementation chart"}}@@@@Figure 2. Oxidizer Lua implementation (click on image for full-size version).@@----
Since we are going to be working with these a lot, it might be a good idea to review this topic first. The Xform triangle is a two-dimensional visual representation of the six coefficients of the affine transformation. Oxidizer represents these as the three vectors P1, P2 and O, each with two (x and y) components. P1 and P2 are scale factors, while O is a shift of origin. Figure 3 shows the default Xform triangle and its coefficient values, which we may call the "identity" mapping because it effects no transformation at all; if all the Xform triangles are like this there will be no fractal to look at.
Figure 3. Xform triangle (left) and coefficients (right) of the affine transformation (images taken from the Oxidizer Transform Editor). On this grid, X is right and Y is up""
And we’re done. You try this script on a few genomes, and check the orientation of the triangles using the Transform Editor (⌘E) in Oxidizer.
Deletions:
{{files}}
You can run a Lua script in Oxidizer either via the pull-down menu, clicking the toolbar icon, or using the integrated script launcher/library (my favorite choice) shown in Fig. 1. A useful keyboard shortcut is ⇧⌘L for re-running the last Lua script, for the times when you are running the same randomizing or sequencing script over and over again. In this basic tutorial we will learn that information is passed between Oxidizer and the Lua environment in the form of two Lua tables named
~##oxidizer_genomes## : contains all the information about the genomes present in the Oxidizer main list (but not those in the Breeder or the Gene Pool), including image, color, xform and rendering parameters.
~##oxidizer_status## : contains “action” instructions and status messages.
The implementation chart of ##oxidizer_genomes## is given below, with required numerical indices indicated by the pound sign (#). An overview with some more explanations of these parameters (though sometimes differently named) is available at the [[http://electricsheep.wikispaces.com/XML+parameter+files Electric Sheep wiki]].
@@{{image url="uploads/Scripting/OxiLuaChart_small2.jpg" link="http://www.rampant-mac.com/wiki/wikka.php?wakka=Scripting/files.xml&action=download&file=OxiLuaChart.png" alt="OxiLuaChart_small.jpg" title="Oxidizer Lua implementation chart"}}@@@@Figure 1. Oxidizer Lua implementation (click on image for full-size version).@@----
Since we are going to be working with these a lot, it might be a good idea to review this topic first. The Xform triangle is a two-dimensional visual representation of the six coefficients of the affine transformation. Oxidizer represents these as the three vectors P1, P2 and O, each with two (x and y) components. P1 and P2 are scale factors, while O is a shift of origin. Figure 2 shows the default Xform triangle and its coefficient values, which we may call the "identity" mapping because it effects no transformation at all; if all the Xform triangles are like this there will be no fractal to look at.
Figure 2. Xform triangle (left) and coefficients (right) of the affine transformation (images taken from the Oxidizer Transform Editor). On this grid, X is right and Y is up""
And we’re done. You try this script on a few genomes, and check the orientation of the triangles using the Rectangle editor (⌘E) in Oxidizer.


Revision [454]

Edited on 2009-04-03 02:50:42 by RalfFlicker
Additions:
{{files}}


Revision [453]

Edited on 2009-04-03 02:50:25 by RalfFlicker
Additions:
""
scripts.png
Figure 1. Integrated script launcher in Oxidizer 0.5.9.
""This tutorial is intended for absolute beginners with no prior experience with Lua scripting, although a modicum of familiarity with Oxidizer is assumed. To run a Lua script with Oxidizer, you need the Oxidizer application and a Lua script. To write a script, you need a text editor. To debug a script, you may optionally want a console to see the Lua output. For testing Lua commands you may optionally want a stand-alone Lua installation. The fully-loaded setup includes all of the above, plus downloading the Oxidizer source via CVS and running Oxidizer via Xcode (mainly for having a better console).
You can run a Lua script in Oxidizer either via the pull-down menu, clicking the toolbar icon, or using the integrated script launcher/library (my favorite choice) shown in Fig. 1. A useful keyboard shortcut is ⇧⌘L for re-running the last Lua script, for the times when you are running the same randomizing or sequencing script over and over again. In this basic tutorial we will learn that information is passed between Oxidizer and the Lua environment in the form of two Lua tables named
===Lua primer===
===Oxidizer genomes in Lua===
===Scripting for Oxidizer===
Deletions:
This tutorial is intended for absolute beginners with no prior experience with Lua scripting, although a modicum of familiarity with Oxidizer is assumed. To run a Lua script with Oxidizer, you need the Oxidizer application and a Lua script. To write a script, you need a text editor. To debug a script, you may optionally want a console to see the Lua output. For testing Lua commands you may optionally want a stand-alone Lua installation. The fully-loaded setup includes all of the above, plus downloading the Oxidizer source via CVS and running Oxidizer via Xcode (mainly for having a better console).
In this basic tutorial we will learn that information is passed between Oxidizer and the Lua environment in the form of two Lua tables named
===3. Lua primer===
===4. Oxidizer genomes in Lua===
===5. Scripting for Oxidizer===


Revision [451]

Edited on 2009-04-03 02:27:31 by RalfFlicker
Additions:
Below, chapters 0-2 of the previous tutorial have been compressed into a condensed introduction, and chapters 3-5 with some corrections and extensions constitute the wiki tutorial. The second part of the original chapter 5 dealt with animation topics, which you can now also explore over at the [[Animation2 animation tutorial (Part II)]]. A final note: this part of the tutorial does not deal with object methods enabled by the ObjC-Lua bridge, but sticks to a more old-fashioned (but probably simpler, for non-experts) style of modular programming. A section on object methods may be included later on.----
===Introduction===
This tutorial is intended for absolute beginners with no prior experience with Lua scripting, although a modicum of familiarity with Oxidizer is assumed. To run a Lua script with Oxidizer, you need the Oxidizer application and a Lua script. To write a script, you need a text editor. To debug a script, you may optionally want a console to see the Lua output. For testing Lua commands you may optionally want a stand-alone Lua installation. The fully-loaded setup includes all of the above, plus downloading the Oxidizer source via CVS and running Oxidizer via Xcode (mainly for having a better console).
In this basic tutorial we will learn that information is passed between Oxidizer and the Lua environment in the form of two Lua tables named
~##oxidizer_genomes## : contains all the information about the genomes present in the Oxidizer main list (but not those in the Breeder or the Gene Pool), including image, color, xform and rendering parameters.
~##oxidizer_status## : contains “action” instructions and status messages.
The ##oxidizer_status## table only has two elements, and they are:
~##oxidizer_status["action"]##
~##oxidizer_status["message"]##
They both take a text string as value. The ''message'' element holds the text message that you want Oxidizer to display. The possible values of the ''action'' element include:
~##"not_set", "replace", "append"##
~##"error", "warning", "message"##
There are currently two types of actions: to have Oxidizer display informational messages on screen (the ##"error"##, ##"warning"## and ##"message"## actions), and to tell Oxidizer how to update its genome list with what Lua has produced (the ##"replace"## and ##"append"## actions). That’s all we need to know about ##oxidizer_status## for the moment; the rest of this tutorial will be all about ##oxidizer_genomes##.----
Since we are going to be working with these a lot, it might be a good idea to review this topic first. The Xform triangle is a two-dimensional visual representation of the six coefficients of the affine transformation. Oxidizer represents these as the three vectors P1, P2 and O, each with two (x and y) components. P1 and P2 are scale factors, while O is a shift of origin. Figure 2 shows the default Xform triangle and its coefficient values, which we may call the "identity" mapping because it effects no transformation at all; if all the Xform triangles are like this there will be no fractal to look at.
It is worth pointing out that this triangle is a 2-dimensional visual representation of a point in 6-dimensional space, and there is a danger of confusion in this visualization trick. If a translation is applied, i.e. a shift of the origin O, the whole triangle moves across the grid, but the values of P1 and P2 do not change. This is because their values are //not// coordinates in the real plane like that of O, but scale factors. For future reference, we can list the addresses of the affine coefficients (first xform of the first genome):
%%(lua)xf = 1 -- index of the Xform to rotate
Now some math. We will define rotation here to mean a rotation of the P1 and P2 vectors around the origin O. Since we want to add our rotation angle to whatever P1 and P2 currently are, we must start by calculating their present phase angles. Converting to polar coordinates:
Deletions:
For the moment, only chapters 3, 4 and the the first part of chapter 5 of the previous tutorial are copied below. The second part of chapter 5 deals with animation topics which you can now also explore over at the [[Animation2 animation tutorial (Part II)]]. One final note: this part of the tutorial does not deal with object methods enabled by the ObjC-Lua bridge, but sticks to a more old-fashioned (but probably simpler, for non-experts) style of modular programming. A section on object methods will be added later on.----
Since we are going to be working with these a lot, it might be a good idea to review this topic first. The Xform triangle is a two-dimensional visual representation of the six coefficients of the affine transformation. Oxidizer represents these as the three vectors P1, P2 and O, each with two (x and y) components. P1 and P2 are scale factors, while O is a shift of origin. Figure 2 shows the default Xform triangle and its coefficient values, which we may call the “identity” mapping because it effects no transformation at all; if all the Xform triangles are like this there will be no fractal to look at.
It is worth pointing out that this triangle is a 2-dimensional visual representation of a point in 6-dimensional space, and there is a danger of confusion in this visualization trick. If a translation is applied, i.e. a shift of the origin O, the whole triangle "moves" across the grid, but the values of P1 and P2 do not change. This is because their values are //not// coordinates in the real plane like that of O, but scale factors. For future reference, we can list the addresses of the affine coefficients (first xform of the first genome):
%%(code)xf = 1 -- index of the Xform to rotate
Now some math. We have defined “rotation” here to mean a rotation of the P1 and P2 vectors around the origin O. Since we want to add our rotation angle to whatever P1 and P2 currently are, we must start by calculating their present phase angles. Converting to polar coordinates:


Revision [450]

Edited on 2009-04-03 01:57:33 by RalfFlicker
Additions:
Which is to be compared with Example 1, which does exactly the same thing.----
Deletions:
====={{color c="red" text="Under Construction"}}=====
{{files}}
----
Which is to be compared with Example 1, which does exactly the same thing


Revision [449]

The oldest known version of this page was created on 2009-04-03 01:54:32 by RalfFlicker
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki . Install WikkaWiki