2006-10-02, 12:36

Team XBMC developers created the Vortex visualization engine with a preset system for a good reason!

We want you, The Users to come up with your own Vortex Presets and use this forum to share, discuss and develop them.

Hope you have fun in the process!

Vortex Scripting Documenation - Vortex Presets Script Development:

http://wiki.xbmc.org/index.php?title=Vor...evelopment

About a day after the release of 2.0, i started looking at Vortex and writing some documentation which I hope to be a valuable resource for those wishing to contribute to XBMC by making a stunning preset or transition. This document is in the very early stages, it doesn't really cover how to actually do it more of what is available.

If you interrested in the helping you can email me samples/tutorials/material.

Contact me if you would like the Word Document source and are interrested, I will have limited time to work on this so if your interrested in taking on documenting Vortex give a shout.

My plan is once a list of all the functions/variables/data types are documented then start explaining the functions on what they do and compile some samples for them and include some samples on how to create a Cube for example, and use tunnels and maybe some handy math functions. All thoughts appreciated.

Bellow attached is Revision 0.3 of the Vortex Scripting Documentation. I'm hoping at one point to include it on the wiki so every one can contribute but at the same time have a pdf/doc version for people to keep and read offline.

Intro

Vortex Presets uses a scripting library known as AngelScript. The Scripting language follows the same/similar syntax to C/C++. Here is a list of things that might be useful to know. I might post this on the Wiki Later on. Just thought this forums looking bare. Hopefully some more infomation can be given later like examples, samples, explanations on how stuff actually works. For now this list is here just so you know.

General:

the coordinatesystem is left-handed: x,y in screenplane z into the screen.

Primitives:

if you use PRIM_QUADLIST, the vertices have to be ordered clockwise, otherwise the texture on top is mirrored.

1----2

| |

4----3

Supported Data Types

List of Global Defined Constants

const int PRIM_POINTLIST = 1;

const int PRIM_LINELIST = 2;

const int PRIM_LINELOOP = 3;

const int PRIM_LINESTRIP = 4;

const int PRIM_TRIANGLELIST = 5;

const int PRIM_TRIANGLESTRIP = 6;

const int PRIM_TRIANGLEFAN = 7;

const int PRIM_QUADLIST = 8;

const int PRIM_QUADSTRIP = 9;

const int TEXTURE_FRAMEBUFFER = 1;

const int TEXTURE_NEXTPRESET = 2;

const int TEXTURE_CURRPRESET = 3;

const int TEXTURE_ALBUMART = 4;

const int NULL = 0;

const int BLEND_OFF = 0;

const int BLEND_ADD = 1;

const int BLEND_MOD = 2;

const int BLEND_MAX = 3;

const int FILLMODE_SOLID = 0;

const int FILLMODE_WIREFRAME = 1;

Global Vortex Variables

Operators and Math

+ Addition (5+3 will give 8)

- Subtraction (5-3 will give 2)

* Multiplcation (2*4 will give 8)

= Equality (left side will be made same as right side)

+= (same as left = left + right

-= (same as left = left - right)

Cos(x) Cosine of x in radians

Sin(x) Sine of x in radians

Rand() Chooses a random float from 0 to 1. [Not sure how many decial places]

Rand()*10 Chooses a random float from 0 to 10 [Still not sure how many decimal places]

Pow(a,x) a to the power of x (I think )

Fabs(a) makes float a an absolute value

Vortex Functions

I got no idea exactly how these works i just found them in the inlucded presets.

a,b,c,d,e,[f] for showing variables in the function argument,

Math Functions

float Rand() - returns a random number between 0 and 1

float Sin(float x) - returns the sine of x (x in radians)

float Cos(float x) - - returns the cosine of x (x in radians)

float Mag(float x, float y) - returns the magnitude of x and y ( same as sqrt(x*x + y*y) )

float Clamp(float x, float min, float max) - returns x after clamping it to the min and max values

float Fabs(float x ) - returns the absolute value of x

int Abs(int x) - returns the absolute value of x

float Atan2(float x, float y) - returns the arctangent of x and y

float Pow(float x, float y) - returns x raised to the power y

float Sqrt(float x) - returns the square root of x

Happy coding!

We want you, The Users to come up with your own Vortex Presets and use this forum to share, discuss and develop them.

Hope you have fun in the process!

Vortex Scripting Documenation - Vortex Presets Script Development:

http://wiki.xbmc.org/index.php?title=Vor...evelopment

About a day after the release of 2.0, i started looking at Vortex and writing some documentation which I hope to be a valuable resource for those wishing to contribute to XBMC by making a stunning preset or transition. This document is in the very early stages, it doesn't really cover how to actually do it more of what is available.

If you interrested in the helping you can email me samples/tutorials/material.

Contact me if you would like the Word Document source and are interrested, I will have limited time to work on this so if your interrested in taking on documenting Vortex give a shout.

My plan is once a list of all the functions/variables/data types are documented then start explaining the functions on what they do and compile some samples for them and include some samples on how to create a Cube for example, and use tunnels and maybe some handy math functions. All thoughts appreciated.

Bellow attached is Revision 0.3 of the Vortex Scripting Documentation. I'm hoping at one point to include it on the wiki so every one can contribute but at the same time have a pdf/doc version for people to keep and read offline.

Intro

Vortex Presets uses a scripting library known as AngelScript. The Scripting language follows the same/similar syntax to C/C++. Here is a list of things that might be useful to know. I might post this on the Wiki Later on. Just thought this forums looking bare. Hopefully some more infomation can be given later like examples, samples, explanations on how stuff actually works. For now this list is here just so you know.

General:

the coordinatesystem is left-handed: x,y in screenplane z into the screen.

Primitives:

if you use PRIM_QUADLIST, the vertices have to be ordered clockwise, otherwise the texture on top is mirrored.

1----2

| |

4----3

Supported Data Types

- float

- int

- bool

- Texture

- Map

- VoicePrint

- Tunnel

List of Global Defined Constants

const int PRIM_POINTLIST = 1;

const int PRIM_LINELIST = 2;

const int PRIM_LINELOOP = 3;

const int PRIM_LINESTRIP = 4;

const int PRIM_TRIANGLELIST = 5;

const int PRIM_TRIANGLESTRIP = 6;

const int PRIM_TRIANGLEFAN = 7;

const int PRIM_QUADLIST = 8;

const int PRIM_QUADSTRIP = 9;

const int TEXTURE_FRAMEBUFFER = 1;

const int TEXTURE_NEXTPRESET = 2;

const int TEXTURE_CURRPRESET = 3;

const int TEXTURE_ALBUMART = 4;

const int NULL = 0;

const int BLEND_OFF = 0;

const int BLEND_ADD = 1;

const int BLEND_MOD = 2;

const int BLEND_MAX = 3;

const int FILLMODE_SOLID = 0;

const int FILLMODE_WIREFRAME = 1;

Global Vortex Variables

- TREBLE

- MIDDLE

- BASS

- TIMEPASS

- FINISHED (Set by User)

Operators and Math

+ Addition (5+3 will give 8)

- Subtraction (5-3 will give 2)

* Multiplcation (2*4 will give 8)

= Equality (left side will be made same as right side)

+= (same as left = left + right

-= (same as left = left - right)

Cos(x) Cosine of x in radians

Sin(x) Sine of x in radians

Rand() Chooses a random float from 0 to 1. [Not sure how many decial places]

Rand()*10 Chooses a random float from 0 to 10 [Still not sure how many decimal places]

Pow(a,x) a to the power of x (I think )

Fabs(a) makes float a an absolute value

Vortex Functions

I got no idea exactly how these works i just found them in the inlucded presets.

a,b,c,d,e,[f] for showing variables in the function argument,

- gfxSetTexture(Texture Type);

- gfxSetRenderTarget(Texture Type); (also gfxSetRenderTarget(Map Type)

- gfxSetEnvTexture(Texture Type);

- gfxTranslate(a, b, c);

- gfxRotate(a,b,c,d);

- gfxColour(a, b, c, d);

- gfxCube(a,b, c, d,e,[f]); (Using f coz I use f for something else)

- gfxTexCoord(a,b);

- gfxVertex(x,y,s);

- gfxSetBlendMode(BLEND_ADD);

- gfxBegin(PRIM_QUADLIST);

- gfxEnd();

- gfxPushMatrix();

- gfxPopMatrix();

- gfxClear(0);

- gfxSetAspect(0);

- gfxTexRect(-1, 1, 1, -1);

- gfxLookAt(Cos(tn*1.23)*5,Sin(tn)*5,(tm*2)-1,Cos(tn*0.6734)*2,Sin(tn*0.2143)*2,(tm*2)+8,0,1,0);

Math Functions

float Rand() - returns a random number between 0 and 1

float Sin(float x) - returns the sine of x (x in radians)

float Cos(float x) - - returns the cosine of x (x in radians)

float Mag(float x, float y) - returns the magnitude of x and y ( same as sqrt(x*x + y*y) )

float Clamp(float x, float min, float max) - returns x after clamping it to the min and max values

float Fabs(float x ) - returns the absolute value of x

int Abs(int x) - returns the absolute value of x

float Atan2(float x, float y) - returns the arctangent of x and y

float Pow(float x, float y) - returns x raised to the power y

float Sqrt(float x) - returns the square root of x

Happy coding!