Tutorial 1 : A first script, a simple waveform
Collaboration diagram for Tutorial 1 : A first script, a simple waveform:
An eXo script as at minimum 2 parts:
For this first script the 3D scene will just draw the generated texture on a simple polygon that will fill the window.
- a description of a texture that will be used to compose a 3D scene
- the descrition of the 3D scene
To do this we have a block <Scene> </Scene> and within this block we define just a single layer <Layer name="ListManager"> </Layer>, this will just tell to render a polygon using the texture generated by the main ListManager.
The generated texture itself will be a simple waveform.
The root effect that generate the texture must always be a ListManager defined as a block <Effect name="ListManager"> </Effect>.
We juts have the oscilloscope type drawing effect to generate the waveform. This effect is called "SuperScope"
At minimum the super scope effect must have some equations in the init and pixel phase. During the init we must define the number of line segments we want to draw, here we set it to the gobal value w that is the width of the rendering buffer.
To actually draw the waveform we now define where to move the oscilloscope line at each pixel iteration, to do so we have to set the x and y values in at least 2 equations.
We can also define the color of the line by setting the values of the red, green and blue variables.
<?xml version="1.0" standalone="no" ?>
<Parameter name="Init" value="n=w;"></Parameter>
<Parameter name="Pixel" value="x=i*2-1; y=v/2; red=1; green=0; blue=0;"></Parameter>
Here are the visuals generated by this very simple script:
Generated on Sun Dec 25 21:46:43 2005 for eXo Visualizer by