I have two objects A and B where A is in front of B. When I run the program and navigate pass A, it looks as though B is in front of A. In fact few other items which seemed to be at the back, appear to be in from of other objects. have I missed an importnat call here? :?
tomcat
Do you have a ZBuffer state on?
If not, thats your problem:
ZBufferState zEnabled = display.getRenderer.createZBufferState();
zEnabled.setEnabled(true);
rootNode.setRenderState(zEnabled);
And thats it really.
DP
I have
ZBufferState buf = display.getRenderer().createZBufferState();
buf.setEnabled(true);
buf.setFunction(ZBufferState.CF_LEQUAL);
rootNode.setRenderState(buf);
this in the code (initGame method). It seems it only happens to the objects I have cloned but this could be just an anomaly. Any ideas what I am doing wrong?
tomcat
are you updateing the render states after?
Also, stupid question, but are your drivers up to date? A recent problem about colours was due to one of nvidia’s drivers…
Also, is that your only and main rendering branch? Meaning do you call “display.getRenderer.draw(someNode)”; more than once on different nodes? If so, then each of those nodes needs a zBufferState and each of those needs their renderStates updated.
DP
DP,
Many thanks for going through the problem step by step and solving it,
I thought I never get to the bottom of it. I must learn more about how jme works (!)
tomcat