[Qt-3d] Transparent sphere in QtQuick3D (with Qt 4.8.2)

Mülner, Helmut helmut.muelner at joanneum.at
Thu Jun 21 17:31:33 CEST 2012


I would like to render a transparent sphere in QtQuick3d. This is my QML file:
import QtQuick 1.1
import Qt3D 1.0
import Qt3D.Shapes 1.0

Rectangle {
    id: topRect
    width: 720
    height: 480
    color: "#3333aa"
    Viewport  {
        anchors.fill: parent
        camera: Camera {
            eye: Qt.vector3d(0,0,15)
        }
        light: Light {
            position: Qt.vector3d(0,0,15)
        }
        blending: true
        Sphere {
            levelOfDetail: 4
            axis: Qt.YAxis
            radius: 2;
            sortChildren: "BackToFront"

            effect: Effect {
                blending: true;
/*                material: Material {
                    ambientColor: "#40808080";
                    diffuseColor: "#40808080";
                    emittedLight: "#00000000"
                    specularColor: "#00000000"
                }
*/
                texture: "transparent.png"
            }
            Point {
                vertices: [
                    -1, 1, 0,
                    -1, -2, 0,
                    1, -2, 0,
                    0, 0, 2,
                    0, 0, -2,
                    2, 0, 0,
                    -2, 0, 0,
                    0, 0, 2,
                    0, 0, -2
                ]
                pointSize:  8
                effect: Effect {
                    color: "#FF0000"
                }
            }
        }
    }
}

transparent.png is a transparent 512x512 image. ImageMagick says:
  Colors: 1
  Histogram:
    262144: (255,255,255,127) #FFFFFF7F rgba(255,255,255,0.498039)

If I use the commented out material effect, the image looks almost the same:
Depending on the position of the camera I see an almost transparent sphere (at least the color) is blended.
I see some inner circles (parallel cross sections), but I never see the points inside the sphere.

Did I do something wrong or is this a bug in Qt3D?

--
Helmut Mülner
DIGITAL - Institute of Information and Communication Technologies

JOANNEUM RESEARCH Forschungsgesellschaft mbH
Steyrergasse 17, 8010 Graz, AUSTRIA

phone:  +43-316-876-2612
general fax: +43-316-876-1191
web:    http://www.joanneum.at/digital
e-mail: helmut.mülner at joanneum.at<mailto:helmut.mülner at joanneum.at>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-3d/attachments/20120621/a77df668/attachment.html 


More information about the Qt-3d mailing list