Jump to content

Create geometry with AttribWrangle


ryreh

Recommended Posts

Hello! Sory for my English
I'm trying create geometry with AttribWrangle node in Detail mode. I use addpoint, addvertex and addprim nodes. When I created some points how could I get access to them into the node? 
For example, I created point pnt0 = {0,0,0,}. And now I want to create point pnt1 which is close to pnt0:
int X = 3; 

int pnt0 = addpoint(0, set(0,0,0));

int pnt1 = addpoint(0, set());  - and here I want to get position of the first point and add X to each coordinates.
Is it possible?

 

Edited by ryreh
Link to comment
Share on other sites

you could do something like this

float x = 3.;

vector pos = {0, 0, 0};

int numPoints = 3;

for(int i=0; i<numPoints; i++){

    addpoint(0, pos);

    pos.x += x;

    pos.y += x;

    pos.z += x;

}

but if you don't want to generate your points in a loop you could do something like this

float x = 3.;

int pt0 = addpoint(0, {0,0,0});

vector pos = point(0, "P", pt0);

pos.x += x;

pos.y += x;

pos.z += x;

int pt1 = addpoint(0, pos);

 

Edited by holycause
  • Like 1
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...