Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, alibaba, Quad), 761 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 2 1 2
Wind #29703
06/30/04 09:57
06/30/04 09:57
Joined: Aug 2003
Posts: 828
agreenknight Offline OP
Developer
agreenknight  Offline OP
Developer

Joined: Aug 2003
Posts: 828
I was just wondering, if I made like a cube of air, passible, and invisible, and it hit like models, how would the physic's engine take it? I would it be possible to simulate wind this way?


Keep It Simple, Make It Fun
Re: Wind [Re: agreenknight] #29704
06/30/04 13:40
06/30/04 13:40
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
The very notion of "Passable" is incompatable with Physics and thus any Physics Engine.
To my knowledge, the Passable entity should just go thru any entity.


To simulate wind quite effectively, you need nothing more than phent_addforceglobal.

Re: Wind [Re: fastlane69] #29705
06/30/04 18:05
06/30/04 18:05
Joined: Aug 2003
Posts: 828
agreenknight Offline OP
Developer
agreenknight  Offline OP
Developer

Joined: Aug 2003
Posts: 828
Thanks Fastlane

Okay, would it be the same with water?


Keep It Simple, Make It Fun
Re: Wind [Re: agreenknight] #29706
06/30/04 21:53
06/30/04 21:53
Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
Phantom88 Offline
Expert
Phantom88  Offline
Expert

Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
Quote:

Thanks Fastlane

Okay, would it be the same with water?



No Water doesn't affect the body if it isn't inside it(the water volume/box/plane...), and if it's only partially inside it it gets VERY hard. If you aren't a physics genious I wouldn't try to simulate water(unless you accept odd looking results...)

~Phantom88~


Programmer, Gamer ICQ #: 157485106 | Xfire: Phantom1988 | MSN: lauri_andler@hotmail.com | AIM: FinPhantom | YAHOO: FinPhantom
Re: Wind [Re: fastlane69] #29707
06/30/04 22:00
06/30/04 22:00
Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
Phantom88 Offline
Expert
Phantom88  Offline
Expert

Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
Just thought of an way to approximate wind that could work much better than addforceglobal. Heres what you should do:
1. Iterate troough all vertices of the model every frame
2. Apply a force in the opposite direction of the normal of the vertex(only if the normal faces the wind)at the vertices position.
Or alternate #2 (Don't know which )
2. Apply a force in the opposite direction of the bounce vector of the normal of the vertex and the winds direction(only if the normal faces the wind) at the vertices position

I think #2 should work...

That sounds very complex but i think it might work pretty well(No scientific proof whatsoever, just improvising...)

This would theoretically spin the modell with the wind, not just move it, but since it doesn't take into account the sizes of the faces(every vertex has an equally sized effect) it's very crude and i don't even know if it is mathematically correct or works at all, just throwing an idea...

~Phantom88~


Programmer, Gamer ICQ #: 157485106 | Xfire: Phantom1988 | MSN: lauri_andler@hotmail.com | AIM: FinPhantom | YAHOO: FinPhantom
Re: Wind [Re: Phantom88] #29708
07/01/04 03:02
07/01/04 03:02
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
1) ou still need phent_addforcegolbal (or addforcelocal) to apply the force at the vertices.

1) Just using even one Phen_addforceglobal call off-center will spin the model.

2) The phent_addforce commands add a force at a point, not to a face.


Not quite sure what we are gaining or doing diffrently in your examples.

Re: Wind [Re: fastlane69] #29709
07/01/04 03:06
07/01/04 03:06
Joined: Jun 2003
Posts: 161
Velorien Offline
Member
Velorien  Offline
Member

Joined: Jun 2003
Posts: 161
Couldn't you just use
var wind[3] = 20, 0, -386; // play with the numbers, x is the wind strength
ph_setgravity(wind);

To simulate the wind?

Re: Wind [Re: Velorien] #29710
07/01/04 03:27
07/01/04 03:27
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
I ported a wind system to c-script a few months ago. Check it out at the link. There's an example on how to use it with the physics engine:

http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Board=UBB3&Number=300853

It's much more complex than the simple(but still effective) way that Verorien offered. If all you need is a constant breeze in a given direction, then his way is all you need. Mine gives you a completely random system with gusts, stillness, direction change, and a direction indicator. It can also be setup for non-random behavior, though.

It's not nessarily the best way and it may or may not be all the efficient, but it's there for you to tinker with if you want.

Re: Wind [Re: Velorien] #29711
07/01/04 03:34
07/01/04 03:34
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Absolutly Velo.

Re: Wind [Re: fastlane69] #29712
07/01/04 11:22
07/01/04 11:22
Joined: Aug 2003
Posts: 828
agreenknight Offline OP
Developer
agreenknight  Offline OP
Developer

Joined: Aug 2003
Posts: 828
thanks,

is water hard because of the wind? How would you start that?


Keep It Simple, Make It Fun
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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