Lighting in a qt3d scene



  • Hi,

    All documentation regarding lighting in qt is through QML only. I am trying to add a light element to qt3d scene
    I use the following code:
    @
    QColor color;
    lightParameter= new QGLLightParameters;
    color.setRgbF(1.0,1.0,1.0,1.0);
    lightParameter->setAmbientColor(color);
    color.setRgbF(0.0,0.0,1.0,1.0);
    lightParameter->setSpecularColor(color);
    lightParameter->setDirection(QVector3D(0,100,100));
    @

    Although, my scene appears a little bright, nothing significant happens when I tweak the parameters of ambient light and specular light. What do each of these correspond to?

    [Edited: Please use code tags "@@" - p3c0]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.