Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Thor
Gnoblar
Posts: 5 Joined: Mon Jan 03, 2005 11:25 am
Quote
0
login to like this post
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.
DWORD
OGRE Retired Moderator
Posts: 1365 Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:
Quote
0
login to like this post
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.
Thor
Gnoblar
Posts: 5 Joined: Mon Jan 03, 2005 11:25 am
Quote
0
login to like this post
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!
Thor
Gnoblar
Posts: 5 Joined: Mon Jan 03, 2005 11:25 am
Quote
0
login to like this post
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?
bana
Greenskin
Posts: 132 Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:
Quote
0
login to like this post
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.
Thor
Gnoblar
Posts: 5 Joined: Mon Jan 03, 2005 11:25 am
Quote
0
login to like this post
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.
Thor
Gnoblar
Posts: 5 Joined: Mon Jan 03, 2005 11:25 am
Quote
0
login to like this post
Post
by Thor » Wed Jan 05, 2005 10:21 am
Thanks Alphageek