How would I rotate a polygon in 3D space?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
ThatCodingGuy78
Prole
Posts: 16
Joined: Thu May 27, 2021 12:32 am

How would I rotate a polygon in 3D space?

Post by ThatCodingGuy78 »

I have no idea how to do this, I know how to rotate points (and by extension, lines), but have no idea how to rotate a polygon.
This is not just a polygon BTW, it's a face (of a box) made up of polygons.
I have no clue how to rotate something around a spot that isn't the origin point, as I'm bad at trigonometry.

I tried just rotating the points but that just rotated the individual polygons around their respective origins.
"There is no such thing as a mistake, only happy accidents"
User avatar
Xii
Party member
Posts: 137
Joined: Thu Aug 13, 2020 9:09 pm
Contact:

Re: How would I rotate a polygon in 3D space?

Post by Xii »

As you seem to be aware, the correct course of action is to study trigonometry. You're not gonna understand 3D rotations without understanding trigonometry. Search for trigonometry tutorials for game developers. Should be plenty of hits, as trig is a very useful skill to game developers, even in 2D.
ThatCodingGuy78
Prole
Posts: 16
Joined: Thu May 27, 2021 12:32 am

Re: How would I rotate a polygon in 3D space?

Post by ThatCodingGuy78 »

I'll do that I guess, meanwhile, I figured out a much easier way of doing things. I was accidentally rotating the individual polygons instead of the main shape... I somehow applied my rotatePoints function to the individual points for the polygons so it was rotating the triangles instead of the main shape..
"There is no such thing as a mistake, only happy accidents"
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 54 guests