Billboard position

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Thor
Gnoblar
Posts: 5
Joined: Mon Jan 03, 2005 11:25 am

Billboard position

Post by Thor »

Hello all,

please help if you can.

I'm using a sphere mesh for a sun and billboard to use it as a corona.

Sun's postition is at 0,0,0 and I'm using the following code for billboard:

Code: Select all

m_SunSparcSet = mSceneMgr->createBillboardSet("SunSparc");
	m_SunSparcSet->setMaterialName("Examples/FlyingLightMaterial");
	m_SunSparc = m_SunSparcSet->createBillboard(m_snSunNode->getPosition());
	m_SunSparc->setColour(ColourValue::Red);
	m_SunSparc->setDimensions(1500.0f,1500.0f);
	m_snSunNode->attachObject(m_SunSparcSet);
The problem is, that the billboard is slightly on the upper left and not at the center.

How to fix that? Even when I use getWorldPosition it doesn't help.

User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Re: Billboard position

Post by DWORD »

Hi Thor,

Welcome to Ogre-land!
Thor wrote:The problem is, that the billboard is slightly on the upper left and not at the center.

How to fix that? Even when I use getWorldPosition it doesn't help.
This is because the flare is not centered in the image used (flare.png). You will need to create another image for the corona.

Thor
Gnoblar
Posts: 5
Joined: Mon Jan 03, 2005 11:25 am

Post by Thor »

I created another image, same effect. I'm not sure how to create a centered image, can you help me?

Thx a lot,
Thor

PS: Thank you for a warm welcome!

Thor
Gnoblar
Posts: 5
Joined: Mon Jan 03, 2005 11:25 am

Post by Thor »

Don't bother, I figured out.

Although, I found another problem. When using textured sphere and billboard, a black line is visible around the sphere (on the edge). Any idea how to eliminate it?

User avatar
bana
Greenskin
Posts: 132
Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:

Post by bana »

Thor, sorry to ask, but how did you fix your first problem?

I have no idea about the second problem though.
A proud member of the OpenFrag Coding Team.
http://coolhands.blogspot.com/

Thor
Gnoblar
Posts: 5
Joined: Mon Jan 03, 2005 11:25 am

Post by Thor »

Regarding the first problem, I slightly moved the corona in the image to the lower right and not in the center as it supposed to be. Fortunately, this works fine even when I rotate the camera around the sun in all positions. :)

Still didn't solve the second problem yet. Maybe might be the solution in material script. cccc

PS: If I could put the pic somewhere on the net, I would show you how it looks like.

PS1: Allright, I fixed the second problem too. The outer texture of the sun was causing this.

User avatar
alphageek
Gnome
Posts: 365
Joined: Mon Jan 03, 2005 11:56 am

Post by alphageek »

www.imageshack.us is good for temporary images:

An explosion:
Image

My GUI:
Image

Thor
Gnoblar
Posts: 5
Joined: Mon Jan 03, 2005 11:25 am

Post by Thor »

Thanks Alphageek

Post Reply