I have some strange problems about using BillboardSet

LuRenJia

06-11-2006 16:04:11

I created several BillboardSet to render trees, but have some strange problems.

1. the billboards don't face camera around Y axis, in fact they don't rotate.
foreach(PlantsDesc pd in osmLoader.Plants)
{
List<Vector3> posList = GetTreePositions(pd.DataFile);
if (posList.Count <= 0)
continue;
BillboardSet bs = sceneMgr.CreateBillboardSet(pd.Material, (uint)posList.Count);
//bs.BillboardOrigin = BillboardOrigin.BBO_BOTTOM_CENTER;
//bs.BillboardRotationType = BillboardRotationType.BBR_VERTEX;
//bs.BillboardType = BillboardType.BBT_ORIENTED_COMMON;
bs.DefaultWidth = pd.TreeSize.Width;
bs.DefaultHeight = pd.TreeSize.Height;
bs.MaterialName = pd.Material;
//bs.Technique.SetSceneBlending(SceneBlendType.SBT_TRANSPARENT_ALPHA);
foreach (Vector3 v in posList)
bs.CreateBillboard(v);
//sceneMgr.RootSceneNode.CreateChildSceneNode(pd.Material + "_node").AttachObject(bs);
sceneMgr.RootSceneNode.AttachObject(bs);
}


2. the textures of the billboards are not transparent, they have a black background. (.Tga file have a right alpha channel).

material Material_#95124282
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off

texture_unit
{
texture_alias 0
texture tree01.tga
}
}
}
}


any idea? sorry for trouble you again! :oops:

Bekas

06-11-2006 18:20:30

This
bs.BillboardType = BillboardType.BBT_ORIENTED_COMMON;
bs.CommonDirection = Vector3.UNIT_Y;

should make the billboard rotate around Y.

About 2. you should post in the main Ogre forum, I'm not sure.

LuRenJia

07-11-2006 04:59:52

unfortunately the code still don't work. I tried other BillboardType, all of them don't work. Billboards always are fixed. How strange! :o

LuRenJia

07-11-2006 06:08:23

ok, I found what's wrong, my mistake, :oops: something hide billboards, another mesh showing like a lot of billboards, of course, it is always fixed. How ashamed.

sorry for wasted your time.