Archived

This topic is now archived and is closed to further replies.

Body Thief

Newbie cylinder problem

Recommended Posts

Ok.. i know this is a newbie question... How do you orient a cylinder between two points.. I have tried to do so using rotations. but there seems to be an offset or some degree of error.. Please.. if someone can help I'd be greatly appreciative.. Thanks BT email : dante_ix@yahoo.com Edited by - Body Thief on August 6, 2001 3:23:26 PM

Share this post


Link to post
Share on other sites
Well...

Create a vector by subtracting point B by point A. This vector will be one of your cylinders axex in it''s matrix. Then To make the other two, you need to decide on how you want the cylinder to ''roll''. Finally, Find the center of the cylinder should be at the average of points A and B.

Once you have the cylinders transformation matrix, multiply it by openGLs modelview matrix, and draw your cylinder.

Share this post


Link to post
Share on other sites