Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
ryreh

Create geometry with AttribWrangle

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

Share this post


Link to post
Share on other sites

Check out this, it will explain a lot of what you are asking for.

 

 

Share this post


Link to post
Share on other sites

Thank you, Sepu! 
But I didn't find (or my English didn't allow me to catch it) how to get access to earlier created points. 

Share this post


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

Share this post


Link to post
Share on other sites

Thank you, Holycause! This is exactly what I searched!

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  
Followers 0