🔒 Locked
Normal problem
Advertisement
Original Post
I am really stubled here and I was wondering if anyone had a good solution. Alright here is my problem: I have a geometry that takes a while to compute, but once computed I use display lists to rotate and zoom (its a CAD software). The problem that I am having is that I was the normals to always face user, so when I original compute I negate the normal depending on which direction it is facing. Now, here is the issue that I am having. Since all normals face the user when the geometry is computed if you pan 180 degrees everything appears screwed up. My question is, is there a way to change the normals in a display list without having to recompute the scene ?
Maybe you mean to turn backface culling off?
Well, if you rotate 180 degrees, you would not be looking at a backface. When you look at a cube, the backfaces are the ones that you cannot see unless you are INSIDE of the cube. The back of the cube's backface is the face you would see if the front was removed. So you should only flip normals when you are able to see the faces insid the cube.
Levi
Levi
Quote:
Original post by levjs
Well, if you rotate 180 degrees, you would not be looking at a backface. When you look at a cube, the backfaces are the ones that you cannot see unless you are INSIDE of the cube. The back of the cube's backface is the face you would see if the front was removed. So you should only flip normals when you are able to see the faces insid the cube.
Levi
That is the problem I am using a display list to display the results and make them interactive.... Reseting the normals would require me to recompute the geometry, which takes a decent amount of time.
Quote:
Original post by levjs
Backfaces' normals are the exact same except they are flipped. Couldn't you use this to your advantage. For example, instead of recomputing the whole thing, couldn't you just multiply the vectors by -1 to flip it? That would take much less time.
Levi
Yes I could, but the problem is How to I get to the normal without recomputing my scene. I set the normal when I compute the geometry and then as soon as I am done it all gets dumped into a display list. My question is how do I change the normals in the display list ?
Quote:yes check the spec for exact details
Is there any way I can give the back face the same properties as the front face, just with a diffrent normal ?
but supply 1 normal per primitive/vertex (ie the normal way dont flip normsl yourself)
and use GL_FRONT_AND_BACK lighting / materials u might also need to enable something (its been years since ive used gl lighting)
Quote:The extra piece zedzeek was talking about is glLightModel* with pname set to GL_LIGHT_MODEL_TWO_SIDE. All this is in the Lighting Chapter of the Red Book by the way.
Original post by zedzeek
but supply 1 normal per primitive/vertex (ie the normal way dont flip normsl yourself)
and use GL_FRONT_AND_BACK lighting / materials u might also need to enable something (its been years since ive used gl lighting)
EDIT: Too slow
Ha, I thought about that, but I wasn't sure if you wanted to do it yourself. If you remmember, that's what I perscribed to you with the other problem you were having with the ligting on the back of an object. There the problem was the normals, and I thought it was that, and this time, I thought it was the normals and it wasn't. : ) Just a bad guesser.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement