Switching between coordinate systems

To switch from a global coordinate system to a local coordinate system of an object, we need to multiply the global coordinates by the inverted matrix of an object:

To switch from the local coordinate system of the object to the global coordinate system, we need to multiply the local coordinates by the matrix of an object:

0 0 votes
Article Rating
Subscribe
Notify of
guest

2 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Jim Tucker
Jim Tucker
2 years ago

I used this to convert a BGE 2.79 script to an UPBGE 3.0 script and it worked, but I dont
know why. Please can you give a little explanation?

NikitaD
Admin
2 years ago
Reply to  Jim Tucker

This is just matrix math. To switch from the local coordinate system to the global and back, we need to multiply the object transform matrix to the inverted world (local) matrix.