🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

the triangle is drawn only when the window is small

Started by
2 comments, last by okapota 23 years, 11 months ago
my application finaly can draw something, i solved all the errors and problems. but the triangle is drawn only when i chane the window size to be small, and tall. and than i can see the triangle. i copied some drawing code from a tutorial, and it works fine on a big screen. should i do any transformation or anything like this before drawing? and lets say i gave an array of vertices. and i want to traslate or rotate them. how do i do that? cause the rotate command doesnt refer to a certain model or face.
Advertisement
OpenGL is a API where your commands are never applied to an "Object". That is what makes it so easy!
The transformation commands like glRotate / glTranslate are applied to the global transformation matrix. Imagine it as your coordinate system. When you call glRotate3f(90.0f, 0.0f, 1.0f, 0.0f); your current matrix is multiplied with the rotation matrix that this command creates. So after this call your coordinate system is rotate by 90 degrees around the Y axis. Everything you specify know is treated as if it''s rotated by 90°.

Tim

--------------------------
www.gamedev.net/hosted/glvelocity
glvelocity.gamedev.net
www.glvelocity.com
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
thank u very much.
if youre saying u can only see things when your window is higher than it is wide. then youre doing what a lot of ppl do including myself and that is not accounting for when the window is taller than it is wide try someit like this
    if (SCREENHEIGHT>SCREENWIDTH)		gluPerspective(cameraPERSPECTIVE, SCREENHEIGHT/SCREENWIDTH, 100, 10000);	else 		gluPerspective(cameraPERSPECTIVE, SCREENWIDTH/SCREENHEIGHT, 100, 10000);     

This topic is closed to new replies.

Advertisement