# Attach Objekt at the end of line

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

## 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 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.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633295
• Total Posts
3011245
• ### Who's Online (See full list)

There are no registered users currently online

×