Skip to main content
GameDev.net gamedev.net
🔒 Locked

User facing polygons

Started by vivekd May 19, 2006 at 5:19 AM 1 replies 550+ views
Original Post
vivekd
vivekd
In continuation to my yesterday's query regarding user facing polygons, I need help with my second concern. I was able to solve the problem when rotating the scen horizontally. Follwing solution suggested by Gorax was applied: glPushMatrix(); GLfloat matrix[16]; glGetFloatv(GL_MODELVIEW_MATRIX,matrix); matrix[0] = 1.0f; matrix[1] = 0.0f; matrix[2] = 0.0f;//x matrix[4] = 0.0f; matrix[5] = 1.0f; matrix[6] = 0.0f;//y glLoadMatrixf(matrix); //render them here glPopMatrix(); The problem which continue is: if I take a top view of the scene, the polygon does not face the user. It gives the top view of the polygon. Kindly help me.
Gorax
Gorax
Since the x axis rotation would have you looking at the bottom/top of things (which seems to be your issue at the moment), while the y rotation would have you looking at the sides of things, both of which are nullified with that code. Assuming you're doing some form of multipass rendering (shadow mapping perhaps?), you need to remember that they need to be facing all cameras (or light sources in the case of shadow mapping). Check your code to see that every time they're rendered, that you're using that code, because if you're not, that'd be your problem... Of course, if you are using that code, then I'm not quite sure what the problem would be (but you can always post some code (the rendering part) to see if we can't track the problem down that way).
vivekd
vivekd
Quote:
Original post by Gorax
Since the x axis rotation would have you looking at the bottom/top of things (which seems to be your issue at the moment), while the y rotation would have you looking at the sides of things, both of which are nullified with that code.

Very True. x-axis rotation seems to be the issue currently.
Quote:
Assuming you're doing some form of multipass rendering (shadow mapping perhaps?), you need to remember that they need to be facing all cameras (or light sources in the case of shadow mapping).

I haven't included shadow mapping in my code.
Quote:
Check your code to see that every time they're rendered, that you're using that code, because if you're not, that'd be your problem

I checked the code to find that everytime while rendering, I am using your code.
Quote:
... Of course, if you are using that code, then I'm not quite sure what the problem would be (but you can always post some code (the rendering part) to see if we can't track the problem down that way).

My code is too large to be posted. But still, I 'll hit some tries and give you a shortened form of my code. Will that be ok?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.