Re: 2D in a 3D world

Matt J <[email protected]> Sun, 8 Aug 2010 14:37:50 -0400
Newsgroups gmane.games.devel.algorithms
Message-ID <[email protected]>
The aspect ratio of the orthogonal matrix (e.g. width/height) needs to match
the aspect ratio of the viewport...otherwise you get stretching.. not sure
if that is the issue....

If you are creating an orthogonal matrix that ranges from -0.5 to 0.5 for
left and right planes, you need to multiply the -0.5 and 0.5 by 0.5859375
(600/1024) for the bottom and top planes to account for the aspect ratio.
Maybe you are, but you didn't mention that.

If this part isn't right, it could mess up how your adding the half texel
offset to y as well. Just a hunch, I didn't try doing the math.

Matthew



- @Matthew: My ortho projection is simply -0.5 to 0.5, and the view has an
> offset of 0.5 so that the 'model' deals with 0..1 as the range.  So, no, the
> aspect ratio really doesn't come into it.  Thus, it would just stretch
> anything I render to fit the screen, regardless of the resolution.  Why do
> you ask?
>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev

_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list