hi, i want to create one billboard,
When i create it, it has the wrong position ( it depends on billboard size and camera position).
[java]
public Geometry createSun1(String particleTexture, float radius)
{
Geometry sun = new Geometry("", new Quad(radius, radius));
BillboardControl bc = new BillboardControl();
sun.addControl(bc);
Material mat = new Material(scene.getAssetManager(), “Common/MatDefs/Misc/Particle.j3md”);
mat.setTexture(“Texture”, scene.getAssetManager().loadTexture(particleTexture));
sun.setMaterial(mat);
sun.setQueueBucket(Bucket.Transparent);
return sun;
}
[/java]
I can create it correctly with particle emitter, but i think it will be slower.
Correct position
[java]
public Geometry createSun(String particleTexture, float radius)
{
ParticleEmitter emit = new ParticleEmitter(“Emitter”, Type.Point, 1);
emit.setShape(new EmitterBoxShape(new Vector3f(0f, 0, 0), new Vector3f(0f, 0f, 0f)));
emit.setStartSize(10.05f);
emit.setEndSize(10.05f);
emit.setStartColor(ColorRGBA.White);
emit.setEndColor(ColorRGBA.White);
Material mat = new Material(scene.getAssetManager(), “Common/MatDefs/Misc/Particle.j3md”);
mat.setBoolean(“PointSprite”, true);
mat.setTexture(“Texture”, scene.getAssetManager().loadTexture(particleTexture));
emit.setMaterial(mat);
return emit;
}
[/java]