Vex get current point position?

   11822   5   0
User Avatar
Member
97 posts
Joined: May 2015
Offline
So i have a wrangle and i made a transform and i changed the rotation value. How do i get the point position? i keep getting the old position from input1. I made another vector type with point function but put geoself() and still ruturns input1 vector position. I want the new position of the point its at now in -90 degrees.
User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
Post a hip so people can see what you actually did.
User Avatar
Member
97 posts
Joined: May 2015
Offline
BabaJ
Post a hip so people can see what you actually did.

Ok, its the Wrangle colored in red.

Attachments:
Bunker_Hallway_03-2.hipnc (464.6 KB)

User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
Your going to have to re-think what you want to do.

As an example for the first issue I see is in your red colored wrangle:

...
if(first_points <= -1)
{
setpointgroup(1,"Point_Yes",first_points,1);
...

Your trying to use setpointgroup on the second wrangle input.

wrangles can only process the first input, and in your case it is set to run over points.

You can only use the other inputs as reference.

As to your original question. If this is the part of your code you are referring too:
...
@P*=Y_negative;
vector newrt = point(geoself(),"P",1);
...

for ‘newrt’ your returning the value of point 1 using a point function. And that function is referring to the node itself.

When referring to the nodes you are doing so to their initial state.

If you want to refer to point number one after the matrix has been applied ( in which you assumed would happen since the point function follows what was applied to point number one), just use @P:

@P*=Y_negative;
vector newrt = @P);

or do away with it altogether (generating the newrt vector) and use @P directly in your function:

if(check_p(@P) <= -1)

If you really only want this to happen to point number one you can set a conditional for only doing the rotation with:

if(@ptnum == 1)
{
@P*=Y_negative;
vector newrt = @P);
}

Of course, keeping in my what I mentioned before about setpointgroup, and the fact your running over points.

You may have to work out something in detail mode.
Edited by BabaJ - April 22, 2019 14:35:31
User Avatar
Member
97 posts
Joined: May 2015
Offline
BabaJ
Your going to have to re-think what you want to do.

As an example for the first issue I see is in your red colored wrangle:

...
if(first_points <= -1)
{
setpointgroup(1,"Point_Yes",first_points,1);
...

Your trying to use setpointgroup on the second wrangle input.

wrangles can only process the first input, and in your case it is set to run over points.

You can only use the other inputs as reference.

As to your original question. If this is the part of your code you are referring too:
...
@P*=Y_negative;
vector newrt = point(geoself(),"P",1);
...

for ‘newrt’ your returning the value of point 1 using a point function. And that function is referring to the node itself.

When referring to the nodes you are doing so to their initial state.

If you want to refer to point number one after the matrix has been applied ( in which you assumed would happen since the point function follows what was applied to point number one), just use @P:

@P*=Y_negative;
vector newrt = @P);

or do away with it altogether (generating the newrt vector) and use @P directly in your function:

if(check_p(@P) <= -1)

If you really only want this to happen to point number one you can set a conditional for only doing the rotation with:

if(@ptnum == 1)
{
@P*=Y_negative;
vector newrt = @P);
}

Of course, keeping in my what I mentioned before about setpointgroup, and the fact your running over points.

You may have to work out something in detail mode.

im just using the setpointgroup function for debugging and seeing if it works and its working the way i want it to i just want to get the new current position of point 1 and checnk if it returns -1 or a number from near point. If u go to >> transform5 << and rotate it there ull get the setpointgroups change. i want true if it didnt find any points
User Avatar
Member
97 posts
Joined: May 2015
Offline
imma make another site of wrangle to show it works i jsut want to avoid more wrangles just use 1 to check for position. Doesnt move on detail the rotation.

Attachments:
Bunker_Hallway_03-2.hipnc (491.8 KB)

  • Quick Links