@griges so, you need variables first for where you are headed. im gonna call these (a,b,c) this is the location of wherever you wanna go. and im not gonna use c, because I only care about horizontal distance atm.
.
The variables of your plane are Longitude, Latitude, Altitude and Heading. imma call these (x,y,z) and theta (theta for angle).
.
to find the vector between you and your destination distanceX = a-x distanceY = b-y
.
Also I wall call the length of the vector between you and destination magDist. this is just sqrt(pow(distanceX,2) + pow(distanceY,2)) think a^2 + b^2 = c^2
.
im gonna make sure the length = 1 in equation below
.
for the dot product = sin(Heading)*(distanceX/magDist) + cos(Heading)*(distanceY/magDist)
.
Now you have a dot product, yippee!
.
with the dot product use acos(dot) for an angle.
to make is useful the angle between you and the target is = acos(dot)-heading
.
putting this all into as little lines as I can acos(sin(Heading)*((a-x)/sqrt(pow(a-x,2) + pow(b-y,2))) +
cos(Heading)*(b-y/sqrt(pow(a-x,2) + pow(b-y,2)))-Heading
.
edit: just fixed smth dumb
@griges its not scary haha, it looks it but in simple, if you know trig and simple vectors, you can use two formulas and a little neatening to get a result. Im happy to write it out as a big equation if you want
@griges Ok, i think i proof read that fine, the last thing you need is a little formula with the dot product i mentioned earlier. using a formula. and assuming everything was normalised earlier all you need to know is that acos(A.B) = the angle between two vectors, which is fun already.
.
and then im 90% sure because its headings the angle you have to turn to face the right direction is turn_angle = acos(A.B) - Heading
@griges basically, you know trigonometry with triangles?. SOH CAH TOA
all of that in this is solely for triangles, the powers are just pythagoras a^2 + b^2 = c^2
.
for this maths im using something called column vectors, which is just a nice way to show vectors, think of (2,3) as 2 along (right), 3 up. help here
.
Also I should say the maths assumes that youre looking down on the world from a birds eye view, which doesnt really mean anything important. just that up means north.
.
There is a few variables we know always, where you are (x,y,z) = (Longitude, Latitude, Altitude), which way you are headed as a heading. headings are the angle away from north you are facing. To use the heading, for your x use cos(Heading), for your y, use sin(Heading) help here.
.
Also you always know your destination. To find a vector between you and your destination you can use : (destination) x ,y ,z - (your current) x, y, z.
Because vectors are cool and (1,2,3) - (1,2,3) works by x-x, y-y, z-z. which results in (0,0,0) because there is no difference. help here
.
Now, with your triangle knowledge and simple vector knowledge you can use a few important facts. you need to normalise these vectors. This means the hypotenuse of the triangle has a length of 1, always. but it still points in the same direction. you can do this by dividing each side of the triangle by the hypotenuse length. help here
.
next step is the scalar product which sounds scary, but in short we have two vectors, our heading and the vector between us and our destination, which i will call A and B. to find 'how related they are' use the scalar/dot productA.B = x*x + y*y (multiply the x of A and B together and add it to the y of A time y of B).
.
This creates a number between -1 and 1. and basically it tells you a bunch. if its 1. you are looking directly at the island, if its 0 you are looking perpendicular to it. and -1 if you are looking the opposite direction
@dabestsock landing would be difficult though. for a helicopter, easy. The issue is, you have to know a position point for the start and end of each runway. which is simple, then have it follow that line.
.
this doesnt work with the custom waypoint however, as its just a single point in space
@dabestsock yes and no. assuming no obstacles, its somewhat simple, you could use a PID, of the dot product, which is the ugly piece of maths by each of the '█' in the code
also using a simple gyro to keep roll stable.
.
To avoid obstacles you could just have it fly at like 10000ft or smth tho.
@griges next point? Basically, the distance is the hypotenuse of a triangle made with your current x,y, then using another points x and y, you find a distance.
.
for the direction i use a little vector maths, basically treating the heading of your aircraft as a normal vector, and comparing it to the (normalised) vector between you and the location. I use the scalar product for this.
.
im happy to explain in more detail, just not sure what you mean
@RepublicofWrightIsles i was gonna write out a bunch of stuff, but like in simple, its not that deep, 'true' communism is just homogenous equality etc.
.
I am not defending past atrocities. Ive dug myself a pit here
Use sets of asterisk like brackets around text to bold (2 asterisk pairs), or italics (1 asterisk pair). Or 3 is both
You can use backticks for the red text (useful to show off funky trees stuff)
Using amounts of hashtags, one hashtags is the largest, then adding more decreases sizes.
 For an image
And use lines of underscores or dashes for a formatted line e.g. dashes:
———————————————————————
Underscores:
yo, making waypoints is something ive been doing for my sat nav, firstly:
.
Your position can be described and Longitude,Latitude,Altitude, these are your planes X,Y,Z variables.
.
To 'lock' a value in place, you can use the smooth() function. So have variables called x, y, z. and have them equal smooth(Longitude,1000000*clamp01(Activate1))
.
This 'saves' a point in space. do the same for latitude. Also I use the large number to make sure that it works on stupid fast planes too.
.
Im releasing my satnav tonight, so yeah, you can use that stuff @Theinfinite @griges
I agree with hpgbproductions, feel free to try using the target variables, you can use the scalar product to help find directionality, distance is the easy bit.
.
its easier to nab someones stuff, make sure to credit them though
Its kinda just luck. ive been posting 3 things a day. and there doesnt seem to be much correlation between what gets popular. I spent actual months on mahoraga, its a replica etc, but the whale, a fodder build, ended up reaching front page.
@griges yeah, just thought a ufo is probably
One of the few things that could need it, you could try like using a bit of hollow fuselage to like make a shadow over the lights to make them pop more/dark painted fuselage around the lights. But there isn’t really a way to increase brightness past emission 1 (with any effect) to my knowledge
also if u wanna swivel flight cam & or controls, make sure to have the main cockpit/flight comp remain in the same position and rotation, for the sake of physics
For the weapon you could make a tractor beam, using a negative value for the impactForce property on a gun. not 100% sure what you mean with the lights, but I recommend hooking them all up to a variable, in case you wanna change how they activate all at once, or use emission painted parts.
@griges so, you need variables first for where you are headed. im gonna call these
+1(a,b,c)
this is the location of wherever you wanna go. and im not gonna use c, because I only care about horizontal distance atm..
The variables of your plane are Longitude, Latitude, Altitude and Heading. imma call these
(x,y,z)
and theta (theta for angle)..
to find the vector between you and your destination
distanceX = a-x
distanceY = b-y
.
Also I wall call the length of the vector between you and destination magDist. this is just
sqrt(pow(distanceX,2) + pow(distanceY,2))
think a^2 + b^2 = c^2.
im gonna make sure the length = 1 in equation below
.
for the dot product =
sin(Heading)*(distanceX/magDist) + cos(Heading)*(distanceY/magDist)
.
Now you have a dot product, yippee!
.
with the dot product use acos(dot) for an angle.
to make is useful the angle between you and the target is =
acos(dot)-heading
.
putting this all into as little lines as I can
acos(sin(Heading)*((a-x)/sqrt(pow(a-x,2) + pow(b-y,2))) +
cos(Heading)*(b-y/sqrt(pow(a-x,2) + pow(b-y,2)))-Heading
.
edit: just fixed smth dumb
@griges its not scary haha, it looks it but in simple, if you know trig and simple vectors, you can use two formulas and a little neatening to get a result. Im happy to write it out as a big equation if you want
+1@griges Ok, i think i proof read that fine, the last thing you need is a little formula with the dot product i mentioned earlier. using a formula. and assuming everything was normalised earlier all you need to know is that acos(A.B) = the angle between two vectors, which is fun already.
+1.
and then im 90% sure because its headings the angle you have to turn to face the right direction is turn_angle = acos(A.B) - Heading
@griges basically, you know trigonometry with triangles?. SOH CAH TOA
+1all of that in this is solely for triangles, the powers are just pythagoras a^2 + b^2 = c^2
.
for this maths im using something called column vectors, which is just a nice way to show vectors, think of (2,3) as 2 along (right), 3 up. help here
.
Also I should say the maths assumes that youre looking down on the world from a birds eye view, which doesnt really mean anything important. just that up means north.
.
There is a few variables we know always, where you are (x,y,z) = (Longitude, Latitude, Altitude), which way you are headed as a heading. headings are the angle away from north you are facing. To use the heading, for your x use cos(Heading), for your y, use sin(Heading)
help here.
.
Also you always know your destination. To find a vector between you and your destination you can use : (destination) x ,y ,z - (your current) x, y, z.
Because vectors are cool and (1,2,3) - (1,2,3) works by x-x, y-y, z-z. which results in (0,0,0) because there is no difference. help here
.
Now, with your triangle knowledge and simple vector knowledge you can use a few important facts. you need to normalise these vectors. This means the hypotenuse of the triangle has a length of 1, always. but it still points in the same direction. you can do this by dividing each side of the triangle by the hypotenuse length. help here
.
next step is the scalar product which sounds scary, but in short we have two vectors, our heading and the vector between us and our destination, which i will call A and B. to find 'how related they are' use the scalar/dot product A.B =
x*x + y*y
(multiply the x of A and B together and add it to the y of A time y of B)..
This creates a number between -1 and 1. and basically it tells you a bunch. if its 1. you are looking directly at the island, if its 0 you are looking perpendicular to it. and -1 if you are looking the opposite direction
Thought i saw bristol mentioned for a second
@RepublicofWrightIsles fairs, i remember having to search a tutorial for how to build a jet, so no shame at all
@RepublicofWrightIsles ty, im glad i could put some of my maths to use
@dabestsock landing would be difficult though. for a helicopter, easy. The issue is, you have to know a position point for the start and end of each runway. which is simple, then have it follow that line.
.
this doesnt work with the custom waypoint however, as its just a single point in space
@dabestsock yes and no. assuming no obstacles, its somewhat simple, you could use a PID, of the dot product, which is the ugly piece of maths by each of the '█' in the code
also using a simple gyro to keep roll stable.
.
To avoid obstacles you could just have it fly at like 10000ft or smth tho.
@RepublicofWrightIsles back at like 12, thinking this truck was the hype-est thing ever
@RepublicofWrightIsles ah- right, my bad lol
@RepublicofWrightIsles fair, just bear in mind its ancient, i wouldnt wish the levels of cringe upon my worst enemy
@RepublicofWrightIsles my irish friend wasnt best pleased either at the time
@RepublicofWrightIsles tysm, gotta check if youre alright tho, like ur digging deep through my old builds
@RepublicofWrightIsles apparently, its a small website all things considered
@RepublicofWrightIsles ty for all the support dude, its hella kind, dont feel forced tho
@SPsidearm i forgot to remove it from the fish :(
@RepublicofWrightIsles yeah, but dont stray too close to the sun, the guidelines still exist, and ty, its a cool plane lol
@griges next point? Basically, the distance is the hypotenuse of a triangle made with your current x,y, then using another points x and y, you find a distance.
+1.
for the direction i use a little vector maths, basically treating the heading of your aircraft as a normal vector, and comparing it to the (normalised) vector between you and the location. I use the scalar product for this.
.
im happy to explain in more detail, just not sure what you mean
@Graingy @RepublicofWrightIsles this is a planes website its not that deep
@RepublicofWrightIsles i was gonna write out a bunch of stuff, but like in simple, its not that deep, 'true' communism is just homogenous equality etc.
+1.
I am not defending past atrocities. Ive dug myself a pit here
@RepublicofWrightIsles ideology isnt necessarily the same as the execution of the past attempts
@CrestelAeronautics you beat Rb2h, im impressed
+1@Type2volkswagen @YarisHatchback
@Theinfinite @griges and if you want it @Solent
+2i forgot
+1[](image url) for an embedded hyperlink
and also
>
for like bullet pointsUse sets of asterisk like brackets around text to bold (2 asterisk pairs), or italics (1 asterisk pair). Or 3 is both
You can use backticks for the red text (useful to show off funky trees stuff)
Using amounts of hashtags, one hashtags is the largest, then adding more decreases sizes.
 For an image
And use lines of underscores or dashes for a formatted line e.g. dashes:
———————————————————————
Underscores:
+1
That’s so sick
+1@Theinfinite I will, but im at upload limit rn, so, itll be out like 22:00 GMT
+1Welcome Back
+1Aluminium bird. t
have a look in the input variables from snowflakes funky trees guide
yo, making waypoints is something ive been doing for my sat nav, firstly:
.
+2I agree with hpgbproductions, feel free to try using the target variables, you can use the scalar product to help find directionality, distance is the easy bit.
+2.
its easier to nab someones stuff, make sure to credit them though
Its kinda just luck. ive been posting 3 things a day. and there doesnt seem to be much correlation between what gets popular. I spent actual months on mahoraga, its a replica etc, but the whale, a fodder build, ended up reaching front page.
+2@YarisHatchback Thats not a guarantee still lol
@griges I shoulda linked it, you’re right
+1@griges I mean you can try using a lower power impact gun with zero damage into a magnet, idk lol, I used to love impact guns
+1@griges yeah, just thought a ufo is probably
+1One of the few things that could need it, you could try like using a bit of hollow fuselage to like make a shadow over the lights to make them pop more/dark painted fuselage around the lights. But there isn’t really a way to increase brightness past emission 1 (with any effect) to my knowledge
@SuperSuperTheSylph ty im happy to hear you liked it
@Yonducriminallol @F1boss2018 you guys too, if you happen to still be around :)
@Renameduser4 @F1boss2018 @TheKraken3. This is a long shot, but uh five years later i finished it lol original forum here
@SuperSuperTheSylph @YarisHatchback. The phantom :)
+1@xNotDumb @TheVizzyLucky @Solent
also if u wanna swivel flight cam & or controls, make sure to have the main cockpit/flight comp remain in the same position and rotation, for the sake of physics
+1For the weapon you could make a tractor beam, using a negative value for the impactForce property on a gun. not 100% sure what you mean with the lights, but I recommend hooking them all up to a variable, in case you wanna change how they activate all at once, or use emission painted parts.
+1they slap, I would
+2@WzNick ty, and never worry abt upvoting, im just happy that people enjoy it
@WzNick yessir, the shatter sun was the magic inspired build
@Graingy I didnt make that clear already, damn, im lacking hard