• ### What is your GameDev Story?

#### Archived

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

# Control Point of geometrical object.

This topic is 5840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

If i had a geometrical object like cone, cylynder, sphere ..., and i want to conver it to a Bezier surface, How can i achieve the control points of the patches to make the surface? Regards Pedro Fuentes

##### Share on other sites
That's actually a pretty deep question, that will be difficult to answer in technical detail within the limited confines of a message board forum. I will offer some thoughts:

1. All of the objects you listed (cone, cylinder, sphere) have the basis of their shape as conic sections. For example, if you slice a cone straight through you will get either a circle or ellipse---that slice is a conic section. The cone and cylinder can be represented by a line swept through a circle (conic section) path. The sphere is a circle (conic section) revolved about a line.

2. Bezier surfaces cannot precisely represent conic sections in general. Why you ask? A Bezier surface defines a quadratic relationship between coordinates. For example, x and y are a function of t squared. But circles/ellipses (perhaps the most common conic sections used in geometric design) require a dual quadratic relationship, e.g., x squared is related to y squared, rather than x not squared related to y squared. Therefore, Bezier surfaces can only approximate most geometric surfaces based on conic sections.

3. There is an exception to #2. A parabola is also a conic section (see link below). If you have a geometric surface that is based on a parabola, then you can use a quadratic Bezier curve to represent that parabola exactly. Reason being, a parabola has exactly the same quadric relationship that Bezier curves can represent.

mathworld.wolfram.com/ConicSection.html

4. You could use other types of mathematical surfaces instead of Bezier surfaces. For examples, nonuniform, rational b-splines (NURBS) can exactly represent the shape of conic sections. But they are more difficult to work with than Bezier surfaces/curves, and there are parameterization issues.

4. The "idea" of representing a general geometric shape by parametric type ("sphere located at point p with radius r") is basically the exact same thing as representing the object with a constructive solid geometry (CSG) tree. And representing the object by a mathematic surface ("this Bezier surface") is basically the same thing as representing the geometry as a boundary representation (B-rep). There is a vast amount of literature that discusses conversion between CSG and B-rep. There are quite a few s/w toolkits out there for doing this, some free, some not free. Not free would be ACIS from Spatial Technology (www.spatial.com), Parasolid (www.parasolid.com), SHAPES from XOX Corporation (www.xox.com), Granite One from PTC, etc. Free would be OpenCASCADE (www.opencascade.com, www.opencascade.org), others that I can't recall right now. These are usually high end middleware used in CAD software for designing automobiles and turbojet aircraft engines and things, not games.

But...

5. Many of the 3d modeling packages used for creating game art also can create surface representations in Bezier or B-spline form from object type. For example, 3ds max has a patch object that is like a B-spline. It can be shaped to approximate a sphere or cone or whatever. Rhinoceros (www.rhino3d.com) is a decated NURBS modeling package. Certainly Maya, Softimage, Lightwave, even the open source package Blender (www.blender.org) support similar capability.

6. Source code for Blender is available for free, as its now open source!

www.blender.org

7. There is a book called "Open Geometry" that includes source code (with German language variables) that could be helpful.

8. Objects with discontinuities can't be represented by just one surface. For example, a cylinder has two end caps if you want it to be closed. That would mean you need 3 surfaces, one for the curved side, and one for each end.

9. In my opinion, if you have a limited number of object types, you might want to consider creating custom code, perhaps in a script language such as Python, to automatically create the surface representations for each object type. You can probably, with some digging, find sample code on the web. As I said, the Blender code may be a good place to start, since it has support for typical geometric shapes represented as Bezier or B-spline (probably B-spline) surfaces.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

[edited by - grhodes_at_work on January 23, 2003 11:06:44 AM]

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634092
• Total Posts
3015443
×