Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Adjusting Grass / Wind speed

niko
Moderator
Quote
2017-02-25 04:46:26

Because I was asked this a few times alreay via mail: Did you know you can adjust the Grass / Wind speed dynamically? You can do this in the Windows .exe and Mac OS X .app target easily, because all properties shown in the property window are available automatically in JavaScript. Use code like this:

var  r = ccbGetRootSceneNode();
ccbSetSceneNodeProperty(r, "WindSpeed", 2.0);
ccbSetSceneNodeProperty(r, "WindStrength", 5.0);


Works of course only if you have checked that 'Wind' property in the root scene node.


rolevix
Registered User
Quote
2017-02-25 11:27:31

Is this means if i use this script i can set Wsp and Wstr on each node? It's good


niko
Moderator
Quote
2017-02-25 17:41:06

No, it's global, you only set it once and it affects the whole scene.


Robo
Guest
Quote
2022-05-10 11:20:49

Yes, but I found changing either one during runtime will reset the plants to their starting position so if you do this a lot with changing wind speeds will jerk them around a lot and look terrible.

Niko, can this be fixed so no resetting occurs ?


count2rfeit
Registered User
Quote
2022-05-11 17:38:08

I had the same problem with changes during runtime - so I finally didn't use it.
Would be great if this could be fixed...


just_in_case
Moderator
Quote
2022-05-11 22:35:26

If you guys want you can try using my Custom wind Shader, that Allows you to have more control over the wind.

Maybe you can try changing the speed or other parameters of the default wind shader, by send a different value for the global variables of the wind and use 26 as the base material when creating new material out of it. So that it won't reset and can use the variables independently.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inter?ational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact