Hi firends,
now other quetion about 3D model.
is possible to change texture for 3D model dynamicaly ?
Thanks
Hi firends,
now other quetion about 3D model.
is possible to change texture for 3D model dynamicaly ?
Thanks
How about creating 2 scenes each with the same object but with different skin? And then swap scenes?
<scene name="scene1" autoload="true">
<image>
<sphere url="texture.jpg" />
<depthmap url="model.obj" hittest="true" rendermode="3dmodel" scale="100" textured="true" waitforload="true" center="0,0,0" axis="+x+y+z"/>
</image>
</scene>
<scene name="scene2" >
<image>
<sphere url="texture-2.jpg" />
<depthmap url="model.obj" hittest="true" rendermode="3dmodel" scale="100" textured="true" waitforload="true" center="0,0,0" axis="+x+y+z"/>
</image>
</scene>
<style name="button" type="text" css="text-align:center;" padding="4 8" mergedalpha="false" bgborder="0 0xFFFFFF 1" bgroundedge="1" bgshadow="0 1 4 0x000000 1.0" ondown="set(bgcolor, 0xDDDDDD);" onup="set(bgcolor, 0xFFFFFF);" />
<layer name="changescenebutton" style="button" keep="true" html="Switch Texture" width="80" align="bottom" y="50" onclick="changetexture();" />
<action name="changetexture" >
loadscene(scene2, null, MERGE|KEEPVIEW, BLEND(0.5));
</action>
Display More
Oooh, nice one indexofrefraction !
Tested this and also works:
<scene name="scene1" autoload="true">
<image>
<sphere url="texture.jpg" />
<depthmap url="model.obj" hittest="true" rendermode="3dmodel" scale="100" textured="true" waitforload="true" center="0,0,0" axis="+x+y+z"/>
</image>
</scene>
<style name="button" type="text" css="text-align:center;" padding="4 8" mergedalpha="false" bgborder="0 0xFFFFFF 1" bgroundedge="1" bgshadow="0 1 4 0x000000 1.0" ondown="set(bgcolor, 0xDDDDDD);" onup="set(bgcolor, 0xFFFFFF);" />
<layer name="changescenebutton" style="button" keep="true" html="Switch Texture" width="80" align="bottom" y="50" onclick="changetexture();" />
<action name="changetexture" >
<!-- loadscene(scene2, null, MERGE|KEEPVIEW, BLEND(0.5)); -->
image.reset();
set(image.sphere.url, 'texture-2.jpg');
set(image.depthmap.url, "model.obj");
set(image.depthmap.rendermode, "3dmodel");
set(image.depthmap.scale, "100");
loadpanoimage(MERGE|KEEPVIEW, BLEND(0.5));
</action>
Display More
loadpanoimage() is pretty new, i think it came with 1.20.11
Don’t have an account yet? Register yourself now and be a part of our community!