Cylindrical Surfaces in OpenGL
Hello, can anyone explain how I can trim a cylindrical surface in opengl using a bspline curve ? I can trim nurb surfaces by using gluBeginTrim and gluEndTrim, so does anyone know how I can represent a cylindrical surface using gluNurbsSurface ie how do i calculate the knots and points I have the radius of the cylinder and the height, origin (in cartesian) and the direction vector ? Thanks in advance.
You can calculate your points mathematically, with trigonometry.
So now you need to decide on the resolution of your cylinder, ie: how many polygons do you use to complete the circle? so if you decide on a resolution of say... 18, then thats 18 quads or 36 TRIs for the main shell & then 18(or 36) more for each end cap as well. After you generate the cylinder points for a location & rotation of ZERO, you can then apply a view-matrix to those points if you want a certain origin & direction for the shape.
So now you need to decide on the resolution of your cylinder, ie: how many polygons do you use to complete the circle? so if you decide on a resolution of say... 18, then thats 18 quads or 36 TRIs for the main shell & then 18(or 36) more for each end cap as well. After you generate the cylinder points for a location & rotation of ZERO, you can then apply a view-matrix to those points if you want a certain origin & direction for the shape.
Whatsoever you do, do it heartily as to the Lord, and not unto men.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement