Images not showing on 3dOverlays


#1

I cant get an image to show on a 3d overlay.

clonedOverlaysExample.js doesnt work at all and gives no errors or warnings.

overlayPanel works but only displays text, complains images cant be found, I changed url to a known good one and it fails without showing any errors.

I dont know of any other examples that use image3D, or images on billboard.

Has anyone done anything using image3D or billboard? Or does anyone have any examples please?


#2
var
    overlay1,
    POSITION_DISTANCE = 3.0,
    position1,
    HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/",
    OVERLAY_1_SVG = HIFI_PUBLIC_BUCKET + "images/up-arrow.svg";

position1 = Vec3.sum(Camera.getPosition(), Vec3.multiply(POSITION_DISTANCE, Vec3.multiplyQbyV(Camera.getRotation(), Vec3.UNIT_NEG_Z)));

overlay1 = Overlays.addOverlay("image3d", {
    position: position1,
    url: OVERLAY_1_SVG,
    color: {
        red: 255,
        green: 255,
        blue: 255
    },
    alpha: 1.0,
    visible: true,
    size: 0.1,
    scale: 0.1,
    isFacingAvatar: true,
    drawInFront: true
});

Script.scriptEnding.connect(function () {
    Overlays.deleteOverlay(overlay1);
});

Works with PNGs and JPEGs also.


#3

Champion.

Turns out the missing param was “drawInFront”

Many thanks Dave.