Collision Detection Between Rotated Rectangles – HTML5 Canvas

preview_player
Показать описание
In this video you will learn to how to detect for collisions between rotated rectangles using the Separating Axis Theorem.

In actuality this algorithm will be able to detect for collisions between all polygons providing that they are convex and not conclave. It is just that the demonstration at hand is between two rectangles that can be rotated and moved about in any kind of way, it does not matter how, the collision detection works just the same either way.

📚 Materials/References:

🧠 Concepts Covered:
- What the separating axis theorem is and how it works.
- How to construct a new polygon that reflects another polygon that is rotated.
- Rotate a vertex / node around a centre point.

💻 Technologies used:
- HTML5 and the canvas API
- JavaScript (No jQuery)
- CSS (No Bootstrap)

If you enjoyed this video then please consider liking 👍 and subscribing. You would be doing me a huge favour if you did this and it would be greatly appreciated ❤️ by me. Likewise, if you have any queries or comments that you want answered. Then please, don’t hesitate post them down into the comments box below. I would love to hear back from you and will answer all of your questions to the best of my ability.

Stay awesome guys. ❤️

#SeperatingAxisTheorem#ComputerScience#CollisionDetection#HTML5#HTMLCanvas#JavaScript#GameDev#WebDev
Рекомендации по теме
Комментарии
Автор

Thankyou so much for this! Makes so much sense after your explanation

rtk
Автор

It's what I was looking for, also can be interesting in 3D collision objects

javiergarciafillol
Автор

Wow, this is very useful.
Can you make a video about calculating normal and depth of the collision?

unknown-bxmy
Автор

It only works for convex shapes not concave. You got this the other way around actually.

llleoha
Автор

can we get more video about dsa math in js
Thanks

AroberPothe