Marquee selection: aligning a plane to a BABYLON.MeshBuilder.CreateLines rectangle

Hi,

Still on my scrabble game where UX is my top concern as I really want it not only to be beautiful but to be super user friendly, 3d should serve the usability.

So I adapted the code I found on this playground to implemente a multi letters marquee selection: this is working great.

Now I would like to customize my selector to have it look like windows’one:


But I don’t really know how to proceed :frowning:
I guess the idea is to have a plane positioned on markers[0].position and to have its width and height based on positions difference against markers[1] and markers[3], but I don’t seem to make it work…

I gave a try also by updating the plane vertices, but no luck there too…

Sure that if I keed trying hard, I’ll finish to find a way but, I think the solution would be easy for a smart(er) guy :innocent:

oh, and as a bonus, if you could confirm I cannot style the lines from a BABYLON.MeshBuilder.CreateLines … I would have like to make some tries… like playing with alpha (visibility) or dotted line, but It doesn’t seem to be possible… and color is Color3 (not 4…)

Okay, playing with plane.scaling instead of plane.height and plane.width, looks almost good: https://www.babylonjs-playground.com/#Q5KMXP#84

I guess what is now missing is that lines.billboardMode = 7; makes the BABYLON.MeshBuilder.CreateLines facing the camera while my plane is perpendicular to the ground… so I might be able to adjust its rotation.x to match the camera angle but… that doesn’t feel robust…

In the playground the camera.beta is Math.PI/2 which is why the result is almost perfect… I my scene, my camera beta equals 0.5746, so the result looks very weird…

okay, I made work my existing mesh selection with the marquee selector from Evgeni_Popov here Select Box optimization (Select Box/Select Cube/VertexData) - #8 by Evgeni_Popov

this kills two birds with one stone as it uses a GUI rectangle I can completly style :slight_smile:

2 Likes