Jump to content
  • Advertisement
Sign in to follow this  
ms75214

transform help

This topic is 2534 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working with someone else's design, and they use stuff like this in the level description:

{ type="nugget"; transform=(1, 0, 0, 1, 9619, 582); },

Anyone know what the first four numbers are? I know the last 2 are x and y.

Share this post


Link to post
Share on other sites
Advertisement
"x and y" are usually names for co-ordinate variables and hence not very expressive by itself. However, from this I assume that we're speaking of a 2D transform. Then the former values are presumably the combined rotation/scale matrix. Then all numbers together define a homogeneous transformation matrix (in the following written using column vectors)


[ 1 0 9619 ]
[ 0 1 582 ]
[ 0 0 1 ]

where the 1st and 2nd row is stored in the file, and the 3rd row is constant. Notice that the layout in the file is column major in the case of using column vectors.

If so, then a transform=(c1, c2, c3, c4, c5, c6) means a transformation like in the matrix


[ c1 c3 c5 ]
[ c2 c4 c6 ]
[ 0 0 1 ]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!