Jump to content

VEX - create primitives from arrayvalues


-HEAVY-

Recommended Posts

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 roomPrim0 = addprim(0, "poly");

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-
Link to comment
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 roomPrim0 = addprim(0, "poly");

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

 

Link to comment
Share on other sites

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-
Link to comment
Share on other sites

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-
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...