Introduction to Game Development (E22: trigonometry)

preview_player
Показать описание
This episode shows how to find a direction from an angle, and vice versa, using trigonometry. It also covers the conversion from degrees to radians, and shows how to use the trig functions in Unity.

Source code:

Or a once-off donation through PayPal:
Рекомендации по теме
Комментарии
Автор

A 15 minute from Sebastian > a full semester of trig 270. Although this was 9 years too late for me, I know it will help someone else out there. Thanks for the upload as always!

Steven_Something
Автор

This has to be the most well-made and well-thought-out tutorial I`ve ever seen. I learned more from this 15 minute video, then 3 hours of work in school. And for that I thank you.

benj
Автор

How to remember Sine cosine and tangent:
SOH CAH TOA
SOH: Sine is opposite over hypotenuse
CAH: cosine is adjacent over hypotenuse
TOA: tangent is opposite over adjacent

razakhan
Автор

You have no idea how painfull this was to me, ahving the objects rotated in the wrong way and me just adding angles to make it face the right way and being frustrated by it. Now I know why and how it all actually works. Why everybody who makes "tutorials" on rotating your characters just say, oh here, copy pasta this code don't worry about it, when the explanation is so simple! Zero starts at X axis and goes anti cloack wise. SO SIMPLE!!! YET NOBODY EXPLAINS IT!!! I'm mad that the answer was so simple and yet I learn about it just now.
Sebastian is the real unity MVP!!!

MadBunnyRabbit
Автор

The production on these videos is off the charts. Amazing!

_-__-_
Автор

thank you for this! Finally someone succinctly explained why we use Atan2!!!

lando
Автор

I don't need to watch a Sebastian's video till the end to give a Like. Before watching I've already given.

MG-mmmn
Автор

Thank you so much for this video. I just completed a computer science degree and I did not know before what is the meaning of a radian. Now I can understand what I have done so far.

Reivaj
Автор

my my, the best explanation i ever had about trigonometry

enzozaqueu
Автор

I literally don't understand how anyone could dislike these on purpose.

rolandsaavedra
Автор

This video video series is simply amazing, but this video in particular should help everyone understand what's going on in the movements. I was getting really confused about that because there are so many different ways of doing it, not to mention the rotation added on top. Thank you thank you thank you. And now I know trigonometry too ... I feel like I should go take a university trig course and get credit for it !!

kyleme
Автор

Thanks for this great video. These 15 minutes explained a lot although c# programming, cos, sin and atan are new territories for me. Now i understand most of it and have a solution to my problems. Keep the work up

Niklas-cdsb
Автор

A little late to the party, but wanted to point out something that I didn't see in the comments and I don't believe was mentioned in the video: there's a difference between the two ways of implementing the rotation ("90 - " method and swapping x and z).

If you use the "90 - " method (the first one you showed), whenever we give no input, Atan2 is going to become zero (as it should, since the inputDir will just be a Vector3 filled with zeros). However, because we have that constant 90 degrees subtracting from Atan2 * Rad2Deg, the input angle becomes 90 degrees. This means that when we are not pressing anything, our character will face sideways, rotated about the y-axis by 90 degrees.

This doesn't happen when we swap the z and x in the Atan2 function because the constant 90 degrees is not there anymore. In this case, when Atan2 goes to zero (whenever we give no input), the entire inputAngle variable becomes zero, as it should, meaning our character will face forward (+Z) with no input instead of sideways (+X) as it did in the "90 - " method.

I think this explanation is right? Please correct me if I'm wrong.

davidmoellersztajnbok
Автор

this guy is AWESOME math teacher ! i wish i had a teacher like u in the school.

SagorHossen
Автор

The explanation makes these so easy to understand, thank you!

ruihong
Автор

FANTASTIC TUTORIAL, please make more like this.

emad-dev
Автор

me watching other trig videos: *visible confusion*
me watching this trig video: *visible happiness*

calvinz
Автор

Damn amazing! This bloody thing in just 15 minutes but so well explained. Thank you so much!

TheMabaet
Автор

I swear it's like i asked you to do this just in time :), Today i posted a question on unity form about this and now u uploaded, i think i'm able to do it on my own but i'll surely understand what im doing better after i watch this so thank you

nadimnadim
Автор

Great video! I really like how you teach difficult things in a simple way.

lucascionis