load a preview image but keep splat

  • Hi,
    I'm trying to add the possibility to add a background image in the drag'n'drop example.
    Problem is that the image.splats.url is created with:
    var fileURL = URL.createObjectURL(file);
    var bloburl_with_filename = fileURL + "#" + file.name; 

    so when trying to add a image.preview and reloading :
    targetkrpano1.image.reset("copy");
    targetkrpano1.call("set(image.objectsize, 0)");
    targetkrpano1.call("set(image.preview.type, SPHERE)");
    targetkrpano1.call("set(image.preview.url, '" + imageDataUrl + "')");
    targetkrpano1.actions.loadpanoimage("KEEP3D|IMAGEONLY");
    targetkrpano1.view.reset();

    It returns :
    ERROR: loading of 'my_splat.ply' failed! Failed to fetch

    any clue on solving this ?
    Many thanx

  • here is the full action :

  • I use the original code (splatexamples_drop_in_support) to load the splat files.
    The new action (select_and_load_image) is to be able to load a background sphere image after a splat is displayed.
    OK it works if I remove URL.revokeObjectURL(fileURL);
    But not sure it's the most clever way to make this work...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!