Tearcell,
@Tearcell@mastodon.gamedev.place avatar

Im currently working on trajectory systems and forgot what tan() does and I kinda am embarrassed about that. Also I'm awful at trigonometry apparently. Haven't thought about it in a couple decades!

#indiegamedev #math #gamedevmath

Tearcell,
@Tearcell@mastodon.gamedev.place avatar

Gra, the only way I'm getting the 'basic' formula to render right is if I negate the whole Y axis, which seems to go against the formula.

(y= v0 * t * sin(angle) - .5 * gravity * t * t)

#gamedevmath #godotengine

image/png

Tearcell,
@Tearcell@mastodon.gamedev.place avatar

oh and the actual calc code

Tearcell,
@Tearcell@mastodon.gamedev.place avatar

Wait... in Godot Y is the 'opposite' of what you'd expect... that WOULD make sense then wouldn't it.

foxysen,
@foxysen@pawb.fun avatar

@Tearcell Godot 2D Y has OS GUI logic direction, yea, not too game ligic

foxysen,
@foxysen@pawb.fun avatar

@Tearcell oh wait, you made Godot game in 2D, you know it, just derped

Tearcell,
@Tearcell@mastodon.gamedev.place avatar

@foxysen I definitely was focusing a bit too much on what I was doing wrong in the formula, rather than thinking about the system I was doing it in!

Tearcell,
@Tearcell@mastodon.gamedev.place avatar

aaaaaaaand I gotta undo that negative 'fix' when I swap this to 3d....

But it is working!

video/mp4

stephann,
@stephann@mastodon.gamedev.place avatar

@Tearcell I'm not sure because I'm bad at math, but on math calcs Up is positive, but on gamedev generally Up is negative

sinbad,
@sinbad@mastodon.gamedev.place avatar

@Tearcell I’m still using the “soh cah toa” mnemonic they taught me in secondary school to this day (sine=opposite/hypoteneuse, tan=opposite/adjacent)

Tearcell,
@Tearcell@mastodon.gamedev.place avatar

@sinbad wow I forgot about that up until I read your reply... Okay that's taking me back lol

SmartmanApps,
@SmartmanApps@dotnet.social avatar

@Tearcell @sinbad
Yeah, I was going to say that, 🙂 but I can also add to remember which ones are positive you can use ASTC - All Stations To Central - so tan is only positive in the first and 3rd quadrants (the 1st quadrant is top-right - where both x and y are both positive - then anti-clockwise from there).

sinbad,
@sinbad@mastodon.gamedev.place avatar

@SmartmanApps i don’t remember that one but that’s useful

tacitus,
@tacitus@mastodon.gamedev.place avatar

@sinbad @Tearcell

Same, so many seemingly childish mnemonics are still deeply ingrained in my brain, even some I made up myself.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • math
  • DreamBathrooms
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • GTA5RPClips
  • JUstTest
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • megavids
  • lostlight
  • All magazines