flipping the y axis around?

Started by
4 comments, last by SiN 20 years, 8 months ago
hi, i''d like to kno how i could flip the y-axis around in perspective view. so, i''d like going upwards to decrease the y-value, while going downwards to increase the y-value. and i''d rather not have a quick work-around like just make all the y values in glVertex3f() negative, because i like my code REAAL clean thanx in advance for the help SiN
Advertisement
i think somehwere u have code that looks something like this



glcamera(cam.x,cam.y,cam.z,cat.x,cat.y,cat.z, 0,1,0);


make it like this


glcamera(cam.x,cam.y,cam.z,cat.x,cat.y,cat.z, 0,-1,0);


edit : actualy, whats wrong with tossin a negative in front of every y coord, i think rotating the camera may reverse some other things too.

[edited by - honayboyz on August 15, 2003 1:33:11 AM]
thanx, but i dont use glCamera (i have a feeling u mean gluLookAt) ... i just use glTransform and glRotate , and render everything relative to the cameras position

any other sugestions? thanx

SiN
Why do you want to invert the y-axis?
Would a
glScalef(0.0, -1.0, 0.0); 

work? I''m sure I have seen this used when using a stencil buffer to do reflections. The idea being that an axis is inverted and the model/object can be drawn again, but will appear flipped?
That would be

glScalef(1.0f, -1.0f, 1.0f);

Remember that rotations will go the other way around as well!


Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement