# VEX - create primitives from arrayvalues

## Recommended Posts

Posted (edited)

Hey Folks,

I wrap my head around this and cant find any solution
can somebody explain me why this is not working and how I can get it to work ?

```// roomsizes
vector zim3    = {5.25, 2.50, 3.82};
vector zim2    = {3.65, 2.50, 3.90};
vector zim1    = {3.65, 2.50, 2.82};
vector kueche  = {2.50, 2.50, 3.82};
vector bad     = {2.83, 2.50, 3.74};
vector flur    = {1.50, 2.50, 5.71};
vector aRaum   = {1.50, 2.50, 0.96};

// create Rooms
// create _LivingRoom
int pos0 = addpoint(0, {-(zim3.x*0.5), 0, -(zim3.z*0.5)});
int pos1 = addpoint(0, {(zim3.x*0.5), 0,  -(zim3.x*0.5)});
int pos2 = addpoint(0, {(zim3.x*0.5), 0, (zim3.z*0.5)});
int pos3 = addpoint(0, {-(zim3.x*0.5), 0, (zim3.z*0.5)});

int vert0 = addvertex(0, roomPrim0, pos0);
int vert1 = addvertex(0, roomPrim0, pos1);
int vert2 = addvertex(0, roomPrim0, pos2);
int vert3 = addvertex(0, roomPrim0, pos3);```

seems very simple but I miss something...

and yes i am running in Detail mode

thx
deHeavy

Edited by -HEAVY-

##### Share on other sites

You should use set() instead of {} when you mix numbers and variables.

```// roomsizes
vector zim3    = {5.25, 2.50, 3.82};
vector zim2    = {3.65, 2.50, 3.90};
vector zim1    = {3.65, 2.50, 2.82};
vector kueche  = {2.50, 2.50, 3.82};
vector bad     = {2.83, 2.50, 3.74};
vector flur    = {1.50, 2.50, 5.71};
vector aRaum   = {1.50, 2.50, 0.96};

// create Rooms
// create _LivingRoom
int pos0 = addpoint(0, set(-(zim3.x*0.5), 0, -(zim3.z*0.5)));
int pos1 = addpoint(0, set((zim3.x*0.5), 0,  -(zim3.x*0.5)));
int pos2 = addpoint(0, set((zim3.x*0.5), 0, (zim3.z*0.5)));
int pos3 = addpoint(0, set(-(zim3.x*0.5), 0, (zim3.z*0.5)));

int vert0 = addvertex(0, roomPrim0, pos0);
int vert1 = addvertex(0, roomPrim0, pos1);
int vert2 = addvertex(0, roomPrim0, pos2);
int vert3 = addvertex(0, roomPrim0, pos3);```

##### Share on other sites

thx Konstantin, I thought it is that easy

did i miss the part in the help files or from where should one know this?

##### Share on other sites

Type it off, play around with the code, change and break stuff, close the tab and try it blindly, write your own little scripts every day, google the forums and help others once you know smth.

##### Share on other sites
Posted (edited)

yeah thx again, I read a lot at the moment and try and type and script and so on. I watch Entagma and read through Tokeru and others - but it seems that I missed that one.

Ohh and i found the line that "explains" the use of the set attribute - i really didnt get it before (around an hour or so).

Edited by -HEAVY-

##### Share on other sites
Posted (edited)

so know that it works I have different primitives how do I access those primpoints separatly for shifting them around etc. ?

ahh never mind i use the primnumber

Edited by -HEAVY-

## Create an account

Register a new account

×
• Donations