Sign in to follow this  

Attach Objekt at the end of line

This topic is 3624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! I want to do the following, but I am not completely sure how to do it: I have a line defined by two points each having (x,y,z) coordinates. Now I want to attach an object (e.g. a cone) at the end of the line in such a way that the central axis of the cone lies on the line. How can I do this the best way? Regards,

Share this post


Link to post
Share on other sites
ok, just some notes where I am at the moment:
Point A,B; Dir. Vector AB
1.) Calculate Rotation for each axis:
rot_x = acos(dotProduct(AB,Vector(1,0,0)))
rot_y = acos(dotProduct(AB,Vector(0,1,0)))
rot_z = acos(dotProduct(AB,Vector(0,0,1)))

2.) Rotate
3.) Translate to e.g. A

This works for some cases, but as the dotproduct is in the range between 0-180° rotation is not perfect.

Share this post


Link to post
Share on other sites

This topic is 3624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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