Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, aliswee), 835 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Wind simulator...UPDATED...9/29/03.. #17266
09/20/03 15:22
09/20/03 15:22
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
What exactly are the varying techniques, others have used, for creating wind? There isn't much talk about it and a search gives me 5000 hits because of the word "window".

I'm trying to develop a wind system that is totally random..somthing fast and somewhat simple that will affect models. Say I want a hanging light or a tree to sway in the breeze, but the sway should be totally random and dependent on the wind direction(and changes in direction). I suppose it could be coded for each entity as an action and assigned to the individual entity, but I like the idea of a global wind that is independent of the entities(or is it?) for whatever insane reason.

This almost sounds like a physics issue, though I haven't dove into that crazy place, yet.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Creating wind... [Re: Orange Brat] #17267
09/20/03 16:30
09/20/03 16:30
Joined: Jan 2002
Posts: 644
USA
tesanders Offline
Developer
tesanders  Offline
Developer

Joined: Jan 2002
Posts: 644
USA
Interesting problem.

I've added wind effects to my script, but only to blow the player around the map, along with some debris. Both of those are, of course, relatively simple.

Speaking as someone who also hasn't touched the 3DGS physics package, it seems that that might be usable for rigid bodies such as your lanterns, (e.g., fix the top point and apply a changing force over time to the lantern's bottom point). As trees aren't rigid bodies, they may require a different approach.

As a simple trial, you could model a single reed using vec_for_mesh/vec_to_mesh to adjust the reed's vertices over time. Have it bend slightly in the direction of the wind by moving all the vertices in that direction to varying degrees. Move the vertices at the top of the reed farther than you move the ones towards the bottom, (i.e., make the lateral translation proportional to both the speed of the wind and the distance between a vertex and the model's base).



vec_for_mesh() gives you coordinates, so it's possible to calculate where a vertex is in relation to the model, (and thus, you can tell the tree which vertices to move). As things often bob back and forth in the wind, you could also add some sinusoidal factor in there.

Then there's always bones animation, which is probably handier than tweaking individual vertices. And finally, simply animating a tree's .mdl so that it rustles is the least computationally expensive. Of course, it's 3:30am, so I have no idea whether this makes any sense, but that never stopped me from talking.

Re: Creating wind... [Re: tesanders] #17268
09/20/03 22:27
09/20/03 22:27
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
It all makes sense...it's just new found territory for me...I haven't messed with models very much and this wind thing is just on the to do list. I think all of the different methods are relevent for given situations and my global wind is probably too taxing(on lesser systems) to consider unless used sparingly.

I'm more interested in realistic motion, I suppose. I have two map entities(not models, not sure why I said models)...a sign that sways and a light that hangs from the ceiling that should move with the breeze coming though an open window.

I have one physics object to play with, since I have commercial, so I'll mess with that since these are rigid bodies. This should be a laugh riot.

EDIT: Got it to actually work...no wind but the entity moves exactly how I want it to visually. Of course it needs a bit of wind to make the motion random. I like the physics engine...nice stuff....I can see how someone could get carried away with it.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Creating wind... [Re: Orange Brat] #17269
09/21/03 00:34
09/21/03 00:34
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
hmmmm, I think that if you don't want it as an action to the stuff that is supossed to move in the wind, I'll guess the only way is to animate the models and add an interesting wind noise to give you the feeling that there is wind....
It's all about faking it, when you really want to program it, I think that it really WOULD slow things down much.... However it's an interesting thing; maybe just to mess around a bit someone could combinate clever coding for the wind with the tree-generating code.....(easy when you just animate the model.....)
mmmm I wonder how they do winds in games like Delta Force: Black hawk down .....................


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Creating wind... [Re: PHeMoX] #17270
09/21/03 01:05
09/21/03 01:05
Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
myrlyn68 Offline
Senior Expert
myrlyn68  Offline
Senior Expert

Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
Most game systems don't animate the objects prior to being put into the game. They will use some form of mesh deformation in order to achieve the desired result. Take a look at GameDev.com's "Earth, Wind, Fire and Water" contest for a few different examples.

What it mostly comes down to is making sure your script can somehow identify an objects overall stiffness (perhaps using a skill), and its spring back. Then you apply a few different algorithms to it (there are a few choices on GameDev - I will look for the links again a bit later if needed), which take both of those factors into account. Most can be translated into c-script relatively easily. This than will dictate how far certain models will bend and sway with the wind force applied.

Another option is to use an invisible particle system and use those particles to be your wind force. This has a few advantages, as it is easier to represent calm areas on a level (behind buildings for example). Again though, it still requires a certain ammount of information to be stored within the meshes to be affected. Gets to be quite processor intensive though.


Virtual Worlds - Rebuilding the Universe one Pixel at a Time. Take a look - daily news and weekly content updates.
Re: Creating wind... [Re: Orange Brat] #17271
09/21/03 14:07
09/21/03 14:07
Joined: Jan 2003
Posts: 748
California
BHoltzman Offline
Developer
BHoltzman  Offline
Developer

Joined: Jan 2003
Posts: 748
California
I had this idea that may or may not work for wind effected objects. Vue 4 Pro is out and it will let you animate plants that you design and you can export the plants as 3d models. The idea is to take a couple of animated plant models and put them into WED so that we can fake a wind but make it look really good! Although the models are probably going to be too polygon heavy.

If anyone knows any more about whether vue 4 pro will work well in this situation, I'd love to hear from you.

From,

Ben


I'm not Mr Franklin but I am Benjamin. My avatar partly suites me.
Re: Creating wind... [Re: myrlyn68] #17272
09/21/03 14:25
09/21/03 14:25
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Faked blowing via well done animations(different ones) are probably the way to go for us little people. The physics engine path has potential if I can get the thing to work(see physics section thread). I think I have it set up properly, but lack of coherent examples and good documentation are not in vast supply. This section of the manual needs a lot of attention.

I took a look at some of the Gamedev demos...some interesting stuff, though I have yet to find any with source code I can open. I'll search again when I find the time.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Creating wind... [Re: Orange Brat] #17273
09/21/03 14:33
09/21/03 14:33
Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
myrlyn68 Offline
Senior Expert
myrlyn68  Offline
Senior Expert

Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
I agree with you their - but animations come with a number of restrictions that brute force code can overcome. The biggest problem would be varying things from a small breeze to a brisk wind to a hurricane.

Also you have to be careful with your orientation of models, which will cause you to either create more models, or have a bunch of cookie cutter models.

One thing you might also look into as opposed to messing with all the vertexes (and I should have emntioned it before - since I am currently examining the feasibility between 20 or so other things ) is the use of bones. This will give you a hinge in your model already - then you just assign a few skills and a variable that gets set by the weather man, and you should be able to pull off swaying lanterns, trees, grass... Though bones require a bit of CPU time to calculate the position of the vertexes... Ah well - bump up those minimum requirements, and you are good to go.


Virtual Worlds - Rebuilding the Universe one Pixel at a Time. Take a look - daily news and weekly content updates.
Re: Creating wind... [Re: myrlyn68] #17274
09/24/03 16:12
09/24/03 16:12
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
@myrlyn68:

Thanks for that link over in George's AUM29 thread. There's one really nice example with fairly easy to follow C++ source, and it reads like c-script. It's basically the guts of a simple wind system and can be integrated into the technique tesanders described above.

EDIT: <Code moved for clarity>


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Creating wind... [Re: Orange Brat] #17275
09/24/03 21:41
09/24/03 21:41
Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
myrlyn68 Offline
Senior Expert
myrlyn68  Offline
Senior Expert

Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
Very good link if I don't say so myself. I'll take a closer look at the C++ after I have a bit more coffee this morning to see if I can't figure out the c-script translation for it.

In regards to the method above, don't forget using bones for more rigid bodies (the lantern in your physics example). It would require a bit more code, but should provide a nice effect.


Virtual Worlds - Rebuilding the Universe one Pixel at a Time. Take a look - daily news and weekly content updates.
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