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.

Newcomers DBPro Corner / Curve value

Author
Message
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 3rd Dec 2003 20:50
Hey i cant get curve value to work!!!!
COuld someone explain it to me!?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Dec 2003 21:29
Example code:



Simply put, the first number that you provide is your destination value, the second is your current value, the third is the number of step to take between these two values.

So in the example code we feed in (600, 0, 4) and it gives us a value of 150, which is 1 fourth of the way between the destination and current positions.

The next loop we feed in (600, 150, 4) and it gives us a value of 262.5, which is 1 fourth of the way between the destination and current positions ... repeat until you get to the target position

I'm not too sure I explained that very clearly. Let me know if you need anything cleared up
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 4th Dec 2003 06:48
IanM did a good job, explaining it, but I will put it in my words just in case.

You use the curvevalue command to bring a value closer and closer to a value that you want it to be. Using the curvevalue command with a constant rate value will make the number that you are changing change quickly at first, then slower and slower as it nears its destination. IMPORTANT: a smaller rate value means that the number will approach the destination value more quickly, a larger rate will do it more slowly.

I have figured out how to make the curvevalue command adjust a number to its destination at a constant speed. Just use the distance between the number and its destination as the rate of speed. Just thought I would let you know that.

The curvevalue command is best used in a loop, mainly your main do...loop, it should modify a number continuously so it gets closer and closer to its destination. That is how it was meant to be used, however, you can use it however you want.

Good Luck

Xander - Bolt Software

Why do the antagonists always have to look so cool?

Login to post a reply

Server time is: 2024-11-25 19:26:10
Your offset time is: 2024-11-25 19:26:10