Billboarding causing object to vanish?

Started by mystara, December 12, 2009, 12:36:16 PM

Previous topic - Next topic

mystara

Sorry, this is probably another noob question, but having looking through the javadocs, I cannot seem to find an explanation.

I created a new object (a rectangular plane) by:
Object rectangle = new Object(2);
rectangle.addTriangle(blah); rectangle.addTriangle(blah);

This works fine and I've been able to create a simple rectangle and colour it or apply to a texture to it.

I wanted to use billboarding so that the rectangle would always appear as a rectangle, regardless of the camera angle. However, when I try rectangle.setBillboarding(Object3D.BILLBOARDING_ENABLED) the model disappears.

Ideas?

EgonOlsen

Could be the vertex order, so that you are seeing the culled back face of the plane when using billboarding. Or maybe the plane rotation pivot is way off its center, so that it rotates out of view when enabling billboarding?
Try a call to setCulling(false); on that plane to see of that helps.

mystara

Turns out both things were wrong.
Having set the rotation pivot and disabled culling, it works!