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 » Mon Jan 03, 2005 11:30 am

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.
0 x

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 » Mon Jan 03, 2005 12:00 pm

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.
0 x

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

Post by Thor » Mon Jan 03, 2005 3:35 pm

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!
0 x

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

Post by Thor » Mon Jan 03, 2005 3:57 pm

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?
0 x

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

Post by bana » Mon Jan 03, 2005 6:44 pm

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

I have no idea about the second problem though.
0 x
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 » Tue Jan 04, 2005 9:02 am

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.
0 x

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

Post by alphageek » Tue Jan 04, 2005 11:42 am

www.imageshack.us is good for temporary images:

An explosion:
Image

My GUI:
Image
0 x

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

Post by Thor » Wed Jan 05, 2005 10:21 am

Thanks Alphageek
0 x

Post Reply