mind0n Posted November 10, 2018 Share Posted November 10, 2018 Refer to the demo below, a GUI line can connect a mesh & a control at the same time by using: line.linkWithMesh(sphere); line.connectedControl = rect1; However, what I want to achieve is that let GUI line link with 2 meshes, each at the end of the line. (eg. line.linkWithMesh(sphere1, sphere2); Is there any way to achieve this? https://www.babylonjs-playground.com/#XCPP9Y#39 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 10, 2018 Share Posted November 10, 2018 Hiya M! Hey, if the lines are NOT GUI... would that be okay? https://www.babylonjs-playground.com/#1EBCJY#3 GUI lines are not designed to connect mesh together, but, there still might be a way to do it. I'll think real hard, and we'll listen for other ideas/help. (Unless non-GUI lines will work.) Unfortunately I don't think there is a thickness setting... for these non-GUI lines. Others have done some things with thin cylinders... placed between mesh (between the mesh.positions, so cylinders can go INTO the mesh... to its origin/pivot-point). Do a playground search for 'vend'. I remember all the "cylinderBetweenPoints" experiments... used 'vend' as the name of the ending vec3 target. https://www.babylonjs-playground.com/#T7M9U#0 <- that is rather nice, and small. But, as you can see, something changed in the newer versions of BJS... that make the cylinder NOT connect to the spheres. hmmm. I'll see if I can fig why. It might be due to some changes in setPivots. Something about... changing pivots USE TO move the mesh, but in newer BJS, it doesn't. Or the opposite of that. I can't remember right now. Help from others... welcome. Stay tuned for more ideas. Quote Link to comment Share on other sites More sharing options...
mind0n Posted November 11, 2018 Author Share Posted November 11, 2018 Hi @Wingnut, Thanks for the feedback, your example looks great. However, I have to use a GUI line to connect 2 meshes. That's because I need to keep all the lines at the background so the lines never display in front of any mesh no matter how user rotates the camera. I really appreciate if GUI lines could support this feature (connect 2 meshes with a single line). 8 hours ago, Wingnut said: Hiya M! Hey, if the lines are NOT GUI... would that be okay? https://www.babylonjs-playground.com/#1EBCJY#3 GUI lines are not designed to connect mesh together, but, there still might be a way to do it. I'll think real hard, and we'll listen for other ideas/help. (Unless non-GUI lines will work.) Unfortunately I don't think there is a thickness setting... for these non-GUI lines. Others have done some things with thin cylinders... placed between mesh (between the mesh.positions, so cylinders can go INTO the mesh... to its origin/pivot-point). Do a playground search for 'vend'. I remember all the "cylinderBetweenPoints" experiments... used 'vend' as the name of the ending vec3 target. https://www.babylonjs-playground.com/#T7M9U#0 <- that is rather nice, and small. But, as you can see, something changed in the newer versions of BJS... that make the cylinder NOT connect to the spheres. hmmm. I'll see if I can fig why. It might be due to some changes in setPivots. Something about... changing pivots USE TO move the mesh, but in newer BJS, it doesn't. Or the opposite of that. I can't remember right now. Help from others... welcome. Stay tuned for more ideas. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted November 11, 2018 Share Posted November 11, 2018 We have the multiline for that: https://www.babylonjs-playground.com/#XCPP9Y#714 Doc: https://doc.babylonjs.com/how_to/gui#multiline Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.