Sign in to follow this  
vivekd

User facing polygons

Recommended Posts

vivekd    128
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.

Share this post


Link to post
Share on other sites
Gorax    202
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).

Share this post


Link to post
Share on other sites
vivekd    128
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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this