Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!amdahl!pyramid!decwrl!labrea!csli!rustcat From: rustcat@csli.STANFORD.EDU (Vallury Prabhakar) Newsgroups: comp.graphics Subject: Re: Defining a sphere with Bezier patches Message-ID: <3183@csli.STANFORD.EDU> Date: 30 Mar 88 03:29:48 GMT References: <2390@saturn.ucsc.edu> <1632@pixar.UUCP> <1639@pixar.UUCP> <3150@csli.STANFORD.EDU> <209@granite.dec.com> Reply-To: rustcat@csli.UUCP (Vallury Prabhakar) Organization: Yonder, the Apocalyptic Horizons Lines: 87 Keywords: sphere, Bezier, REYES In article <209@granite.dec.com> jmd@granite.UUCP (John Danskin) writes: # Ah, but what if your modeler only supports Beziers? And, what do you mean # by more efficient? # # o Takes up less space # o Easier to do ray surface intersections # o Easier to tesselate into polygons on the fly # o Better numerical characteristics # o Bounding box generations on subsets of the sphere are easier # o Your sphere modeler needs less total code space # # # Since you don't win on all of these measures, your posting would be more # helpful if you were more specific. This is true. I was speaking strictly from a modelling point of view. Sorry for not being more specific. Of course if you modeller can produce only Bezier approximations, then there is nothing to discuss here, is there? 1) Space ----- I haven't tried it, but it seems to me that the surface of revolution method would win over the Bezier approach in terms of computational efficiency. Consider the Bezier method. Assuming that you're using a bicubic representa- tion, you will need a 4 x 4 matrix for each of the geometric matrices Bx, By and Bz. That makes it 3 matrices of order 4 at least. Generating the entire sphere using a bicubic approximation is bad for health. You'd need to break it down into at least 4 patches. Figuring out details to ensure that the patches are C^n continuous (n = 0, 1 and 2 if you wish) is going to take up time. In contrast, the surface of revolution method needs only a single arc which may be stored as a single vector. Generating the surface from this would also be much faster than using Bezier patches with all the considerations above. 2) Ray surface intersections ------------------------- I'm not too familiar with shading in computer graphics. I was speaking strictly from a modelling point of view. However I assume that these ray-surface intersections will be necessary for shading and probably hidden line removal computations. Once again, I think the surface of revolution approach (SOR) is better. You've got (at least) 4 patches in the Bezier approximation to deal with and the algorithm will be messy. In the SOR method, you can easily determine whether and where the ray will intersect the surface. In general, the properties of the surface in the SOR method are simpler to calculate. Also, (I think) calculations of reflected light etc., for shading involve trignometric functions and this would be in the spirit of the SOR method. Or rather, vice versa. 3) Numerical characteristics (Accuracy?) ------------------------------------- The SOR method wins again. The error from the Bezier method will get magnified as we go from a 1-D curve to a surface. This error will probably not increase as you increase the number of patches, since symmetry of the spherical surface can be used. The SOR method is exact. 4) Polygonisation -------------- The Bezier approach is probably better with reference to the characteristic Bezier polygon. After all, the basic method of generating the surface is via these characteristic polygons. On the other hand, if you need to have polygons that are different from the above then I don't see how either approach is better. A polygon can be generated as a patch in the SOR method by considering small ranges of the two characteristic angles, but generating patches over the entire surface will take time, depending on how fine or coarse your net needs to be. I don't know which approach would be faster. 5) Bounding boxes -------------- I have no idea whatsoever. 6) Total code space ---------------- From the above points, the SOR approach will produce cleaner and shorter code. For all of the above reasons, I think that the SOR approach is a more "efficient" method of generating a spherical surface. -- Vallury Prabhakar -- rustcat@cnc-sun.stanford.edu