Strange display problem

As you can see, the second screenshot show a clearly missing part of the model, after a very small rotation of the camera:

All item in scene are loaded from one .jme file, with bound specified:


This is the state-related code:

m_stateCull = m_display.getRenderer().createCullState();




m_stateWireframe = m_display.getRenderer().createWireframeState();



/** This allows correct blending of text and what is already rendered below it*/

m_stateAlpha = m_display.getRenderer().createAlphaState();








/** Create a ZBuffer to display pixels closest to the camera above farther ones. /

m_stateZBuffer = m_display.getRenderer().createZBufferState();




* Attach the light to a lightState and the lightState to rootNode. /

AmbientLight defLight = new AmbientLight();



m_stateLight= m_display.getRenderer().createLightState();




* Update geometric and rendering information for both the rootNode and fpsNode. */

updateGeometricState(0.0f, true);


Camera ‘frame’:

com.jme.math.Vector3f v3fdirCamera = new com.jme.math.Vector3f(0.0f,0.0f,-1.0f);

com.jme.math.Vector3f v3fupCamera = new com.jme.math.Vector3f(0.0f,1.0f,0.0f);

com.jme.math.Vector3f v3fleftCamera = new com.jme.math.Vector3f(-1.0f,0.0f,0.0f);

I need help, I can’t see where the error is… :frowning:

What kind of bounding is being used in the scene? Also, have you tried turning on bounds viewing? Finally, do the stairs come back if you rotate back… in other words, is the disappear/reappear predictable?

To me it sounds/looks like a bounds culling issue.

Be sure to check the camera settings to insure you are in a right handed coordinate system.

Sorry, was me…

to Mojomonk: camera is setted that way:

"strinchero" wrote:
Camera 'frame':
v3fdirCamera = new com.jme.math.Vector3f(0.0f,0.0f,-1.0f);
v3fupCamera = new com.jme.math.Vector3f(0.0f,1.0f,0.0f);
v3fleftCamera = new com.jme.math.Vector3f(-1.0f,0.0f,0.0f);

It's the same setup as the test, if i'm not wrong..

edit: forgot, yes appearing/disapperaign are absolutely predictable (not random in any way, geometry reappears and disappears always at the same position/angle)

Yeah, it definitely looks like an issue with bounds… like there is a disconnect between world and local coordinate systems or something. Maybe it’s an issue with the model conversion to jME… If the conversion process was loading bounds info or setting it wrong or something of that ilk. Can you give us a demo to try?

Preparing the demo, i discovered that the model bounds are ok, so it’s a problem of my code… ://

And i think i found it:

in my scene, i’have a root node, an intermediate node, and the model,

with the model child of intermediate node, and this one child of the root;

On the intermediate node i was calling:

Scene_Node.setLocalRotation( new com.jme.math.Quaternion(0.0f,0.0f,0.0f,0.0f));

if i change to:

float[] fRotAxis = new float[] {0.0f,00f,0.0f};

Scene_Node.setLocalRotation( new com.jme.math.Quaternion(fRotAxis));

it works… in my very poor understanding of quaternions, i was thinking that 0,0,0,0 was a no-rotation, while it seems that 0,0,0,1 is the right one.

Thanks for the help :slight_smile:

Ah yep… the identity Quat is 0,0,0,1. So your original app works now?

Yes, now it works… Just a question, why the ‘0,0,0,0,’ quat has that ‘distorting’ effect only on the bounding box ? the model is in it’s right place…

Just an artifact of bounds generation I’m sure. :confused: