Bendable Objects

Started by
3 comments, last by ET3D 14 years, 5 months ago
I am looking into a possible feature that a client wants on our application, and the concept revolves around a "spore" like area where rectangles are swimming around the screen by themselves. So the rectangles bend around as they turn directions, almost like they have a spine. Ive got XNA available to me, and am familiar with 3D concepts, having done some 3d work before. But what exactly makes up this type of effect? Do you just apply normal 3d transformations to a mesh to "bend it", I have to make sure that it behaves like a little worm/fish thing. Any thoughts/articles are welcome! Thanks Mark
Advertisement
Hi,

Would it work to just have an animated mesh with the bending already calculated and then run the animation at different rotations when it needs to turn?
Honestly, im not sure, I guess so, it would need to be tried and tested to really see if that implementation works.

Do you have any ideas?
Start with something simple. Take a cyclinder and bend it over 5 seconds in a 3d program. Save it to .x format then load and run it with an animation controller. Play around with it until you thinks it's right, or not.
You could use a simple bone system. The idea of a bone system is that vertices are affected by more than one transformation matrix. Each vertex has weights which define how much they are affected by each matrix. It's then multiplied by each matrix and the result is multiplied by the weights. The sum of that is the transformation of that vertex. You can google for more info.

In the case of rectangles, first make sure that they have enough vertices (are a detailed enough grid, and not just two triangles). You can use two-triangle rectangles for all the rectangles which aren't bending at the particular moment.

You have two transformation matrices, which are the directions before and after the rectangle rotates.

Now you have to apply them to the vertices, which is where it gets hazy, because I haven't tried this. Assuming that your triangles have vertex coords in the range 0 to 1, I think you'd be able to use them for weights. However, if the direction of the crease is arbitrary, you won't be able to use them directly, and will have to do some combination of them which depends on the rectange's rotation. That'd require some trial and error, but I think it can be done.

This topic is closed to new replies.

Advertisement