Wrong rendered Object

Hi guys,



got a problem while displaying one of my selfmade objects. The picture below shows the  problem. As you can see the buildings faces close to the camera disappear.







First i thought this is because i had set no zbuffer and cullstate, but both are set. the model on the right of the building is an indication for that. It is rendered correctly. Setting both states directly to the buildings node doesnt change anything.



ZBufferState buf = display.getRenderer().createZBufferState();
      buf.setEnabled(true);
      buf.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo);
      rootNode.setRenderState(buf);

      CullState cs = display.getRenderer().createCullState();
      cs.setCullFace(CullState.Face.Back);
      rootNode.setRenderState(cs);



here is a picture rendered in blender. it shows how the building should look like.



Anyone got an idea?

Here are the .blend and the Orgre export files if someone wants to take a look at it.
http://rapidshare.com/files/346304063/Temple.rar.html

Thanks
Edregol

set the near frustum of tha camera right. be aware the nearer it is the less precise is the z buffer in hughe distanes

The normals are flipped.



Try "cs.setCullFace(CullState.Face.Front);" instead of back.

Or just flip the normals in blender? :slight_smile:

Thanks for the answers,



I think the problem isnt related to the near frustrum. Because the building is rendered wrong even if the carmera is further away from the building.



setting  the cullstate to .Front didnt solve the problem entirely. Probably the problem is related to blender an the fliped normals, as you said.



But how can this be solved? pressing crtl+n and crtl+shift+n in editmode didnt work. do i need to flip every single face by hand? And why does this problem occur? am i doing something wrong while modeling? Im a bit surprised about that, because in blender the building is rendered correctly. Or at least, it seams to be rendered correctly.



Thanks

Edregol


As far as i know opengl use normals that are opposite to other standarts, at elast 3dsmax has a option to set the direction of normals globally.



Primitive attempt is to read in the ogrexml file and just invert all vectors that are normals.

I've solved the problem. sorry for that stupid question. I've just forgotten to update the renderstate of the rootNode within the "update" Method :slight_smile:



Edregol