lfnetwork.com mark read register faq members calendar

Thread: AngleToVector Calculator
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 04-13-2008, 12:10 PM   #1
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
Arrow AngleToVector Calculator

AngleToVector Calculator


This tool will calculate the Orientation X and Y from an angle that you specify, I have also implemented a "VectorToAngle" function, which you can specify the X and Y coordinates and it will calculate the angle.
Click on the title to download ^.

Using the Calculator
I must also note how the calculator works in relation to KotOR.
KotOR uses an orientation system like so:
Quote:
Originally Posted by NWScript
The angle is expressed as anticlockwise degrees from Due East. DIRECTION_EAST, DIRECTION_NORTH, DIRECTION_WEST and DIRECTION_SOUTH are predefined. (0.0f=East, 90.0f=North, 180.0f=West, 270.0f=South)
Therefore, if you want your character to face north then the angle you need to enter is 90*, and for North-East 45*.

v1.4
Added an "Angle Chooser" where you can choose an angle from a wheel.
Automated it, so you don't have to click a "calculate" button.
Pratted around with the interface, since I'm arkward =P
Fixed the code so it doesn't crash when you type in letters because you think its funny.

v1.3
Numbers rounded to 6dp, also slight bug fix, where VectorToAngle will show angles > 180 as a negative angle.

v1.2
Calcalator now can convert a Bearing to an Angle.

v1.1
Calculator now also generates a bearing.

v1.0
First Release, program can calculate AngleToVector and VectorToAngle.


Any suggestions are welcome.


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront

Last edited by glovemaster; 05-28-2013 at 02:00 PM.
glovemaster is offline   you may: quote & reply,
Old 04-13-2008, 03:18 PM   #2
Ferc Kast
Modder
 
Ferc Kast's Avatar
 
Join Date: Jan 2007
Location: Tython
Posts: 1,586
Current Game: SWTOR
Helpful! Forum Veteran Contest winner - Fan Fiction Veteran Modder 
Wow; This should help a lot in one of my WIPs. Can't wait to try it out.

Ferc Kast is offline   you may: quote & reply,
Old 04-13-2008, 03:36 PM   #3
Silveredge9
Retired Modder
 
Silveredge9's Avatar
 
Join Date: Sep 2003
Location: United Kingdom
Posts: 710
Veteran Modder Forum Veteran Hot Topic Starter Contest winner - Modding 
Great tool, so far I've been using a list of X and Y coordinates that I found in an old thread for modding - But this is much easier. :P

Nice work.

Silveredge9 is offline   you may: quote & reply,
Old 04-13-2008, 04:05 PM   #4
sekan
Junior Member
 
sekan's Avatar
 
Join Date: Mar 2007
Location: Sweden
Posts: 418
Wow, this is making my work much much much easier.

Great work GM


[size=1] My mods | My webiste
Are you trying to foooooool me?
sekan is offline   you may: quote & reply,
Old 04-14-2008, 03:52 AM   #5
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
Just a quick update;
I have just added a box where it will generate the bearing, for placeables.

Also considering making a "BearingToAngle" part of the calculator.


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Old 04-14-2008, 11:11 AM   #6
Darth InSidious
A handful of dust.
 
Darth InSidious's Avatar
 
Join Date: Feb 2005
Location: The Eleven-Day Empire
Posts: 5,782
Current Game: KotOR II
Nice work - I wish this had existed when I started modding.



Works-In-Progress
~
Mods Released
~
Quid existis in desertum videre?
Darth InSidious is offline   you may: quote & reply,
Old 04-14-2008, 11:53 AM   #7
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
Proberly the last fix, I don't want to bloat the thing with unnecessary functions, I have finished the BearingToAngle bit, unless any bug fixes are required, thats the finished calculator


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Old 04-14-2008, 11:57 AM   #8
Marius Fett
Frigged if I know!
 
Marius Fett's Avatar
 
Join Date: May 2007
Location: Wales
Posts: 3,379
Verrrrrry nice GM!

This'll DEFINITELY come in handy!




Visit the new JediKnight.net!
Marius Fett is online now   you may: quote & reply,
Old 04-14-2008, 12:32 PM   #9
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,767
Current Game: FTL
Forum Veteran Helpful! Notable contributor 
There goes the motivation to learn trig functions.

Just a small suggestion: it'd be nice if any number with an absolute value < 1x10^-6 was rounded down to zero.


tk102 is offline   you may: quote & reply,
Old 04-14-2008, 01:07 PM   #10
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
So like, round the numbers to 6 decimal places? And I know what you mean about the stupidly small angles. I'll have em rounded to 0

EDIT:
14/04/08 Done that I also fixed a bug with the VectorToAngle part.


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront

Last edited by glovemaster; 01-29-2009 at 04:47 PM.
glovemaster is offline   you may: quote & reply,
Old 05-11-2008, 10:04 AM   #11
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
While playing about with the program interface today (Its been updated I might add ) I realised that something that was rather obvious to me might not be quite so obvious for someone will little programming or modding experience.

Using the Calculator
I must also note how the calculator works in relation to KotOR.
KotOR uses an orientation system like so:
North: 90*
East: 0*
South: -90*
West: 180*
Therefore, if you want your character to face north then the angle you need to enter is 90*, and for North-East 45*.

The same is found with the SetFacing() Function.
Quote:
Originally Posted by NWScript
// 10: Cause the caller to face fDirection.
// - fDirection is expressed as anticlockwise degrees from Due East.
// DIRECTION_EAST, DIRECTION_NORTH, DIRECTION_WEST and DIRECTION_SOUTH are
// predefined. (0.0f=East, 90.0f=North, 180.0f=West, 270.0f=South)

void SetFacing(float fDirection);


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Old 07-03-2008, 02:09 PM   #12
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
Update: Much more stable, included "Angle Chooser", Automated with error highlighting.

v1.4
Added an "Angle Chooser" where you can choose an angle from a wheel.
Automated it, so you don't have to click a "calculate" button.
Pratted around with the interface, since I'm arkward =P
Fixed the code so it doesn't crash when you type in letters because you think its funny.


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Old 07-03-2008, 03:41 PM   #13
sekan
Junior Member
 
sekan's Avatar
 
Join Date: Mar 2007
Location: Sweden
Posts: 418
Download link dosen't work for me


[size=1] My mods | My webiste
Are you trying to foooooool me?
sekan is offline   you may: quote & reply,
Old 07-03-2008, 04:29 PM   #14
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
Thats a problem on the host's side, nothing I can do about that
I'm guessing it will only be for a while, I can only suggest trying again some time later...


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Old 07-03-2008, 05:34 PM   #15
sekan
Junior Member
 
sekan's Avatar
 
Join Date: Mar 2007
Location: Sweden
Posts: 418
It's working again now


[size=1] My mods | My webiste
Are you trying to foooooool me?
sekan is offline   you may: quote & reply,
Old 05-28-2013, 02:01 PM   #16
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
I have updated the link for this as it has apparently been down for some years


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > T3-M4's Astromech Droid Center > AngleToVector Calculator

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:00 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.