Advertisement

How to draw so that top is bottom and bottom is top?

Started by June 28, 2002 03:28 PM
4 comments, last by Uttar 22 years, 4 months ago
Hello everyone, I''m currently using a HUGE indexed triangle list command to draw every tile in my 2D engine. But now, there''s a problem with that. I normally do the translation and all that stuff but for a reason or another, the top is the bottom and the bottom is the top. So, i supposed a 180 degree rotation would make top become bottom and bottom become top - thus making everything look normal. But then the left becomes right and the right becomes left! So my question is the following: Is there a way for top to become bottom and bottom to become top WITHOUT left becoming right and right becoming left? Uttar
Yeah, you flip it (no turning involved). say you have the triangle with points at (2,4),(9,9),and (6,4) and your screen height is 10 and width is 10 (you know, like if your working with a TI82 or something). Just take the y values (don''t change the X) and figure out how far away it is from the closest edge. Now just take the value of the other edge and add that value you got previously. ex: (2,4) would become: 0-2=-2 10+(-2)=8 so its (8,4) (the same can be done if you want to change left and right but not top and bottom) Just think about it a while, it becomes logical if you look at it long enough.
Advertisement
Most of the time we just say "upside-down" instead of "top is bottom and bottom is top".


-David
I believe there is an option when setting up either the view matrix or the projection matrix to define up as top or bottom.

...I just looked it up, its the fourth parameter in the view matrix.

,Jay
Make matView(1,1) (2nd row, 2nd column) -1.

Steve

Steve
DirectX Programmer
Soon to be the new Bill Gates
Member of the Unban Mindwipe Society (UMWS)
True, you can set an Up-vector, but doesn''t that just rotate the scene 180 degress?
I think i''d just multiply the Y-coords of the vertices by -1...

T

--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.

This topic is closed to new replies.

Advertisement