Jump to content
  • Advertisement
Sign in to follow this  
MTclip

transformation question - scaling -

This topic is 4884 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 am Using the D3DXMatrixTransformation2D function I call it like this D3DXMatrixTransformation2D(&mat,&Scenter,0.0,&scaling,NULL,NULL,&trans); scaling = (2,2) trans = (0,0) Scenter = (0,0) then when i call my draw calls.. it seems that every thing i send it is scaled by 2 .. including positions... is this true... also... If i just wanted to scale the quad that i draw by a say 2 and i use the top left as it orientation, I should set scaling center to (0,0) -right? also what is scaling rotaion center..? --- ;P

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by MTclip
then when i call my draw calls.. it seems that every thing i send it is scaled by 2 .. including positions... is this true...

If you configure the transform to have a scaling factor (as you seem to) and then configure the device to use that transform, then yes - everything you'll render will be affected.

The primary reason is to manipulate the positions - so I'm not sure why you seem "surprised" (?) that they're changing [smile]

Quote:
Original post by MTclip
If i just wanted to scale the quad that i draw by a say 2 and i use the top left as it orientation, I should set scaling center to (0,0) -right?

It depends on your geometry - if it was created such that (0,0) is the top left then yes, but if your geometry was created about the origin (a better idea), then you might end up using (-1,-1) for top left...

Quote:
Original post by MTclip
also what is scaling rotaion center..?

Matrix maths is quite a complex area - rotation always occurs around the mathematical origin... but if your object's center is *not* the origin then it might appear that your object is "orbitting" around an arbitrary point in space. For scaling, it's less obvious - but you can see your object appear to move if you don't scale about the center.

Hence the "scaling rotation center" allows you to get around this by specifying somewhere other than the mathematical operation.

hth
Jack

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!