Change Image

16 July 2016 10:03 #10523
Hello Blend4Web community!

First of all, I'm really impressed by the possibilities offered by B4W and really happy to use it .
I'm working on a project in order to create a 3D visualization tool for archaeological materials (in my case : rock art). The motivation is because the other tools like SketchFab or 3DHOP are not exactly suitable for what we need. The first aspect is the abilities to show several textures (one texture = one information, and we have defined 6 levels of information for one object).

But I'm struggling with the creation of the interaction… I saw in the Code Snippets what I need (Change Image), I've download the B4W CE, but the file was broken… (textures were missing and there was no interaction…) .
I've found also this application which is a great example of what i'm looking for…

Does anybody have a solution for this?
Thanks a lot folks!

16 July 2016 14:25 #10524
Hi Valentin and welcome!

The code snippet should work but you have to run it using the Project Manager.
Development Lead | Twitter
18 July 2016 09:43 #10550

Could you tell me, how you open the example?
Blend4Web developer
18 July 2016 13:01 #10570

Sorry I didn't answer sooner.
Thank's Yuri for your tipps, I'll try.
Roman, I didn't install the project manager (or never use it yet – is there something to install? I've not looked for…). So I Just open the Blender file and navigate through it… and that's what i got.

Thanks both of you!
18 July 2016 14:04 #10575
Try to check the texture paths in Blender:
Blend4Web developer
29 July 2016 00:32 #10831
Hello dear B4W friends!
Some news about my problem : it's solved! :)

@Roman : it worked much better after i dezipped the whole package… (i thought that everything was packed up into the blend file!)

But still, i couldn't find a way to understand how this snippets was working… :'(
Nevertheless, I found a couple of tutorial : this one, and this one, and also this thread. I manage to understand how it was working and to reproduce on a new blender file.
For the future people wondering how to manage it, you will find the blend file attached just right here!

Thanks a lot for your help, your time and this amazing tool! :)
29 July 2016 15:31 #10839
But still, i couldn't find a way to understand how this snippets was working… :'(
Ok, at first you we need to understand how you want to acheve this. If you want to load texture on the fly like it done in codesnippets example you need to make javascript code like it done in example with dragon. To understand how it works you need to push the View Code button and study how it done. For now it's can be done without programming.
If you want to load all your textures to the aplication at start and then just switch between them in your material then you can make simple setup with two (or more) texture nodes and a Value node as a swither. I prepeared an example for you.
Blend4web and that kind of thing.
30 July 2016 13:01 #10870
Thanks Mikhail for the reply, but for the moment understanding the snippets is not such a big deal for me… I succeed to achieve almost what I wanted, except one thing…
I have all my material in the scene, and through buttons, i can apply them on my object, and that's great! But it's not working for only one material : the "Xray effect". Basically, it's a material with some transparency… is there a way to apply such effect on an object defined previously as totally opaque? The result show only the opaque effect, and no transparency…
You'll find some image of what I would like… and a screenshot of my nodes.

Again, thanks for your help!
Please register or log in to leave a reply.