Home Creators Posts Import Register Favorites Logout

Content

During my career as a game developer, one of the things I have been struggling the most has been angles. Despite being so intuitive, working with rotations can be exceptionally tricky.

One of the upcoming series will be a cookbook to tackle some of the most common problems you might have with angles and rotations.

Do you have any specific question or issue that you would like me to address?

Let me know in a comment or a private message, and I'll do my best to see if I can fit it in the tutorial!

Comments

David Wilson

Aloha, I'm new to your Patreon, but I've been loving the proceedural 3D IK tuts. Thank you! I work with characters often and a major issue I've encountered with AI driven characters is rotations during locomotion. Although we've applied SLERP quaterion formulas, the characters tend to bob as they reestablish direction each frame. Is there a recommended way to dampen the SLERP rotations while maintaining overall trajectory?

Alan Zucconi

Hi David! Oh that is a tricky subject! For my own project, when I need something to move or rotate SMOOTHLY, I ended up creating SmoothVector3 and SmoothFloat classes. They basically use the SmoothDamp function onto a target position/angle. I change the target, but the movement is still smooth. If you just use Lerp or Slerp, changing the target might cause discontinuity in the interpolation.

David Wilson

Wow, thanks for the quick response!

Faris

This is so important and as game developers we do run into this quite often. I remember when developing a new gesture for Kinect to make the cursor move following the pointing gesture of the user's hand. I had to calculate the angle of the users's elbow (angle between two vectors) to know when the user is pointing to start tracking. I used the dot product and here is my script if you're interested <a href="https://twitter.com/Faris_Saad/status/628597805821489152" rel="nofollow noopener" target="_blank">https://twitter.com/Faris_Saad/status/628597805821489152</a> Also, I am interested in know more about angles and any pro tips you have related to the most common issues faced in game development.

Matei Giurgiu

Sounds great! I would personally be interested in quaternions.

Alan Zucconi

I think I'll have to dedicate an entire series on them. There is just too much to say about quaternions! I started a series about the Mathematics of 2D rotations ( <a href="https://www.alanzucconi.com/2016/02/03/2d-rotations/" rel="nofollow noopener" target="_blank">https://www.alanzucconi.com/2016/02/03/2d-rotations/</a> ), and I'll have to complete that before explaining what quaternions are, how they are derived and how they can be used. So this new series will be about how to work with angles using code.

Monguskan

It would be great to explain quaternion logic and how to handle them to operate with vectors, like orient a vector with a given quaternion.

Alan Zucconi

Hey! Thank you for your input! This specific series will not touch quaternion yet. Mostly because understanding them requires me to finish the series about complex numbers FIRST. But yeah, I will talk about quaternions soon(ish). :)