• Advertisement
Sign in to follow this  

Transform Geometry Using Curves/Splines

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've decided to play around with the idea of constructive transformed geometry for a project of mine (objects are created with geometric primitives that are transformed via an effect hierarchy). I was wanting to create a "Bend" effect, and the solution seemed quite simple to me, I just had to translate the vertices around a curve/spline. Here are two (ugly primitive programmer art) diagrams depicting the before and after. Before After The green object is the rectangle I'm attempting to transform, while the red line represents the curve/spline. Since the first image has no transformation applied, the curve is depicted as a straight line. The ugly blueish-green background is the result of my png transparency not coming out right for some reason [embarrass]. I'm going to implement this in 3D, but since the curve will only be transforming in two dimensions, it doesn't really matter. I can think of about two ways that it's possible to do this, but they both appear to be stupidly inefficient, and I'm sure there is a "Right Way"(tm) to do it. Can anyone point me in the right direction? Google, GameDev search (Google) and the (blessed) forum faq have provided no apparent pointers. [help] Thanks for your time, -Dave

Share this post


Link to post
Share on other sites
Advertisement
there is a thread going on about the more general 3d problem of deforming meshes.

http://www.gamedev.net/community/forums/topic.asp?topic_id=350629

I talked a bit about free form deformation there. and I think you could probably impliment this using a 2d bezier space(ie bezier surface) but I see what you're doing translating them about the spline there, and I think a 2d bezier surface free form deformation would give you more control, for example you could pinch as well as bend.

basically create a bezier patch around your geometry. re-express the verticies of your geometry in terms of the bezier (s,t). these are your new coordinates in bezier space. then simply move around the control points of your bezier surface as you see fit, and the shape will warp with the patch. this is basically like bending space around your object.

Tim

Share this post


Link to post
Share on other sites
Tim,

Thanks for your time and your reply. I think you're right, this should be a better and more flexible solution to my problem. Thanks again!

-Dave

Share this post


Link to post
Share on other sites
For a 2D curve, free-form deformation might be a reasonable choice, but in 3D, it is not intuitively clear how to relate control point motion to the curve shape. Usually, 3D free-form deformation is used for surface/volume deformations. (My preference for 2D and 3D is listed next.)

An alternative is to build a "tube" surface. You have a control-point curve, move the control points to obtain the shape that you want for the curve, and then select curve points at regular intervals along the curve. At each curve point, construct a closed polygon whose "center" is at the curve point and which lies in the plane perpendicular to the curve. This "cross section" may be circular, but you can make it whatever simple polygon you like, whether convex or nonconvex. You then connect up the cross sections with triangles to form the surface mesh. Implementations of this, and other deformation methods, are at the physics page at my web site.

This method also applies to 2D curves, whereby you select curve points and then choose two points on either side of the curve and on the line perpendicular to the curve at the point.

When you attempt to choose the points in a single pair to be equidistant from the curve, the final 2D object has a boundary for which the curve is the "medial axis" of the object (well, the computer algorithm is a numerical approximation to such a beast). The same can be said for the 3D algorithm, and the curve is the medial axis of the tube object. In general, attempting to build an offset surface from a "medial set" (set contains points, curves and/or surfaces) is something researchers have tried from time to time. A bit of a challenge to implement, but tractable. At any rate, I thought I would mention the concept "medial" in case you want to do an Internet search on the topic.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement