1 registered members (AndrewAMD),
559
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Poor man's cloth
#463044
11/11/16 19:35
11/11/16 19:35
|
Joined: Apr 2002
Posts: 1,246 ny
jumpman
OP
Serious User
|
OP
Serious User
Joined: Apr 2002
Posts: 1,246
ny
|
Hi everyone For a poor man's cloth simulation, how would you iterate through each vertex of a 3d model, then assign each vertex "neighbors" to push and pull? Is there any function or way to see if one vertex is the neighbor of another? if they share the same edge, or same triangle? this is more of a just for fun thing instead of something that is important. I have done very simple cloth before in A6, but it was very inefficient and I dont dare to use the code again. What I did was just create an object for every single vertex of a 3d model, then cause these objects to move the mesh with vec_for_mesh. These objects had no neighbors/links. Getting a single vertex to have "links" to other vertexes are the crux of cloth simulation, and I was wondering if you had any ideas
|
|
|
Re: Poor man's cloth
[Re: jumpman]
#463048
11/11/16 20:09
11/11/16 20:09
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Hi! I remember Superku made something similar for his game. He used shader as far as I remember, look at his project's thread, or maybe you could PM him (or maybe he will see this topic, and will answer here ). Anyway, you could recreate your code from A6 in A8, but use 2d array intead (just a wild idea), something similar to fluidfill algorithm, where everything is seperated into the cells, and they are all connected between each other... Anyway, I'm just guessing Best regards! Edit: here is the video I was talking about: Superku 17.02.2012 - Cape Physics
|
|
|
Re: Poor man's cloth
[Re: jumpman]
#463094
11/15/16 00:01
11/15/16 00:01
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
by the way, anytime I run a physX cloth sample, either the flag sample that came with A8, or someone else's physX cloth, the cloth just disappears! Its like its a glitch. I can see that the other physics objects like the ball works and bounces around, but the cloth disappears. Any idea as to what could be happening? Ive included the correct includes and phys open and etc. Same happens on my new PC... It disappears (I guess it's drawn by forces or something like that). GeForce GTX 750 Ti. I'm also interested to find out why this happens Best regards!
|
|
|
Re: Poor man's cloth
[Re: jumpman]
#463096
11/15/16 00:48
11/15/16 00:48
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Using vec_dist, you can make spherical collision forms to push the particle out and etc You would probably have more success running some form of Verlet integration on your vertices. I have to admit, I've only ever done ropes doing that, but you should still get very good looking results with it. As to finding neighbours, the easiest way is to probably iterate over every vertex and figure out which ones are within X distant and storing that in some kind of lookup table so that you can quickly iterate over your nodes afterwards. The easiest (and least efficient, but who cares if you only ever do it once) method is to just iterate over every vertex and then have an inner loop going over every vertex again checking their distance.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|