Jump to content

how to add a point between 2 points in vex


pelos

Recommended Posts

I have a point {0,0,0}  and another one in {1,0,0}  how can I add one or more points (equidistant) between this 2 points?  I know I can use addpoint({.5, 0,0})  but how can I get the new position?  should I delete the first P with the second? or there is an function for that?

 

thanks =)

Link to comment
Share on other sites

First find the vector from point one to point two and then divide by two:
newpointpos = ( vector two - vector one ) * 0.5

So with two add nodes and a wrangle it would look something like this:
PAB3q1v.png

Regards
Bonsak

Edited by bonsak
Link to comment
Share on other sites

just use lerp

lerp(A,B,0.5);

means linearly interpolate b/n A and B with 'percentage' as 0.5 (ie. half way)

Yes from Origin is correct, you simply missed the part that you have to add the 1st point as 'offset'.

To me lerp is far simpler

Edited by Noobini
  • 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...