Disappearing Nodes

I just updated from CVS today, and I now have a weird error, where several of my nodes are disappearing and reappearing as they move around. It looks a little like they are being culled wrongly.

The basic setup is a large paged terrain, with a plane flying over it. The terrain is always visible, but the plane is missing most of the time. For short periods (maybe at certain angles) the plane becomes visible, where it should be. There could be an error in the code, but if so it was one that didn't cause any problems until something changed in CVS pretty recently. The plane's propellors also disappear, at different points, as does the floating mine in the middle of the terrain. Oddly, the bullets the plane fires are visible all the time (at least as far as I can see so far). Maybe because they are in transparent queue?

The code is at aircarrier.sf.net, net.java.dev.aircarrier.CarrierSimpleLevel

I can try to produce a simpler test case if necessary, but I was hoping someone might have a quick explanation/fix  :slight_smile:

Are you sure everything has a correct bounding volume?

There were some fixes to the way that rotation/scale and translation were applied to the bounding volumes (the ordering), and was checked in within the last couple of weeks. That would be the most likely culprit, although it should have fixed problems, not caused them. Can you turn on bounding volume rendering and try to see if the parts that are being culled have a bounding volume in a place they shouldn't be. Also, roll back your bounding directory to before you updated from CVS and see if this fixes the problem (tie it down to that change).

It may have been that you coded to rely on the broken parts of the boundings.  hopefully

Thanks to all for the help :slight_smile:

I had another look at the model bounds, I had thought they were ok, since the OBB bounding on the plane model elements were fine. However when I looked carefully, the OBB on the node containing the plane model (a "PlaneAssembly" that the plane, camera, etc. are all children of) was moving around crazily. Normally, at least one corner of it was flicking around on the screen, but occasionally it would all move down off the bottom of the screen, then the plane would disappear as expected. It seems a little like it always centered on the global origin, but I can't really say.

Replacing the bounding on the model with a BoundingSphere seems to fix this, although I'm not really sure why - this also seems to change the bounding on all the model parts (child nodes) to sphere as well, and presumably also the PlaneAssembly containing the model? I'm just realising I don't really understand the bounding system, so I'm sorry to bother you all with this, I'm guessing that the bounding volumes propagate down through children when applied, and up through nodes that don't have a specific bounding volume, but I really need to go look it up :slight_smile: I was probably just lucky before that whatever incorrect bounding I had just happened to stay on screen.

OBB has been known to have problems, but is also inherently unstable when your model moves or morphs, etc. because it tries to fit and orient the box to fit the new data set.  Usually this is fine, but evidently there are still bad cases.  I would suggest sticking with BoundingBox or BoundingSphere for the time being.

I am also having a problem here.

As soon as I add bounding boxes to my the quads within my scene things start disappearing/reappearing when the camera is moved around.

Modifying the near and far clipping planes helps a little bit, but only some.

I'm using

quad.setModelBound( new BoundingBox());


I've tried making sure the updateModelBound even happens after I add the quads in question to the rootNode.

When I turn on showBounds I don't see the boundaries that I would think I should see.

I don't know if it makes a difference but I create the quad. Add the BoundingBox and then attach it to a Node. That node is then transformed and rotate, and THEN I add that node to the root node.

Any help would be appreciated.

I think I have this fixed by forcing the rootNode to never be culled.

Odd, I don't see why needed to do this in this case. I have other test apps that I don't have too… oh well, at least its working for right now.