Cloth simulation

Blitz3D Forums/Blitz3D Programming/Cloth simulation

aCiD2(Posted 2004) [#1]
Hey,

All goign well so far, i've got a mesh plane with sphereical rigid bodies setup for each vertex (cant use one rigid body per plane, with geom for each vertex saddly because sweenie hasnt wrapped any tokgeom_getx funcs).

Now, im just about to start work with setting the joints for this rigid bodies, and the image below should explain what i mean. But im not sure how to check where to join to. As you can see vertex 0 only joins onto vertex 1 and 5, and vertex 5 only joins onto vertices 6, 0 and 10.

What im having trouble with is working out the directions of the joins, which should be applied where. Its ok for the bottom vertex, i can work them out, but im not sure on the others. :\ Any help really arpiciated (excuse spelling ;) )

Heres the pictures:

How the vertices are laid out


Rigid bodies in green, joints in red and the problem that i need to solve in blue (joints like that shouldnt be made


Oh, I'm also guessing that I'm going to need to use Mod and stuff to work out where the vert is?


Jeroen(Posted 2004) [#2]
could you...euh...please trace the image or sumthing?


Rob(Posted 2004) [#3]
Look up flex in code archives.


aCiD2(Posted 2004) [#4]
thanks rob :)


aCiD2(Posted 2004) [#5]
wait... afraid that doesnt help me :) i basically need some way to check enighbouring vertices - for existance


Rob(Posted 2004) [#6]
To work out where each vert is:

surf=getsurface(mesh,1)
For i=0 to countvertices(surf)-1
tformpoint vertexX(surf,i),vertexY(surf,i),vertexZ(surf,i)
xpos# = tformedx() : ypos# = tformedy() : zpos# = tformedz()
next

:)


aCiD2(Posted 2004) [#7]
Ahhh! So i should get positions of each vert, then do checks?
I was hoping there could be some kind of more 'real time method' consisting of one for loop :P oh well :)