Jump to content
Sign in to follow this  
-HEAVY-

VEX - create primitives from arrayvalues

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-

Share this post


Link to post
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);

 

Share this post


Link to post
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 this post


Link to post
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-

Share this post


Link to post
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-

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×