Everyday3d
Posted on 2008-06-16

Bend modifier – part II

Bend modifier – part II

This time, I post an updated version of the Bend class for Papervision3D that works with every simple DisplayObject3D – that is, a DisplayObject3D that does not contain any child objects.

First of all, thanks for the great feedback I got after the first post on bending. I really appreciate it.

UPDATE Sept 9th, 2008. The Bend modifier is now part of AS3Dmod library. Use that one instead of the class linked below.

Click here for a demo. The algorithm has been refined and the class public methods have been changed. Here's an updated use-case:

do3d = new SomeDisplayObject3D(); bend = new Bend(do3d); scene.addChild(do3d); bend.bend(Bend.X, Bend.Z, 2, 0.4);

The bend() method accepts four arguments, out of which the two first are new:

Now, I tried to write the theory behind those axes. I really did! But then this post was becoming boring and highly incomprehensible, so I gave up.

The best thing to do is to experiment with those setting. Each argument can take one of the three values: Bend.X, Bend.Y and Bend.Z. Different primitives will need different settings for the bending to look correct, but on the other hand, playing with them can lead to quite fascinating and weird-looking shapes, so be sure to try different combinations.

If you do not have time to experiment however, I created a special method, that magically bends the object the right way:

bend.quickBend(2, 0.4);

The two other arguments are 'force' and 'offset'. Both are described in detail in the source code. Additionally, I also published the source of the demo here. Have fun!

Back
More posts

Everyday3D is a blog by Bartek Drozdz

I started Everyday3d in 2007 with a focus web development. Over the years, I wrote about technology, graphics programming, Virtual Reality and 360 photography. In 2016, I co-founded Kuula - a virtual tour software and I work on it ever since.

Recently, I post about my travels and other topics that I am curious about. If you want to be notified about future posts, subscribe via Substack below.