Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / direction theory for a flag.

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Jun 2008 16:09 Edited at: 3rd Jun 2008 16:26
Hi All

we have this command,
phy set cloth external acceleration id x#,y#,z#

now I am trying to see how to take the information that my weather station gives me into that command.

the station gives me wind speed as here.windspeednow which is in knots
here.winddirection which is given as 0.0 for north up to 16.0 which is north again, so 7.0 is south.

so which bit should do which
x# is for ??
y# is for ??
and z# is for ??
thinking some thing like this
if here.winddirection = 10.0 (west)
phy set cloth external acceleration id -here.windspeed,0,0
endif

the above did not work.

what do you think.

edit
here how I am thinking of doing it



Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Jun 2008 21:04
No one have any ideas.

Dark Physics makes any hot drink go cold.
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 4th Jun 2008 21:39
It should be simple:
- Convert your scale (0-16) into angles (0 to 360): 360/16 = 22.5
- Apply the forces using sin and cos, by multiplying your number




p.s. Shouldn't South be at 8.0 since it is in the middle?

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Jun 2008 01:39 Edited at: 5th Jun 2008 01:40
Thanks Kendor.

Sure help's to know you sin/cos, worked how it should even if it is a bit slow, dew to only 3fps as it has to go to sleep to let the weather station send a signal to it.

ps. your right about 8 begining south can't count either.

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Jun 2008 12:13
@Kendor

Note of interest when the weather station was sending data to the computer it sometimes goes a bit wrong so I was getting wind speed of about 72,000 knots, well your flag code took it OK, the visual result where something else, I had one very tight stretched flag more like rubber than cloth.

will be looking into either finding away to limit the strecting or making it tear.

cheers for your bit of code.

Dark Physics makes any hot drink go cold.
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 5th Jun 2008 20:24 Edited at: 5th Jun 2008 20:26
72,000 knots? That's really a windy day

To solve that problem just check whether the value is within the limit or not. Example: if the maximum wind you need is 100.0, just perform a check like this, before applying the force:

if windspeed# > 100.0 then windspeed# = 100.0

In case the cloth behaves like "rubber" even in normal wind conditions, you can just take a proportion of your value. It will still move proportionally to the wind values, but will be more natural.

windspeed# = windspeed# * 0.7

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Jun 2008 23:35
Yes I am think of finding the maxs value it works with then seting a limit for it.

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2024-11-24 23:52:56
Your offset time is: 2024-11-24 23:52:56