Yup could work in your case and it would be way less expensive than a cube cause only 2 renders (1 per plane) vs cube where you need 6 faces.
I’ll tag you in a solution when I get a chance, changing focus for the rest of the day.
Thank you for the article.
This works when the cube is static:
https://playground.babylonjs.com/#CYN0YW#3
but what do I do when its being moved?
https://playground.babylonjs.com/#CYN0YW#4
You probably need to change your mirror setup accordingly to move them as well ?
I’m pretty sure I do by parenting them, do I need to update their normals or something every frame?
yup the mirror planes needs to be updated I guess.
What would be the fastest way to recalc their normals?
maybe rotating the plane by using transform on the plane and using the worldMatrix of the cube ?
I hate to be the guy to ask you to show me… but could you please take the second to show me what you mean I’m drawing a hard blank.
Was thinking smthg along those lines ??? https://playground.babylonjs.com/#CYN0YW#5
perfect, thank you I was struggling.
https://playground.babylonjs.com/#CYN0YW#7
Actually it looks like the right information is still not showing up once I move the “cube”
Rabble rabble rabble… this was supposed to be easy.
The Plane.transform
method is bugged I think, it is doing a transpose intead of an invert.
Here’s a PG with a modified method (see code at the end):
https://playground.babylonjs.com/#CYN0YW#8
Will let @sebavan say if it’s indeed the right fix.
Note also that:
reflector.parent = pPoly
has no effect, there’s no parent
property on a plane. However, it does not matter in the PG because the reflector position is recalculted each frame with the transform call.
I am all for a fix if needed, but please double check where we use it to be sure we are not breaking smthg else even if I do not think so
I figured something was going wrong, because no matter what I would do with these reflection planes and probes they don’t represent real world reflections after transforms.
PR:
YEAH BOY! thats what im talking about, where did you learn to math so well @Evgeni_Popov <3
I don’t do math well, I just didn’t understand why we couldn’t see the sphere in the reflected cube, so I kept looking for the bug until I found it
You could fool me, everytime I’m stopped up by some math transform or matrix thing you come through. I gotta be your biggest fan hahaha thanks for all the help buddy.
You’re welcome
How bout this one?
https://playground.babylonjs.com/#CYN0YW#9