Jump to content

[HELP] "C" or "JAVA" FUNCTION


Go to solution Solved by North,

Recommended Posts

  • Bronze

Hello, i have a doubt about how works the function on videogames (cars) that does this:

'The car is stopped, so we can hear the engine sound; the car rise the revolutions, so the engine sound rise too.'

 

X = Number

Y =  Standard Sound

F = Final Sound

'Y' is altered by  'X' to emit 'F'

 

1e06c1893566bf95ba5d8f2d97cc3212.png

 

I made something similar to a graphic, just so you can understand me.

 

I wanna know, if someone might explain me how this function works on 'C' or 'JAVA'.

(I dont know about algorithms, neither about graphics, i have not followed rules, its just so you can understand me).

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Premium
  • Solution

Somebody correct me if I am wrong but what you are showing is a linear function and instead you want to solve an exponential one, before writing any code I would suggest to understand the math behind it otherwise you will be stuck again in no time

Here you go:

 

I personally follow this guy, is pretty good at explaining things

After watching this video try to imagine the sound intensity plotted as this exponential function where y=1 is the idle of the car you should get why you need an exponential function to represent the sound (when you press w to accellerate the sound increases in an exponential way and not in a linear way)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.