set_polar() - Script Documentation
30 posts
• Page 1 of 3 • 1, 2, 3
set_polar() - Script Documentation
This is the Script Documentation page. For my recent script. set_polar(), It can be found in the Online Resources, and can be downloaded from within GtunerIV
void set_polar(uint8 X, uint8 Y, fix32 ANGLE, fix32 RADIUS)
- X: Axis Identifier. STICK_1_X for the right stick. STICK_2_X for left.
- Y: Axis Identifier. STICK_1_Y for the right stick. STICK_2_Y for left.
- ANGLE: A value between 0.00 - 360.00.
- RADIUS: A Value between 0.00 - 100.00
I'm sure everyone is familiar with the Cartesian Coordinate system.
Well, there are multiple ways to assign both X and Y values to a plot.
The Polar Coordinate system is one of the alternatives, Sadly not many utilize this system.
void set_polar(uint8 X, uint8 Y, fix32 ANGLE, fix32 RADIUS)
- X: Axis Identifier. STICK_1_X for the right stick. STICK_2_X for left.
- Y: Axis Identifier. STICK_1_Y for the right stick. STICK_2_Y for left.
- ANGLE: A value between 0.00 - 360.00.
- RADIUS: A Value between 0.00 - 100.00
I'm sure everyone is familiar with the Cartesian Coordinate system.
- Code: Select all
main {
// Cartesian coordinates
set_val(STICK_1_X, 70.70);
set_val(STICK_1_Y, -70.70);
}
Well, there are multiple ways to assign both X and Y values to a plot.
The Polar Coordinate system is one of the alternatives, Sadly not many utilize this system.
- Code: Select all
main {
// Polar Coordinates
set_val(STICK_1_X, cos(deg2rad(-45.00)) * 100.00);
set_val(STICK_1_Y, sin(deg2rad(-45.00)) * 100.00);
}
-
DontAtMe - Captain
- Posts: 502
- Joined: Tue Oct 02, 2018 4:49 am
Re: set_polar() - Script Documentation
Great work as always, well done.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
- Mad
- Major General
- Posts: 4533
- Joined: Wed May 22, 2019 5:39 am
Re: set_polar() - Script Documentation
DontAtMe wrote:The Polar Coordinate system is one of the alternatives, Sadly not many utilize this system.
Agree. I use polar quite often, very useful in many situations.
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: set_polar() - Script Documentation
DontAtMe wrote:This is the Script Documentation page. For my recent script. set_polar(), It can be found in the Online Resources, and can be downloaded from within GtunerIV
void set_polar(uint8 X, uint8 Y, fix32 ANGLE, fix32 RADIUS)
- X: Axis Identifier. STICK_1_X for the right stick. STICK_2_X for left.
- Y: Axis Identifier. STICK_1_Y for the right stick. STICK_2_Y for left.
- ANGLE: A value between 0.00 - 360.00.
- RADIUS: A Value between 0.00 - 100.00
I'm sure everyone is familiar with the Cartesian Coordinate system.
- Code: Select all
main {
// Cartesian coordinates
set_val(STICK_1_X, 70.70);
set_val(STICK_1_Y, -70.70);
}
Well, there are multiple ways to assign both X and Y values to a plot.
The Polar Coordinate system is one of the alternatives, Sadly not many utilize this system.
- Code: Select all
main {
// Polar Coordinates
set_val(STICK_1_X, cos(deg2rad(-45.00)) * 100.00);
set_val(STICK_1_Y, sin(deg2rad(-45.00)) * 100.00);
}
How do you increase the time it takes to complete one rotation?
-
GamingScene - Sergeant Major
- Posts: 104
- Joined: Sat May 26, 2018 6:17 pm
Re: set_polar() - Script Documentation
GamingScene wrote:How do you increase the time it takes to complete one rotation?
Example.
- Code: Select all
#define SPEED 0.01 // Raise this value for faster Rotation.
const fix32 radius = 50.00;
fix32 angle;
main {
angle = mod(angle += SPEED, 360.00);
set_polar(STICK_1_X, STICK_1_Y, angle, radius);
}
-
DontAtMe - Captain
- Posts: 502
- Joined: Tue Oct 02, 2018 4:49 am
Re: set_polar() - Script Documentation
DontAtMe wrote:GamingScene wrote:How do you increase the time it takes to complete one rotation?
Example.Super Slow
- Code: Select all
#define SPEED 0.01 // Raise this value for faster Rotation.
const fix32 radius = 50.00;
fix32 angle;
main {
angle = mod(angle += SPEED, 360.00);
set_polar(STICK_1_X, STICK_1_Y, angle, radius);
}
EDIT Fixed it
Hi thanks but it comes up with this error
- Code: Select all
GPC: Second-pass started.
GPC error: blank.gpc(9): Identifier not declared 'set_polar'.
GPC error: blank.gpc(9): Illegal operation 'arg:1'.
GPC error: blank.gpc(9): Illegal operation 'arg:1'.
GPC error: blank.gpc(9): Illegal operation 'arg:1'.
GPC error: blank.gpc(9): Illegal operation 'arg:1'.
GPC error: blank.gpc(9): Illegal function call, near ')'
GPC: GPC Build ABORTED with 0 warning(s) and 6 error(s).
Last edited by GamingScene on Thu Jan 09, 2020 9:56 am, edited 1 time in total.
-
GamingScene - Sergeant Major
- Posts: 104
- Joined: Sat May 26, 2018 6:17 pm
Re: set_polar() - Script Documentation
GamingScene wrote:Hi thanks but it comes up with this error
You need the include the set_polar() function from DontAtMe's script in the online resource section.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
- Mad
- Major General
- Posts: 4533
- Joined: Wed May 22, 2019 5:39 am
Re: set_polar() - Script Documentation
Any future plans on Xim Support?
YouTube /Gjin Yuko
Facebook /Gjin Yuko
Twitter /Gjin Yuko
Discord /Gjin Yuko
Xbox /Gjin Yuko
Playstation Dont have one, Xbox is the better Console
Facebook /Gjin Yuko
Twitter /Gjin Yuko
Discord /Gjin Yuko
Xbox /Gjin Yuko
Playstation Dont have one, Xbox is the better Console
-
Gjin Yuko - Sergeant Major
- Posts: 95
- Joined: Mon Aug 05, 2019 10:00 pm
- Location: Germany
Re: set_polar() - Script Documentation
What are some applications for using this?
-
UK_Wildcats - Brigadier General
- Posts: 2243
- Joined: Thu Jan 08, 2015 6:53 pm
30 posts
• Page 1 of 3 • 1, 2, 3
Return to User's Script Documentation
Who is online
Users browsing this forum: No registered users and 96 guests