Disabling backgoundurl

  • Hello guys it possible to disable the depthmap.backgroundurl by onclick=" " ?

    <depthmap url="panos/untitled2.obj" backgroundurl="panos/vid_main_optim2.jpg" scale="100" hittest="true" cull="front" />

    Edited once, last by Nikkben (March 27, 2023 at 8:27 PM).

  • Hi,

    The action below allows for changing the background URL.

    You can use it to set the url of the skybox, for example:

    Code
    change_backgroundurl('skybox.jpg');

    or to clear the backgroundurl:

    Code
    change_backgroundurl('');

    Action code:

    I hope Klaus will come with some better support to change the backgroundurl *cool*

  • And now that I posted this, I think of another way: just duplicate your scene with and without a background and use loadscene to switch between the 2?



    And then:

    Code
    loadscene(scene_with_background,, MERGE|KEEPSCENES|PRELOAD, BLEND);

    or

    Code
    loadscene(scene_without_background,, MERGE|KEEPSCENES|PRELOAD, BLEND);

    Which basically does the same as the action in the previous post, but then not dynamically.

  • Thank you very much, when calling change_background url(") it gives an error : ERROR: change_backgroundurl - TypeError: Cannot read properties of undefined (reading 'setAttribute')

  • Do you have a depthmap inside your <image> ?

    the <scene> i have tested with looks like this:

    Code
    <scene name="scene_with_background" autoload="true" title="hello" onstart="" >
    	<image>
    		<depthmap id="depthmap" url="models/gallery_06.obj" subdiv="0" rendermode="3dmodel" hittest="true" scale="100" textured="true" waitforload="true" center="0,0,0" axis="+x+y+z"/> 
    	</image>		
    </scene>

    Is there an example online to simulate the error?

  • here is my scene :


    <scene name="model" minpixelzoom="0" autoload="true" >
    <view hlookat="90" vlookat="0" fovtype="MFOV" fov="140.000" maxpixelzoom="1" minpixelzoom="0" fovmin="70" fovmax="140" limitview="lookat" vlookatmin="-90" vlookatmax="90" />
    <image prealign="-0.0|-0.0|-0.0" ox="0" oy="25" oz="0" >

    <depthmap id="depthmap" url="panos/untitled2.obj" backgroundurl="panos/vid_main_optim2.jpg" scale="100" hittest="true" waitforload="true" cull="front" subdiv="0" />

    </image>
    </scene>

  • onclick="change_backgroundurl('');

Participate now!

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