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:
https://www.babylonjs-playground.com/#1YAIO7#5

I change:
var glass = BABYLON.MeshBuilder.CreatePlane(“glass”, {width: 5, height: 5}, scene);
to:
//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

Thanks!

Here is an example
https://www.babylonjs-playground.com/#RD8DAA#19
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
https://www.babylonjs-playground.com/#RD8DAA#28

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.
https://www.babylonjs-playground.com/#RD8DAA#29

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:

https://www.babylonjs-playground.com/#RD8DAA#30

oh…

Thank you so much Sebavan