Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Poor man's cloth #463044
11/11/16 19:35
11/11/16 19:35
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline 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 laugh

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 Offline
Senior Expert
3run  Offline
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 grin ). 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 laugh

Best regards!

Edit: here is the video I was talking about:
Superku 17.02.2012 - Cape Physics


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Poor man's cloth [Re: 3run] #463052
11/12/16 10:57
11/12/16 10:57
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Yeah, I don't think a sophisticated cloth simulation is useful for game development.
I watched this guy a few times on twitch: http://stoutgames.com/:cheongsam
He developed a physics based cloth simulation for his lady character. It was months of work, and from both a (CPU) resource and time perspective not worth the effort for any other normal game.

I've recently remade my cape physics because that old one was a little antiquated with a few drawbacks. The basic principle stayed the same, except no ent_animate anymore, just vertex shader rotations and deformations, based on lite-C parameters.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Poor man's cloth [Re: Superku] #463075
11/13/16 20:07
11/13/16 20:07
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Why not to use the pXent_cloth function?


Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: Poor man's cloth [Re: rojart] #463089
11/14/16 21:22
11/14/16 21:22
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
hi friends!

I didnt want a cloth sim that was comprehensive, usually because its never done this way in games. Even at the tail end of a coat or skirt, the simulation is so bareboned and has so many things to prevent it from exploding. But I was just curious to see if it was possible, mainly to get a network of particles to tug on each other. Using vec_dist, you can make spherical collision forms to push the particle out and etc laugh

Re: Poor man's cloth [Re: jumpman] #463093
11/14/16 22:50
11/14/16 22:50
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
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.

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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: jumpman
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 grin

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: jumpman
Using vec_dist, you can make spherical collision forms to push the particle out and etc laugh

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
Re: Poor man's cloth [Re: WretchedSid] #463097
11/15/16 00:54
11/15/16 00:54
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
hey wretchedSid!

I have actually done 2 verlet particles that were actually able to pull on each other! The problem was that I didnt know how to get them running in time_step, as well as getting a chain of them linked to each other frown


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1