Get a plane from an imported mesh and apply mirror texture to it

Hello firends,

I am trying to add a mirror to my scene.

If I take the example:

I change:
var glass = BABYLON.MeshBuilder.CreatePlane(“glass”, {width: 5, height: 5}, scene);
//var glass = scene.meshs.getElementById(“mirror”);
var glass = scene.getMeshByName(“mirror”);

but this does not work as it seems my mesh is not found. I am loading a mesh with plane called mirror earlyer

how can I define the mirror plane in my blender model and then apply the mirror texture in Babylon?

Hello and welcome!

Can you share the repro with your mesh?

Here is a doc to load external assets: Using External Assets - Babylon.js Documentation


Here is an example
I have been trying to address the mirror plane from the model at lines 70-72

A better example. I still fail to add the mirror texture to my imported mesh

I am not sure to understand which mesh should be the mirror and which should not :frowning: Could you make the example with only 2 meshes to prevent any confusion during troubleshoot ?

Hi Sebavan,

Thanks in this example there is only plane called mirror its in the middle of the two picture walls.

The two side wall are still there so there is something to reflect in the mirror.

Your playground was having couple typos with name comparison, meshs instead of meshes and scene being undefined in the creation function:


Thank you so much Sebavan