Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
basic saves the day
#1
My son is programming in an implementation of smalltalk and is working on a game where he has to keep track of world space and camera space and wanted to do a simple angle based system a shooter fires at a target and he hasn't studied trigonometry yet.  Dad to the rescue!  He was mixing up World space and camera space variables but that was fairly easy to spot. I showed him the proper formulas for calculating the difference in coordinates along angles but it wasn't working right for him so I showed him how it worked in QB64. It still wasn't working right for him and it took almost 2 hours of troubleshooting before I realized...doh.. "even though the internal logic of your programming language uses degrees it automatically converts to radians when doing trigonometry" . Luckily I had my little program to show the centuries old math is right. It was just a matter of figuring out which way his programming language thought 0 degrees was and figuring out the lag between object creation and when the angle between two objects was actually reported.

Being able to demonstrate the math in basic thanks to QB64 was the winner.
Reply


Messages In This Thread
basic saves the day - by James D Jarvis - 05-28-2023, 04:21 PM
RE: basic saves the day - by CharlieJV - 05-28-2023, 04:34 PM
RE: basic saves the day - by bplus - 05-28-2023, 06:19 PM
RE: basic saves the day - by aurel - 05-28-2023, 07:31 PM
RE: basic saves the day - by BSpinoza - 05-29-2023, 04:30 AM
RE: basic saves the day - by James D Jarvis - 05-29-2023, 04:32 PM



Users browsing this thread: 4 Guest(s)