Jump to content
SteveNi

VEX - moving obj in a certain direction by a certain amount

Recommended Posts

Hi

I have an object and I want to move it lets say 1.5 units in a certain direction ( so move it along a certain vector ), so I tried what you can see in the picture.

Of course this doesn't work, because 1.5*{1,1,1} will result in moving the obj of 1.5 units in every axis.

So how can I work out the correct numbers to move the obj by a certain amount in a certain direction?

Screenshot_1.jpg

Share this post


Link to post
Share on other sites

You need to normalize your direction vector first before the multiplication. 
 

vector dir = {1, 1, 1};
v@P += 1.5 * normalize(dir);

 

  • Like 1

Share this post


Link to post
Share on other sites
Quote

You need to normalize your direction vector first before the multiplication. 

 

Ok Thanks it works!

As far as I knew normalizing something would have made it equal to 1, could you explain better what it does?

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

×