XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Screensaver/Visualization Developement

Screensaver/Visualization Developement Create beautiful presets for XBMC's exclusive Vortex 3D Visualizer

Reply
 
Thread Tools Search this Thread Display Modes
Old 2006-10-02, 13:36   #1
donno
Python Expert
 
donno's Avatar
 
Join Date: Jan 2005
Location: Australia
Posts: 131
donno is on a distinguished road
Send a message via MSN to donno
Post Scripting Items

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.

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)
As you guess you can use these to base your animations/movement/position/size etc on what the auto is like


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 );
__________________
** Team blackbolt member and Team XBMC Tester** XBMC 4 ever

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


donno is offline   Reply With Quote
Old 2006-10-02, 21:45   #2
MrC
Team-XBMC Developer
 
MrC's Avatar
 
Join Date: Jan 2004
Location: England
Posts: 55
MrC is on a distinguished road
Default

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
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


MrC is offline   Reply With Quote
Old 2006-10-03, 20:31   #3
morte0815
Member
 
morte0815's Avatar
 
Join Date: Sep 2004
Location: Germany
Posts: 61
morte0815 is on a distinguished road
Default

Some additions:

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
morte0815 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Video-overlay for Python scripting? BennY- Plugin/Script (Python) Development 12 2007-01-19 20:21
Request for more options for Python Scripting - new puthon-engine features vSaAmTp Plugin/Script (Python) Development 2 2006-10-05 15:11
Scripting and slideshow Spoetzl Plugin/Script (Python) Help and Support 2 2006-07-19 20:18
Crash proof scripting Phunck Plugin/Script (Python) Development 1 2005-04-28 16:08
Scripting question about a few things Billy Plugin/Script (Python) Development 9 2004-10-29 03:22


All times are GMT +2. The time now is 13:46.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project