PDA

View Full Version : Q: how to rotate the z-axis to make it face the user?



jyoung77
04-18-2005, 03:48 PM
Hi,

Can someone tell me how to rotate the z-axis such that it will face outward from the screen (toward the human user)? The reason I ask is I want to draw a disk (gluDisk()) that always faces me no matter how I rotate the model. Please help. Thanks.

Tony

halo
04-18-2005, 04:13 PM
glMatrixMode GL_MODELVIEW
glPushMatrix()
glScalef 1.0,1.0,-1.0
//draw your stuff
glPopMatrix()

This will flip your triangles, so you need to draw them in reverse order.

jyoung77
04-18-2005, 04:50 PM
Hi,

Thank you for your reply but I don't how it can help simply by changing the z-axis to its opposite direction. I need the disk always face me no matter how I rotate the model. Thanks again away.

Tony

dorbie
04-18-2005, 06:23 PM
Do a search for billboarding and specifically point billboards. Point sprites may also interest you.

halo
04-18-2005, 06:38 PM
Sorry, I misunderstood.