Author Topic: Billboarding causing object to vanish?  (Read 2686 times)

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Billboarding causing object to vanish?
« on: December 12, 2009, 12:36:16 pm »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Billboarding causing object to vanish?
« Reply #1 on: December 12, 2009, 02:05:49 pm »
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.

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: Billboarding causing object to vanish?
« Reply #2 on: December 12, 2009, 03:26:43 pm »
Turns out both things were wrong.
Having set the rotation pivot and disabled culling, it works!