Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3507 Members - Latest Member: PienueDut

26. May 2012, 12:47:28 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Am I using FaceCullMode correctly?
Pages: [1]
Print
Author Topic: Am I using FaceCullMode correctly?  (Read 319 times)
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« on: 09. November 2009, 04:19:06 am »

There was not a lot of documentation about exactly what FaceCullMode does.  I used FaceCullMode.FRONT to show a texture on the front of some quads.  I was not sure if this constant meant the FRONT would be shown or culled so I may have used a hammer to make the side I wanted show.  When I move the camera relatively close to switching from one side of the texture to the other (say within 10 degrees to either side of plane created by the quad), I get a ton of flickering.  I am not sure, but it looks like one frame present for every frame absent.

Code:
        Quad result = new Quad( coords, texture );
        result.getAppearance().setFaceCullMode( faceCullMode );
        return result;

Am I using FaceCullMode as it was intended?  What is the difference between this and turning off the normals on one side?  I have used that approach on another project without Xith3D.  It was more work because the normals had to be hand coded on the shown side and absent on the other, but it had no flickering problems.  I just assumed setting this attribute told the library code to do the same thing when calculating the normals.
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 09. November 2009, 09:58:56 pm »

The FaceCullMode is simply passed to OpenGL as is. I had similar problems and doublechecked, if the flag was passed o OpenGL correctly. And it is. Sometimes it seems to me, that the flag is handled invertedly by OpenGL. But I really don't know. It is a strange flag. But it is definitely passed to OpenGL correctly.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic