1 (edited by kimgar 2007-08-08 15:56:05)

Topic: setColor no worky?

i'm trying to change the color of default geometry like this:

Local irrNode:ISceneNode = smgr.addCubeSceneNode()
irrNode.getMaterial(0).getDiffuseColor().setBlue(128)

Print irrNode.getMaterial(0).getDiffuseColor().getBlue() 'prints 128...

setBlue works, as getBlue returns the correct value, but there's no change on screen, hmmm, i am missing something...

Re: setColor no worky?

hi kimgar smile  have you tried adding a light?  or setting the lighting material flag to off?

do you have a quick sample program?

3 (edited by kimgar 2007-08-16 02:06:33)

Re: setColor no worky?

Hi gman!

it seems the problem is drivertype? and colorchange works in openGL only?

param.setDriverType(EDT_OPENGL)        'ok
'param.setDriverType(EDT_DIRECT3D8)   'no color
'param.setDriverType(EDT_DIRECT3D9)   'no color

this is strange...or isn't it?

complete code:

SuperStrict
Framework Irrlicht.Core

Local param:SIrrlichtCreationParameters = SIrrlichtCreationParameters.create()
param.setDriverType(EDT_OPENGL)        'ok
'param.setDriverType(EDT_DIRECT3D8)    'no color
'param.setDriverType(EDT_DIRECT3D9) 'no color

Local device:IrrlichtDevice = IrrlichtDevice.createFromParams(param)
Local driver:IVideoDriver=device.getVideoDriver()
Local smgr:ISceneManager=device.getSceneManager()

'create camera
Local camera:ICameraSceneNode = smgr.addCameraSceneNodeMAYA()
camera.setPosition(_VECTOR3DF(0,30,-100))

'create light
Local light_node:ISceneNode = smgr.addLightSceneNode(Null, _VECTOR3DF(+100,150,-10), _SCOLORF(1, 1, 1, 255), 200.0) 'RGBA

'create irr nodes
Local INode:ISceneNode = smgr.addSphereSceneNode()
INode.getMaterial(0).getDiffuseColor().set(255, 0, 255, 0) 'ARGB

While(device.run())
    driver.beginScene(True, True, Null)
    smgr.drawAll()
    driver.endScene()
Wend    
device.drop()