Profile image

Gun bidirectional stabilizer

48.7k hfusiwjf29  4.1 years ago

This is my first post XD.

As the title,I builded a useful gun bidirectional stabilizer based on funky tree and @Leehopard 's Gatling, and I put it on Littlt Bugger.

Which case to use it in: cockpit on carriage body rather than on turret.

Link here: https://www.simpleplanes.com/a/Mjg2Wt/Little-Bugger2

You can use it on your own tank after modifying the angles and Speeds.

Angel: -12° to +60°
Speed: 0.5clamp01(Roll) ==> 0.5 sum(0.5clamp01(-Roll) ==> 0.5
pow(Pitch*0.6,3) ==> 0.6

Code here

y-axis rotato1:
Heading/180

y-axis rotato2:
sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll))))

x-axis rotato :
clamp((-(smooth(clamp(10Pitch,(-12+(-(RollAngle>0)RollAngleclamp(sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),0,1))+(-(RollAngle<0)RollAngleclamp(sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading)RollAngle,-1,0))+(PitchAngle>0)PitchAngleclamp(cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),-1,0)+(PitchAngle<0)PitchAngleclamp(cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),0,1))/180,(60+(RollAngle>0)RollAngleclamp(sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),0,1)+(RollAngle<0)RollAngleclamp(sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),-1,0)+(PitchAngle>0)PitchAngleclamp(cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),0,1)+(PitchAngle<0)PitchAngleclamp(cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),-1,0))/180),abs(pow(Pitch0.6,3)))))+cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading)PitchAngle/180+sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading)*RollAngle/180,-60/180,12/180)

  • Log in to leave a comment
  • Profile image
    42.4k phrongus

    @TheRoboEli he means first forum post

    1.3 years ago
  • Profile image
    56.9k bjac0

    damn thats a big code

    +1 3.3 years ago
  • Profile image
    147k Pilotmario

    This is pretty awesome tbh. I made a few revisions to the code to inverse it, but that's mostly because of how I prefer to control turrets.

    4.1 years ago
  • Profile image

    Totally first post totally not creator of the most popular plane ever

    +3 4.1 years ago
  • Profile image
    23.0k Scratchoza

    I finally get it, N I C E

    4.1 years ago
  • Profile image
    13.9k ChrisPy

    Whoa dang man

    +1 4.1 years ago
  • Profile image
    7,323 WarringMunky

    And now I see why that's amazing. Nice job!

    +1 4.1 years ago
  • Profile image
    7,323 WarringMunky

    @hfusiwjf29 np

    4.1 years ago
  • Profile image
    26.7k Gameboi17

    I was thinking to use funky trees but after seeing that butt-load of coding, i change my mind

    +3 4.1 years ago
  • Profile image

    @hfusiwjf29
    OK, thanks!

    4.1 years ago
  • Profile image
    48.7k hfusiwjf29

    @ArcturusAerospace You can choose to change the speed or other, but it is not necessary.

    4.1 years ago
  • Profile image

    We have to edit the speed of whatever it is attached to?

    4.1 years ago
  • Profile image
    48.7k hfusiwjf29

    @FairFireFight thanks

    4.1 years ago
  • Profile image
    48.7k hfusiwjf29

    @DickBrazen thx,I did it!

    4.1 years ago
  • Profile image
    48.7k hfusiwjf29

    @SnoWFLakE0s But as you said, there's a lot of room for simplification.

    4.1 years ago
  • Profile image
    66.7k SnoWFLakE0s

    Cool, but the complexity is quite unnecessary.

    +1 4.1 years ago
  • Profile image

    Very cool

    4.1 years ago
  • Profile image
    7,323 WarringMunky

    I like that you can do that but can't post an image. Lemme help of you're serious. Put a picture with exclamation and empty brackets like this ![] Then the URL to a direct .png like with postimages.org or similar site inside parentheses with no spaces anywhere in the text. Like this

    4.1 years ago
  • Profile image

    ![](imageLinkHere)
    make sure to remove the "s" from "https"

    4.1 years ago
  • Profile image
    7,323 WarringMunky

    Got excited that someone might've figured out a socket joint rotator. I like your coding but don't quite understand

    4.1 years ago