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.

DarkBASIC Professional Discussion / Help with curvevalue() and angles.

Author
Message
malcom2073
23
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 25th Sep 2003 22:35
I am trying to make something, which curves the value of an angle, so something rotates smoothly. If it is at angle 359, and I tell it to turn to angle 0, it turns all the way around isntead of going one more degree to 0. How do I do that?
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 25th Sep 2003 22:57
Use wrapvalue
Assuming you are using y angle:

angley#=wrapvalue(angley#)+1
or
angley#=wrapvalue(angley#)-1

depending if you want to rotate clokwise or anti-clockwise

this will wrap increments or decrements in the 0-360 range

span is at your wish: can be 10, 1, 0.1 ..whatever
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 25th Sep 2003 22:59
Correction:

angley#=wrapvalue(angley#+1)
or
angley#=wrapvalue(angley#-1)

sorry for the mistake
cheers
AnalSauceMonkey
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 26th Sep 2003 06:00
malcom2073
23
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 26th Sep 2003 08:19
Thanks, works great see my post in code snippits about the cute thing, tahts what I used it for

Login to post a reply

Server time is: 2026-07-25 08:29:00
Your offset time is: 2026-07-25 08:29:00