PDA

View Full Version : drawing in xz plane



umeshvl
11-03-2009, 03:08 AM
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 ?

Aleksandar
11-03-2009, 03:52 AM
Because you are looking down the negative Z-axis. :)

umeshvl
11-03-2009, 04:39 AM
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 ?

Aleksandar
11-03-2009, 05:54 AM
Not exactly!
I'll try to visualize what you get using ASCII art. :)
# - border of visible area
- - your rectangle (infinitesimally thin)


##########
# -#
# #
# #
##########