0

I have the following control points for 2 bezier surface patches trying to build a surface of revolution out of them.

float ctlpoints[][4] ={{-2,-1, 0, 1}, {0, 0, 2, 0}, {2,-1, 0, 1}, {-3, 0, 0, 1}, {0, 0, 3, 0}, {3, 0, 0, 1}, {-1.5 , 0.5 , 0, 1}, {0, 0, 1.5 , 0}, {1.5 , 0.5 , 0, 1}, {-2, 1, 0, 1}, {0, 0, 2, 0}, {2, 1, 0, 1}}; float ctlpointsB[][4] ={{-2,-1, 0, 1}, {0, 0, -2, 0}, {2,-1, 0, 1}, {-3, 0, 0, 1}, {0, 0, -3, 0}, {3, 0, 0, 1}, {-1.5 , 0.5 , 0, 1}, {0, 0, -1.5 , 0}, {1.5 , 0.5 , 0, 1}, {-2, 1, 0, 1}, {0, 0, -2, 0}, {2, 1, 0, 1}};

these are 4 control points of a vertical curve in the x,y plane given by

(2,-1,0), (3,0,0), (1.5,0.5,0), (2,1,0)

then expanding each into 3 homogeneous control points to draw a semicircle horizontally both front (in the first 12 points) and back (in the second 12 points). For example the first point is expanded into:

{-2,-1, 0, 1},{0, 0, 2, 0},{2,-1, 0, 1}

at the front. In the back it is expanded into:

{-2,-1, 0, 1},{0, 0, -2, 0},{2,-1, 0, 1}

However the 2 halves (front and back) do not join smoothly (I expect the tangents at common end points to be at least G-1 continuous). What I get is shown in this image1

I am not sure if the surface can ever be generated this way or not? I generated the surface from the bezier curve defined by the 4 above points in the x,y plane, by revolving it around the origin for 360 degrees[here it is textured in this image2]. I just can't prove or disprove that it can be generated from the above mentioned 2 halves.

  • Why are you generating the surface in two pieces? Apparently. the $B$ surface is just the $A$ surface reflected through the plane $Z = 0$. This would work if that plane were a plane of symmetry of your surface. But it obviously is not. The center axis is rotated with respect to that plane and thus when you cut the surface by it, and reflect it through that plane, it doesn't line up. I have no idea why your surface is rotated. You apparently made a mistake generating the control points. But I have no idea what that mistake was. – Paul Sinclair May 08 '23 at 13:18

1 Answers1

1

Thanks Paul for your illuminating comment, indeed I was doing something wrong. I did not implement the bezier code for generating the patches, I used a third party code and assumed by specifying the dimension as 4, the return point would be in homogeneous coordinates thus I divided by w(ret[3]) in my code. Upon reading your comment I dug deeply into the third party code and found out that the return point had been divided by w ( without setting w to 1). Upon elimination of the division by ret[3], things work fine either way as generation of 2 halves or as one half and its mirror along Z=0.