Newbie cylinder problem
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
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement