Jump to content
  • Advertisement
Sign in to follow this  
ancestral

How to draw a tentacle ( deforming a cone )

This topic is 3803 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

Hi. I've been playing a bit with a glove to draw 3D objects. Now I 'm trying to draw a mesh that resembles a tentacle : I' ve came up with the idea of drawing a cone (it's easy) and then deforming it, something like in Blender you obtain applying a curve modifier to a cone along its height dimension. See image here: http://lh4.google.it/granturko/R9vGR6H19xI/AAAAAAAAAJ4/5tQv-VD3_SU/s144/tentacle.jpg This tentacle should be drawn from a first fixed point to another : moving the glove you can positionate and orientate it in the world. In other words the base point of the cone is fixed and the other is chosen moving around the glove. The problem is that I ve no idea of how to do this "deformation".... Any tips ? These are some ideas: - using a 3D spline and displaying along the curve many rings OR - displaying very close spheres along the curve OR - using some kind of custom triangulation algorithm ( Delaunay ?) The mesh should be created in real time... Any tips ? Thanks

Share this post


Link to post
Share on other sites
Advertisement
The other option is to use skinned animation. Rig the tentacle with a single chain of bones from base to tip. Then build the spline that you want to use for the current position. Compute the current frame's bones as though they were evenly spaced along the spline. Now just draw the tentacle, blended using those bone matrices. The main advantage over some of the other techniques is that the model itself will be a normal triangular mesh, so you can easily texture it, etc... Plus you'll never have to worry about holes or artifacts from overlapping rings/spheres.

Share this post


Link to post
Share on other sites
thank you very much for replies!

x FoxHunter2 : thanks for suggestion but actually I don't need an animation.
Indeed I want to CREATE the mesh in real time with the P5 glove. And after creation I would like to modify this shape by some control points (for example I could change the curvature of the tentacle )

Imagine you have a virtual brush you control with this glove and you can DRAW objects on a scene. A simple line for example : one point is fixed and the second point (you need at least 2 points to connect a line) is chosen with the glove. The glove coordinates in GLOVE WORLD are mapped into coordinates in 3D WORLD (the 3D scene).
At the same way you can draw a cone: this is easy because the glove position determines the height of the cone for example and moving the glove you see the cone changing in real time .

I can't use a model because this mesh is not fixed in dimensions.

x osmanb :
I'm using OGRE engine.
Could you explain what you mean by bones ? Do you mean the skeleton of a model created for example in Blender? Or do I have to create these bones in the program?

I guess your idea is right: I create bones along a spline and draw a mesh around. The problem is HOW to draw it ?
I mean I don't understand how performing what you say here:
Quote:

Now just draw the tentacle, blended using those bone matrices.



Share this post


Link to post
Share on other sites
Look up Skeletal Animation, which is essentially what osmanb described.

Alternatively (this approach is very similar to skeletal animation), you can represent your tentacle as a series of cones, where each cone's bottom is bound to the previous cone and each cone's top is a control point that you can move around. Then you can move these controls points around and your tentacle should twist. The problem lies in that if not done carefully, certain parts of the tentacle may appear to 'tear' from other parts.

Drawing a huge number of rings along a spline is possible, though I don't know that it's the best solution. Displaying very close spheres is also a possibility, but why not just use cones at that point? You definitely don't want to be doing Delaunay triangulation in real time.

Cheers,
--Brian

Share this post


Link to post
Share on other sites
I think I'll try skeletal animation.
So before starting I would like to ask you if the following steps are ok:

0) create a model in a 3D modeling tool. The model is a cone with a number of bones along its height.
1) load the model into OGRE
2) deform the cone through its bones using some controls (glove or keyboard)

I'm not sure on how to implement last step: I want to deform the tentacle in real time but the model has predefined bones of a certain dimension.
So I think I have to control the bones scaling them.
i.e : I want to create a long tentacle. I have to scale bones (say along X axis) so vertex groups are recalculated. Is it right?

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!