Menu

VEX General Concepts

VEX General Concepts

IPO model

The wrangle node is an IPO node ( input and output)
Procedural programming refers to a series of steps that must be taken to deliver a certain action
PointWrangle node- can be set to run over points, run once( detail ). Can be use to run over points and manipulate attributes
To create an attribute
ex

We can read pretty much all built in attributes an upstream node
Expression in vex can be used for shading and vector manipulation
Each context has its own globals, macros and operators
The blocks of code must be indented and enclosed whiting {}

Expressions are single sentence lines of code that describe an action
Variables –
In vex each data type is associated with a type variable</p>

Int
Vector
String
Array
matrix


We can index inside an array like in python also we can run operations ops variables
Attributes are were data gets stored
1. Point
2. Primitive
3. Vertex
4. Detail


Attributes are attached to each context
So points an have Cd or v, or p
To read the attribute use the

The “@ syntax” states that the value in question is an attribute for example attribute position is v(“Data Type Vector”)@P(@”Attribute” “P”Position “”)


Also the DOT syntax can be used to us call a specific component for the attribute in question

We can create custom visualizers to review hard to understand data – With the D menu we can create a custom vector trail marker and normalize it to visualize for example Velocity vector. 

Basic form creation  – to generate geometry we must follow a very specific way
1 Points records the basic information of position in space

1. Point
2. Vertex
3. Primitive

Addpoint() – creates points described by a vector
AddPrim() – generates a primitive Polygon describes the relationship ” PolyLine” or “Polygon”

AddVertex();

AddVertex() Example

To create a polygon with 4 points

The order in which we write the addVertex determines the direction of the poly
We must round the outside – root of the outer edges

Outsourcing –
Create a function that would allow us to call it for the generation of the defined primitive

Entagma chaldni function –

FOR-LOOPS

Sin and cosine expect an angle between 0 and 2Pi.

1: Center Pivot and Move to Origin
in a pointwrangle..

2: Random Normal
in a pointwrangle..

3: Blend Positions
in a pointwrangle..

vector pos1 = v@P;
vector pos2 = point(1,”P”,@ptnum);
float mixbias = chf(“mix_bias”);

v@P=lerp(pos1,pos2,mixbias);

4: Whitehair Setup
in a primwrangle…

if(rand(@id)<0.2){IPO model
The wrangle node is an IPO node ( input and output)
Procedural programming refers to a series of steps that must be taken to deliver a certain action
PointWrangle node- can be set to run over points, run once( detail ). Can be use to run over points and manipulate attributes
To create an attribute
ex

We can read pretty much all built in attributes an upstream node
Expression in vex can be used for shading and vector manipulation
Each context has its own globals, macros and operators
The blocks of code must be indented and enclosed whiting {}

Expressions are single sentence lines of code that describe an action
Variables –
In vex each data type is associated with a type variable
Int
Vector
String
Array
matrix
We can index inside an array like in python also we can run operations ops variables
Attributes are were data gets stored
1. Point
2. Primitive
3. Vertex
4. Detail
Attributes are attached to each context
So points an have Cd or v, or p
To read the attribute use the
@ syntax with states that v@P = Position
Also the DOT sustain can me use to us call a specific component or the attribute ex
v@Cd = 0; == black
v@CD.g = 1; == Green
Ve can create custom visualizers to review hard to understand data
With the D menu we can create a custom vector trail marker and normalize it to visualiza for example Velocity

Basic form – to generate geometry we must follow a very specific way
1 Points records the basic information of position
Ex vector pos1 = set(-1,0,-1);
Int pl = addpoint(0,pos1);
1. Point
2. Vertex
3. Primitive

Addpoint() – creates points described by a vector
Polygon describe the relationship

AddPrim() – generates a primitive
Ex
Int prim1 = add prim(0,”poly”);
This primitive is not connected to the points
The connection is made with vertex

AddVertex() – EX
addvertex(0,prim1,p1);
1 prim we can’t see, we must have at least two primitives
addvertex(0,prim1,p2);

To crate a polygon with 4 points
Addpoints (vectors)
Adprim(0,”poly”;)
Adverted(0,prim,position);

The order in which we write the addVertex determines the direction of the poly
We must round the outside – root of the outer edges

Outsourcing –
Create a function that would allow us to call it for the generation of the defined primitive

Entagma chaldni function –

FOR-LOOPS

Vector pos = set(0,0,0);
for(int i = 0; i<20;i++){
addpoint(0,pos);
}

Sin and cosine expect an angle between 0 and 2Pi.

1: Center Pivot and Move to Origin
in a pointwrangle..

vector centroid = getbbox_center(0);
vector dist = centroid – 0;
v@P -= dist;

2: Random Normal
in a pointwrangle..

v@N=set(fit01(rand(@ptnum),-1,1),fit01(rand(@ptnum+1),-1,1),fit01(rand(@ptnum+2
),-1,1));

3: Blend Positions
in a pointwrangle..

vector pos1 = v@P;
vector pos2 = point(1,”P”,@ptnum);
float mixbias = chf(“mix_bias”);

v@P=lerp(pos1,pos2,mixbias);

4: Whitehair Setup
in a primwrangle…

if(rand(@id)<0.2){
i@whitehair=1;
}else{
i@whitehair=0;
}

5: Custom Width Along Curve
in a pointwrangle.. also needs a uvtexture node set to rows and columns running over points before it

float blend = chramp(“blend”,@uv[0]);
float width = chf(“width”);
@width=blend*width;


i@whitehair=1;
}else{
i@whitehair=0;
}

5: Custom Width Along Curve
in a pointwrangle.. also needs a uvtexture node set to rows and columns running over points before it

float blend = chramp(“blend”,@uv[0]);
float width = chf(“width”);
@width=blend*width;

Share

This is a unique website which will require a more modern browser to work!

Please upgrade today!