World to Pixel Transformation
Posted
by
D00d
on Game Development
See other posts from Game Development
or by D00d
Published on 2013-07-10T08:07:32Z
Indexed on
2013/11/07
16:15 UTC
Read the original article
Hit count: 207
My objects have a location in world coordinates (basically 1.0f is a meter). If I simply draw my objects using their world coordinates, each meter will correspond to a pixel. Obviously that's not what I want.
Now, I don't want to have to apply a transformation to each and every object's position when I draw them. As I happen to be using XNA, and spritebatch allows a Matrix to be passed in as an argument in it's begin method, I was wondering if there is a way to pass the World to Pixel transformation in there. Any suggestions?
So far Matrix.CreateScale(new Vector3(zoom, zoom, 1)) puts the objects in their proper spot, but it also scales up the sprites. Is there a way to transform the position without enlarging the sprite?
Thanks
© Game Development or respective owner