Hi,
Am trying to draw a rectangle in xz plane.
in modelview matrix mode,after loading identity matrix
am using glTranslate(0,(2.0),0);
This will bring the camera/eye to be positioned at 0,2,0
is my understanding correct ?
in projection matrix mode am using
glFrustumx(-5.0,5.0,-1.0,1.0,0.5,5.0);
Frustum works.
But if i use ortho for same dimension,
rectangle is not rendered.can any one help
regarding why this happens ?
Because you are looking down the negative Z-axis.
GLfloat Rect[] = { 2.0f, 0.0f, -1.0f,
3.0f, 0.0f, -1.0f,
3.0f, 0.0f, -4.0f,
2.0f, 0.0f, -4.0f,}
These are the coordinates which i used for drawing rectangle.
negative coordinate for z . So, rectangle will be in front of eye ?
Not exactly!
I’ll try to visualize what you get using ASCII art.
- border of visible area
-
- your rectangle (infinitesimally thin)
##########
# -#
# #
# #
##########