irrlicht 1.72 color is error

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jiedi123
Posts: 6
Joined: Thu Dec 16, 2010 9:08 am

irrlicht 1.72 color is error

Post by jiedi123 »

In 1.4.2 the color is right,but in 1.7.2 color is error
please help me
my code

IAnimatedMesh* mesh = smgr->getMesh("body.b3d");
if (!mesh)
{
device->drop();
return 1;
}
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
}

smgr->addCameraSceneNodeFPS();

while(device->run())
{

driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}

right in CopperCube 2.2 and 1.4.2
Image

error in 1.7.2
Image
lazerblade
Posts: 194
Joined: Thu Mar 18, 2010 3:31 am
Contact:

Post by lazerblade »

SColor takes it's arguments like this: 'SColor(Alpha, Red, Green, Blue)'.
When I created a color in GIMP where 100 is the red value, 101 is green
and 140 is blue, I get the same color you have in your second screenshot.

So my guess is that in 1.4.2 the alpha value comes last rather than first
like it does in 1.7.2. My recommendation is that you use GIMP or MS Paint
or photoshop or anything like that to try your color values before you
code them in 1.7.2.
LazerBlade

When your mind is racing, make sure it's not racing in a circle.

3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

It looks to me, that you have some emitting color on the first shot, and a plain diffuse on the second.
Are you sure, you did not change the ambient light color?

P.S. I like 2nd one better BTW 8)))
Do you like VODKA???
Image
Image
macron12388
Posts: 126
Joined: Wed Sep 29, 2010 8:23 pm

Post by macron12388 »

lazerblade wrote:SColor takes it's arguments like this: 'SColor(Alpha, Red, Green, Blue)'.
When I created a color in GIMP where 100 is the red value, 101 is green
and 140 is blue, I get the same color you have in your second screenshot.

So my guess is that in 1.4.2 the alpha value comes last rather than first
like it does in 1.7.2. My recommendation is that you use GIMP or MS Paint
or photoshop or anything like that to try your color values before you
code them in 1.7.2.
:shock: Wait... are you sure? I thought it was SColor(r, g, b, a)

*checking one sec*

Oh wait you're right, :lol: Oh ok nevermind SColorf(r, g, b, a) SColor(a, r, g, b)
jiedi123
Posts: 6
Joined: Thu Dec 16, 2010 9:08 am

Post by jiedi123 »

thanks
I am not change the ambient light,
I use the irrlicht example code “09.Meshviewer” load the mesh
in 1.4.2 is right
in 1.7.2 is error
Fury.
Posts: 25
Joined: Mon Dec 20, 2010 2:03 pm

Post by Fury. »

are you sure that alpha is handled the same way in irrlicht 1.4 and 1.7?

maybe in one is used 1-alpha as trasparency and in the other one is used alpha as trasparency.

just try to change the alpha of 1 model from
Alpha

to

255-Alpha and see what appens ;-)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The beginScene works correct, the transparency settings and parameters to SColor have not changed in any version. The blue background in the Irrlicht screenshot should be expected (because blue value is a little higher than the others).
The problem with the mesh seems to be the vertex color support which has been added in one of the latter versions of Irrlicht's b3d loader. You should make the vertex colors white, or try to change the color material to ECM_NONE for the mesh.
Post Reply