# VEX

 Item Links Documentation / Tutorials ​ Industry / Case-studies ​Rohan Dalvi Entagma Repositories / Wiki Supplementary Khan Academy Mathematics

# Data types declaration

`int x = 18; // integerfloat y =  3.142 // float string name = "John";  // stringvector v = {1,1,1};matrix3 m = ident(); // identity matrix creationquaternion ​// array form: member_type var_name[]:float my_array[];vector_array[];str_array[];​//global attribute@myGlobalAttributev@myVector = set(-1,-1,-1);i@var = 1;`

# Statements

`// Loopsfor(int i =1; i<10;i++)    {}​// if conditional if(x==1){    ...    }else{    ...}​// while while(condition){    yourStatement;}`

# Attributes

```normalize // Position@P @P.x@P.y@P.z​// Normal@N ​// color@Cd.r@Cd @Cd.g@Cd.b@Alpha // Alpha​​//scale
@pscale = 1;​@scale.x = 1;@scale.y = 1;@scale.z = 5;​// Set scale, and manipulate one axis only@scale =set(1,1,1); @scale.y = 2.​// commonly used@ptnum@```
` // Position@P @P.x@P.y@P.z​// Normal@N ​// color@Cd.r@Cd @Cd.g@Cd.b@Alpha // Alpha​​//scaling@pscale = 1;​@scale.x = 1;@scale.y = 1;@scale.z = 5;    // Set scale, and manipulate one axis only@scale =set(1,1,1); @scale.y = 2.`

# Functions

`v@myVector = set(-1,-1,-1);​fit01(attribute,minVal,maxVal);fit(attribute,ominVal,omaxVal,minVal,maxVal);rand(value);    normalize    //noise types noise anoisesnoise pnoise ​    //Copystampstamp("../copy1","variable",0)`

# Expressions

`Time — \$T / @TimeFrame — \$F (int) / \$FF (float)Stamp — stamp("path","variable/channel",defaultValue)    eg. stamp("../copy1","rotation",25)​​//Centroid\$CEX, \$CEY , \$CEZ​\$HIP — Project path\$HIPNAME — HIP project name​// Parsing file name name.\$F4.jpg // \$F4 padding: 0008.jpg`

# Creating controls

`ch('threshold')chf('threshold')chi('threshold')chv('vector_parm)'​float  chramp(string channel, float ramppos)float  chramp(string channel, float ramppos, float time)vector  chramp(string channel, float ramppos)vector  chramp(string channel, float ramppos, float time)`